NetIDs: ag2583 (Arnab Ghosh), amh445 (Adam Hoskin), clm357 (Cam Mazzacane), sz684 (Shawn Zou) Build System: Gradle Java
Bo Nix is a Campiler.
Compiler for Cornell's CS 4120 Eta and Rho languages. This PA6 submission
supports .eta / .eti as well as .rh / .ri, along with optimization
reporting, CFG dumps, register allocation, and Rho records/modules.
On your local machine, ensure you have installed Java 25. From the project
root, run ./etac-build to build the compiler distribution. Then run the
compiler with ./etac.
Examples:
- Compile an Eta program:
./etac -libpath runtime/include runtime/examples/fact.eta - Compile a Rho program:
./etac -libpath src/test/resources/examples src/test/resources/examples/rho/point.rh - Emit IR and CFG snapshots:
./etac --irgen --optir initial --optir final --optcfg initial --optcfg final -D out -libpath src/test/resources/examples src/test/resources/examples/rho/point.rh
If you want improved binary performance (around ~30%, in our manual tests, with a long-running
program), we added a Gradle command (nativeCompile) that uses GraalVM to generate a native
executable. We ran through every single one of our tests and a few long-standing brute-force
algorithms, generating a default.iprof performance profile. When running the nativeCompile command
in Gradle, you will utilize this generated iprof with the PGO option in GraalVM (profile guided
optimization) to build a faster binary. Requires GraalVM to be installed and is NOT REQUIRED at
all to run our program.
- Standard Eta interfaces live in
runtime/include/. - Rho interface files use the
.riextension.
Complete the following instructions from the project root directory. Ensure that you have Docker installed with the Docker Daemon running.
- Build our Docker image using our custom
Dockerfile:docker build -t campiler-4120 . - Run the image:
docker run -it -v <absolute path to shared folder>:/home/student/shared campiler-4120 - Ensure that the shared folder contains the compiler (this directory).
- Enjoy your virtual experience.