Skip to content

Latest commit

 

History

History

lip24

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Tiny Rust

Initialize the project with:

dune init proj tinyrust

Build your code and run the tests interactively with:

dune test --watch

We encourage you to use the data structures provided by the OCaml standard library wherever you see fit. To name a few: Stack, Hashtbl, Array, Result, Option...

Your project may also depend on external opam libraries. For example, to get nice error messages from the parser, you can use the nice-parser library.

Test files

The tests make some assumption about the interface of your interpreter and where you put the useful functions. You're free to adapt the tests to work with your implementation, or vice versa.

The tests also depend on the ppx_expect library. Install it with:

opam install ppx_expect

And add ppx_expect to the dune file of your test directory, after ppx_inline_test, like this:

 (preprocess (pps ppx_inline_test ppx_expect)))

ocamlformat

We recommend installing the ocamlformat tool:

opam install ocamlformat

If your project contains the .ocamlformat file, ocamlformat will automatically format your code whenever you save your source file or press Ctrl+S, adding indentation and whitespace where appropriate.

You can also invoke the tool manually with:

dune fmt

Please format your code with the above command before handing in the project.

Resources