I am looking for a compiler design book. I am learning it at college; but lectures were never meant for me. Moreover, at my college they don't do much practical and I believe even if I sincerely do the course about finite automata and compiler design, I will not know how to implement a compiler. So, I am looking for books about implementing a compiler. I find "Modern Compiler Implementation" good. It had three options of language and I chose the C book because C being a small language there will be more for me to do and more to learn during doing. However, I wanted to learn the course designing a compiler for Lisp or python [may be in the same language too]; but I could not find much material available. Lisp is an old language and there should be some documentation about designing a compiler for it. I need your suggestions regarding this.
Thank you.
Introduction. Lisp is the second-oldest high-level programming language still in use (after Fortran) and the first functional language.
Lisp is a compiled general purpose language, in its modern use.
Even progressive companies willing to use a more powerful language usually don't choose LISP. This is because many of the newer languages try and compromise by borrowing powerful features from LISP, while staying easy to learn for the masses.
Lisp in small pieces is probably the best book on implementing Lisp. Highly recommended. Probably available through some used book service. It might be expensive, even as a used book. It is a translation from the French original. There is also a revised version in French, which hasn't been translated to English - unfortunately.
I would also recommend Paradigms of Artificial Intelligence Programming, Case Studies in Common Lisp by Peter Norvig. It contains the description of a Scheme compiler written in Common Lisp. Generally this is an outstanding book.
Also see this Biblography on Scheme implementation techniques.
For Common Lisp there are articles available and some Common Lisp compilers are coming with a little bit of documentation of implementation and compiler internals. Usually the compiler can't be seen in isolation, but should be seen in combination with the runtime it compiles to (GC, instruction sets, memory management in general, threading, FFI interfaces, ...). See for example the Design of CMU Common Lisp.
Here is a great overview of a compiler design for Scheme: An Incremental Approach to Compiler Construction. It's a quite short article that describes how to build a machine code compiler for Scheme "from scratch".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With