Houchi Chan
All projects

Project transmission / 2022

Custom Language Interpreter

Built an interpreter end-to-end in OCaml: lexer, parser, AST, the works. Supports variables, recursion, stacks, and decent error messages.

Year
2022
Technical stack
OCaml

I built this interpreter end to end in OCaml to follow source code through every stage of a small language implementation. Input is tokenized by a lexer, transformed by a parser, represented as an abstract syntax tree, and then evaluated.

The language supports variables, recursive behavior, and stack operations. Error handling is part of the implementation rather than an afterthought, so malformed programs produce useful feedback instead of failing silently.

  • Lexer, parser, and abstract syntax tree implemented in OCaml
  • Variable and recursion support
  • Stack-based language operations
  • Structured error messages for invalid programs