This project implements the projects from PLAI in ocaml.
You should use the project with the latest version of the ocaml compiler. You can optain the latest version of ocaml with the use of the opam switch command.
Also this projects depends on core and ppx_deriving:
opam install core ppx_deriving
Clone the repo:
git clone https://github.com/StrykerKKD/plai-in-ocaml.git
cd plai-in-ocaml
To run a project from the repository you need to build it with jbuilder:
jbuilder build projectname.exe
./_build/default/projectname.exe
#For example(building the parser project):
jbuilder build parser.exe
./_build/default/parser.exe
(MultC (PlusC (NumC 1 ) (NumC 2 ) ) (PlusC (NumC 3 ) (NumC 4 ) ) )
Jbuilder automatically builds a .merlin file, so you only need to have merlin and an editor that supports it.
To install merlin: opam install merlin
.
I recommend using visual studio code with the Ocaml extension for this project.