Skip to content

Repository files navigation

Bo Nix

images F-ujycv2_400x400 my-cat-is-so-cute-v0-at5ivl55oioa1 jpg copy

NetIDs: ag2583 (Arnab Ghosh), amh445 (Adam Hoskin), clm357 (Cam Mazzacane), sz684 (Shawn Zou) Build System: Gradle Java

Bo Nix is a Campiler.

About

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.

Building and Running

Running the Program:

Using Gradle (preferred)

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
GraalVM Native Image (new) (very cool)

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.

Interfaces and Runtime Files

  • Standard Eta interfaces live in runtime/include/.
  • Rho interface files use the .ri extension.

Using Docker

Complete the following instructions from the project root directory. Ensure that you have Docker installed with the Docker Daemon running.

  1. Build our Docker image using our custom Dockerfile: docker build -t campiler-4120 .
  2. Run the image: docker run -it -v <absolute path to shared folder>:/home/student/shared campiler-4120
  3. Ensure that the shared folder contains the compiler (this directory).
  4. Enjoy your virtual experience.

Design Documents

About

Compiler for Cornell's CS 4120 Eta and Rho languages, with register allocation, optimizations, and Rho records/modules

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages