Skip to case study
BRETT BERRY
Back to selected work
SELECTED WORK / 04Language & developer tools

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
WORKFLOW DIAGRAM / 04Documented approach · not a product screenshot
01 / PROJECT FOCUSRust

language implementation

02 / PROJECT FOCUSSource → run

lexer, parser & evaluator

01 / OVERVIEW

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
02 / THE PROBLEM

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.

03 / ROLE & APPROACH

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.

04 / THE SOLUTION04 — 07

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.

  1. 01

    Lex

    Recognize the tokens in .fg source.

  2. 02

    Parse

    Build a representation of the program.

  3. 03

    Evaluate

    Execute through the interpreter and CLI.

A closer look at the thinking behind the work.
05 / OUTCOMES & LEARNING

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.

06 / TOOLS & LINKS

Behind the build.

  • Rust
  • Cargo
  • VS Code syntax grammar
HAVE SOMETHING IN MIND?

Let’s make
what’s next.