This CS4215 Project is an implementation of a sublanguage of rust, applying the notion of virtual machine. The program can be run on sourceacademy by enabling the conductor framework.
The program is first passed to the type checker and the type evaluation for the parse trees will be cached to be used later. The type cache is then passed to the borrow checker to determine whether a variable is to be copy or moved. The borrow checker itself acts both as a borrow checker and a drop checker. After the checks, the type cache is the passed again to the compiler which compilers the parse trees into simple instructions for the evaluator to run.
-
src/typeCheckerContains code responsible for making sure the passed program is type sage -
src/borrowCheckerContains code responsible for compile time drop and borrow checks. Assumes program has passed type checks. -
src/compilerCompiles the program into simpler "VM"-like instructions. Assumes program has passed type checks -
src/evaluatorContains code for running the "VM" instructions.
- Go to https://sourceacademy.org
- Set conductor to https://elben85.github.io/CS4215-Rust-Project/index.js
- Run the program
Install all the necessary dependencies for the app.
Compiles the app from typescript to javascript.
Runs the test suite. Requires dev dependencies to be installed
Generates the antlr4g parse specified using the grammar specified in src/Rust.g4