Re: What language do most students use to write the assembler?
Posted by rgravina on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/What-language-do-most-students-use-to-write-the-assembler-tp1999299p4028739.html
UPDATE: For the VM (Chapter 7) I switched to Swift. I don't have the time/patience to deal with string manipulation and memory management in C right now!
I wrote mine in C. It's definitely a lot harder than one in a language like Ruby or Python would be, but but I did it for a couple of reasons.
* I'm doing nand2tetris to learn more about how computers work. So when it comes to the programming projects I don't mind having to deal with the low-level details as that's what I'm here for. I could whip up an assembler in Ruby but I wouldn't learn nearly as much.
* If I ever did want to implement my own language (or work on one of the popular ones out there) there's a good chance the compiler or VM for that will be written in C.
I've just started the next project (VM instructions to assembly instruction compiler) in C too :).
I should note though I took a lot of shortcuts to get something working, like having a fixed sized array for commands and symbols (instead of using linked lists and hash tables). I plan to come back and improve that later once I've I done more of the later states.