Contents

OCaml Learning-III

Implement your own Lisp

Why

The goal is to re-implement the Pie language in OCaml. The Pie language is a dialect of Lisp written in Racket to elucidate dependent type theory in the book the Little Typer.

How

As a starter, we will following the tutorial from previous blog and setup the project structure.

After setting up the project skeleton, we could use racket -l pie -i to start the Racket repl and interact with Pie through the REPL.

The REPL

The next thing is to implement an REPL(Read-Evaluate-Print-Loop) to allow user to interact with the language

Parser

The very first thing in a REPL is to define the grammer. We notice that ' is a keyword in Pie language. We will implement that first.