Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This book was my introduction to OCaml, and I followed it concurrently with the Nand2Tetris course. Project 6 of Nand2Tetris [1] has you write an assembler for their hack computer, and OCaml seemed like a perfect fit. Chapter 10 of this book introduces you to parsing and lexing, and it was really fun following along while writing the hack assembler.

Here's an implementation for those interested: https://github.com/senhorsolar/hack-assembler

[1] https://www.nand2tetris.org/project06



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: