Fig.
A scripting language built in Rust. A lexer, parser, evaluator, and small CLI make the journey from source code to execution visible.
Explore the project- 01LexRecognize the tokens in .fg source.
- 02ParseBuild a representation of the program.
- 03EvaluateExecute through the interpreter and CLI.
Not a product screenshot
language implementation
lexer, parser & evaluator
The work,
in context.
Fig is a small scripting language implemented in Rust. It includes a lexer, parser, evaluator, and CLI that can run .fg files or scaffold a new Fig project.
- ROLE
- Language & tooling development
- PROJECT TYPE
- Language & developer tools
- CONTEXT
- Language development project
Where it began.
Language design turns a compact piece of syntax into a chain of concrete decisions: how to recognize tokens, represent a program, resolve values, and execute it. Fig is a way to work directly with those boundaries and the tooling around them.
Decisions that
shaped the work.
The implementation separates tokenization, parsing, evaluation, environments, and value types. I also developed a separate VS Code syntax-highlighting extension for .fg files.
From the idea
to the actual.
The Rust project provides the language pipeline and the fig run and fig new CLI commands. A separate TextMate grammar and editor theme supply syntax highlighting in VS Code.
- 01
Lex
Recognize the tokens in .fg source.
- 02
Parse
Build a representation of the program.
- 03
Evaluate
Execute through the interpreter and CLI.
What came
out of it.
The implementation connects source files to an evaluator and provides a small command-line workflow around the language. The companion extension contributes syntax highlighting.
Behind the build.
- Rust
- Cargo
- VS Code syntax grammar