Skip to content

Installing prepoly

Here we describe how to build and install the prepoly command-line driver.

First, clone the prepoly source code:

Terminal window
git clone https://github.com/cordx56/prepoly.git

prepoly is written in the Rust language. So first you have to install the Rust compiler.

You can learn how to install Rust here: https://rust-lang.org/tools/install/

After installing Rust, you can build the default native driver:

Terminal window
./x cargo build --release

The script x builds the bootstrap crate and executes commands via the bootstrap binary. The bootstrap binary downloads LLVM, which is required to use JIT compilation, and sets its path for the prepoly build.

The resulting binary prepoly is made under the target/release directory.

If you want the interpreter-only driver without LLVM, disable default features:

Terminal window
cargo build -p prepoly_driver --no-default-features

Run the following command to install the default native driver:

Terminal window
./x cargo install --path crates/prepoly_driver

Note that you have to add the path where the prepoly binary is placed to $PATH.

Terminal window
prepoly program.pp # type-check and run a program
prepoly check program.pp # type-check only; prints `ok` on success
prepoly repl program.pp # run a program with the interpreter (no JIT)
prepoly # start an interactive REPL

Any diagnostic (parse error, type error) is printed to stderr and the process exits with a non-zero status; nothing is executed unless the whole program checks.