Authors/Maintainers:
- 22125113 - Nguyen Quang Truong
- 22125078 - Dinh Cao Minh Quan
- 22125121 - Dinh Hoang Viet
- 22125051 - Pham Phu Loi
we vibe code a smol ocaml based language
- Variables
- Functions
- Recursion
- Mutual Recursion
- Higher order functions
- Closures
- Basic integer arithmetic operations (
+
,-
,*
,/
,mod
) - Basic boolean operations (
&&
,||
,!
,=
,<>
,<
,>
,<=
,>=
) - Control flow
- Hindley-Milner type inference
- Concrete types (
int
,bool
,()
, function types) - Polymorphic types
- Concrete types (
- Install OCaml
- Clone this repository and enter the directory
- Create an OPAM switch (we use 5.3.0, but older versions should work as well)
opam switch create . ocaml-base-compiler.5.3.0
- Install dependencies
opam install . --deps-only
- Build the project
dune build
- Run the project
dune exec smol <path-to-file>
See the examples/
directory for example programs.
For example, to compile examples/1.ml
:
dune exec smol examples/1.ml