4 ms·
I own just about all the compiler construction books. Most were over my head. Then I discovered chapter 8 of "The Unix Programming Environment" by Brian Kerni
by BarbaryCoast 3y ago
I own just about all the compiler construction books. Most were over my head. Then I discovered chapter 8 of "The Unix Programming Environment" by Brian Kernighan and Rob Pike. This is "Program Development", explaining all the tools one would use to write C programs. Their example, however, is a compiler. Unlike most introductions, they don't just show a 4 function calculator. They go on to add variables, control flow, and functions, making this a really great way to start building languages. Highly recommended, and a hidden jewel. (The full text is readily available on the net.)
- stevekemp 3y agoI had fun reading that chapter too, and expanding/extending the language. But it's worth noting that the code as published is an interpreter, not a compiler: https://en.wikipedia.org/wiki/Hoc_(programming_language) https://en.wikipedia.org/wiki/Hoc_(programming_language)
- WalterBright 3y agoBYTE magazine in the 70's published the source to a complete Pascal compiler as an article! Having no idea how compilers worked, I studied that code from stem to stern. Best BYTE issue ever! https://archive.org/details/byte-magazine-1978-09 https://archive.org/details/byte-magazine-1978-09 (part 1)
- parlortricks 3y agoI just found this PDF that contains all 3 parts of Tiny Pascal https://albillo.hpcalc.org/publications/Easter%20Egg%20-%20TBBOP.pdf https://albillo.hpcalc.org/publications/Easter%20Egg%20-%20T...
- agumonkey 3y agoImpressive. And also strange to see the drop in technical level for articles. I don't recall seeing anything of that depth in most online magazines.