top | item 1408241

An Incremental Approach to Compiler Construction

77 points| l0stman | 16 years ago |scheme2006.cs.uchicago.edu | reply

18 comments

order
[+] mahmud|16 years ago|reply
That paper is epic. It's actually a tutorial for undergrads on compiler construction, however, Ghuloum does nothing but code generation. From start to finish.
[+] wingo|16 years ago|reply
It is one of my favorite papers, and a gateway to a wealth of information available for hack/self-study.

It does have the insidious aspect though that if you get something halfway working and you like it, you will spend thousands of hours making it perfect. It seems an OK bargain, though...

[+] thefool|16 years ago|reply
As someone who knows very little about compilers, is there any good place to read up on the very basic terminology and such (what a parser is, what they mean by code generation, and get a rough outline how code goes from language to something the processor can understand) that is on a slightly more abstract level than this paper?
[+] MarkBook|16 years ago|reply
here is what you are looking for. http://www1.idc.ac.il/tecs/ With this I built not only a compiler but a virtual machine, an assembler AND the machine it all runs on! It's the most awesome book I ever came across. You will come away from this so much more confident in your knowledge of how computers really work. I can't recommend it highly enough especially if you don't have a computer science background as I don't.
[+] rarestblog|16 years ago|reply
I'm assuming most compilers don't ship nasm/masm/whatever with them. How do compilers do actual "assembly to executable" step?
[+] kmavm|16 years ago|reply
Historically, C compilers really did run an assembler in a separate process and communicate with it via pipes or files. gcc still ships with gas. gas is more oriented to the needs of a compiler than to human writers of assembly code.

Some compilers emit machine code from their own low-level intermediate representation, though. The trade-offs are similar to any other build/buy technical decision: full-custom gives you more control, while forcing you to reinvent the wheel.

[+] larsberg|16 years ago|reply
At least as of ~four years ago or so, this is how the compiler construction course was taught at IU, according to one of my co-Ph.D. students who went there. He loved the course and its debuggable-at-each-step architecture.
[+] kragen|16 years ago|reply
This is a great paper. It was one of my biggest inspirations for writing Ur-Scheme.