I thought chapter 8 of Kernigan and Pike. It covers most of the programming in a Unix environment, and it implements a programming language.
Chapter 8 is called "Program Development." It discusses the development of a non-trivial program at different stages of design. This non-trivial program is a high-speed calculator. For more information about hoc, see http://en.wikipedia.org/wiki/Hoc_(programming_language )
This is a great practical introduction to implementing a simple language using the standard yacc and lex tools. yacc and lex are too much to cover here, but by following the examples in this book and doing the exercises, you will develop an understanding of them.
Development continues at various stages; in the first stage, you donβt even have variables in the language. In the third step, you have variables, defined constants (PI, E, etc.) and built-in functions like sin () and log (). At the last stage, you have a fully implemented language.
Now, is the best language to try and implement? I have no idea, but I know that the Unix programming environment was an excellent book to read in parallel with the traditional compiler book. When I started reading the Aho compiler book (the book of dragons), I re-read chapter 8 of TUPE and followed the examples and exercises. Of course, anyone can rewrite the code from the book, but the exercises require that you well understand what is happening.
In the end, I donβt think itβs exactly which language you prefer to do, but the process that you are carrying out is in its implementation.
Mr. Shickadance
source share