Skip to content

matthias-wright/jack-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jack Compiler

This is a compiler front-end for the Jack programming language. The Jack programming language is a simple object-based language, specified in the amazing book The Elements of Computing Systems.

Here is a Hello World program in Jack:

class Main {
   function void main() {
      do Output.printString("Hello world!");
      do Output.println();
      return;
   }
}

The compiler front-end compiles Jack code into VM code that is then executed on a virtual machine.

Usage

Compile the Jack compiler:

cargo build --release

Compile a Jack file:

jack_compiler <INPUT_FILE>.jack

Compile a directory of Jack files:

jack_compiler <INPUT_DIR>

Documentation

To read the documentation, open the file doc/jack_compiler/index.html in a browser.

Tests

The tests compare the outputs of each component (parser, tokenizer, VM writer) to the outputs of the reference implementation.

Running all tests:

cargo test

License

MIT

About

A Jack compiler written in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages