Minima Compiler & IDE

Case study
React Python Flask Lark Monaco Editor Material UI Google Gemini
Minima Compiler & IDE — screenshot 1Minima Compiler & IDE — screenshot 2Minima Compiler & IDE — screenshot 3Minima Compiler & IDE — screenshot 4Minima Compiler & IDE — screenshot 5Minima Compiler & IDE — screenshot 6
200+
students reached
6-person
team led
5-stage
compiler pipeline

Overview

Minima is a beginner-first programming language and the browser IDE that runs it — a complete compiler pipeline you can watch execute stage by stage as you type. As Lead Developer of a six-person team, I designed the language and built the full stack: a custom lexer, a Lark-based parser, a semantic analyzer with a live symbol table, a three-address-code generator, a tree-walk interpreter, and a Gemini-powered in-editor assistant. It is used as a study reference by 200+ PLM undergraduates.

Context

Built over roughly six months for Automata Theory & Formal Languages and Compiler Design. Those courses ask students to reason about phases they never actually see — tokens, parse trees, symbol tables, and intermediate code stay abstract diagrams on a slide. We committed to two things: a language simple enough for beginners, and an IDE that makes every compiler phase visible, so students watch their code move through the pipeline instead of memorizing it.

My Role

Lead Developer on a team of six. I built the entire stack end to end — the language design, the full compiler pipeline, the IDE, and the AI assistant — and set the technical direction throughout, directing the rest of the team on testing, documentation, and QA.

Architecture & Key Decisions

Split full-stack: a Python (Flask) backend runs the compiler; a React frontend hosts the IDE.

  • Language design first. Minima uses intention-revealing keywords — var/fixed for mutable and constant bindings, checkif/recheck/otherwise for conditionals, each/repeat for loops, show/get for I/O, throw to return. Six types (integer, point, state, text, list, group), 20 built-in functions, dynamically typed but semantically checked.
  • Custom lexer, Lark for the parser. I hand-wrote the lexer for precise, token-level error reporting, and used Lark for the grammar so the syntax could evolve quickly without rewriting a parser by hand.
  • Every stage emits an inspectable artifact. The Lexer, Syntax, Semantic, and CodegenTAC modules each return their output — tokens, parse tree, symbol table, three-address code — to the IDE, so the frontend renders each phase live as you type.
  • Rate-limited API. The Flask backend (Flask-Limiter + CORS) runs arbitrary user code and calls Gemini, so per-client rate limits protect the public deployment.
  • AI grounded in the spec. “Minima Copilot” feeds Gemini the full language specification as its knowledge base, so its help is specific to Minima rather than generic autocomplete.
  • Deployed split: React frontend on Vercel, Python backend on Render.

Hardest Challenge

The pipeline had to stay correct and responsive under a flood of malformed, half-written input — every keystroke re-lexes, re-parses, and re-analyzes, then pushes fresh tokens, AST, symbol table, and TAC back to the UI. Three things fought back: edge cases at every stage (partial tokens, ambiguous constructs, and invalid programs that still had to produce a useful error instead of a crash), designing an unambiguous Lark grammar for custom syntax like match, group, and do…repeat without conflicts, and generating correct three-address code across the whole language. The bulk of the work was making each stage degrade gracefully — surface a clear error rather than fall over — so the live view stayed trustworthy no matter what a student typed.

Outcome & Impact

  • Adopted as a primary study reference by 200+ PLM undergraduates.
  • A complete, working language — six types, full control flow, 20 built-ins — not a toy subset.
  • Live and deployed, with an AI tutor built directly into the editor.