WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

AlexanderPortland/rice-compiler

Repository files navigation

The Rice programming language

Build the compiler

For testing:

cargo build

For profiling:

cargo build --profile profile

For deployment:

cargo build --release

Run the compiler

After building, run:

./target/debug/rice sample.rice

Replace debug with either profile or release depending on the build. Add -h to see all options. To build and run in one command, run:

cargo run -- sample.rice

Test the compiler

To run the normal tests in the compiler, run:

cargo test

To run the snapshot tests, install cargo-insta. Then run:

cargo insta test

Debug the compiler

The compiler uses env_logger to print logs. To get all logs at the debug level and higher, run with RUST_LOG="rice=debug". For example:

RUST_LOG="rice=debug" cargo run -- sample.rice

You can reduce the noisiness by either increasing the log level like RUST_LOG="rice=info" or by narrowing the module scope like RUST_LOG="rice::rt=debug".

Profile the compiler

Install samply, then run

cargo build --profile profile
samply record ./target/profile/rice perf/mandelbrot.rice

Reading the codebase

You can generate documentation for each module by running:

cargo doc --document-private-items --open

About

The toy compiler I'm developing as part of Brown's Topics in PL course

Resources

Stars

Watchers

Forks

Languages