From Nand to Tetris(Nand2tetris) Project 9

Yizhe Wang
2 min readMay 14, 2020

Jack Language

My solution with a target shooting game

Jack is a high level language designed by Shimon and Noam, it has almost all the necessary elements of the modern computer language, it’s high level and OOP. It’s more like Java, but it doesn’t have inheritance.

It has very limited built in data types: int, string, boolean, but it can be easily extended.

It handles “not” as “~” instead of “!”

It doesn’t have built in support for matrix(array of arrays), but we can build a matrix class to solve this problem. It almost have everything, and super expandable. It also has some back doors that can help system level programmers to manipulate the hardwares.

For example, it’s not super strict about data types, Array can be assigned an integer value directly. Which means we can create an array just for manipulating memories.

var Array memory;
let memory = 0;
// now memory becomes the pointer to the whole memory slot. we can easily peek and poke memory with this technic, but this could also bring security concerns as manipulating the memory may not be the access that we want to give to random programmers. It may mess up the OS and other stuff. So be careful.

The task for project 9 is pretty simple, it’s just to create some kind of program with the jack language, it’s better be interesting.

If you have basic high level language experience, the project 9 won’t be a problem for you.

--

--