Skip to content

Foundations-of-Decentralization-Group/Pirouette-Compiler

Repository files navigation

Install dependencies

opam install . --deps-only --with-test

Build pirc

dune build

Run tests

dune test

Build and execute

dune exec pirc -- [options] <file>

if it has been installed by dune install you can run it directly:

pirc [options] <file>

E.g.:

cd examples
dune exec pirc -- -ast-dump json ex1.pir
pirc -ast-dump json ex2.pir

Then pirc will parse the file and dump the ASTs to the current directory (in pretty-printed format by default).

Options

  • -ast-dump <pprint|json>: Dump the AST in pretty-printed (default) or JSON format.

  • -msg-backend <domain|http|mpi>: Specify the backend for parallel execution. domain (default) for Domain(thread)-based parallelism; http uses the HTTP backend ; mpi uses the Message Passing Interface, often across multiple machines.

  • -<pprint|json|dot>: Dump the AST in pretty-printed or JSON format, or generate a DOT file for AST visualization.

035a805a22b24c518650e3499f7d2bd01ced7f52

  • use - to read the source code from stdin. E.g.:
cat examples/ex1.pir | dune exec pirc -- -
  • use -o <file> to write the output to a file. E.g.:
dune exec pirc -- -json examples/1.pir -o out

Pipeline Testing

Tests are added by placing .pir and .ans files in test/test_src, then running dune test in the root directory. The test runner will compile the .pir file, run the compiled program, and compare the output to the .ans file. If the output matches the .ans file, the test passes. [TODO]

Documentation

make docs

Then open pdf files in docs directory.

Contribute

Contributors 12

Languages