News for hackers. Stuff that matters.
Re:Basics of Compiler Design [pdf] by Simucal on Sunday May 10, 2009 @09:31PM (#602790)
In his first section he describes a compiler as something that turns high-level code into machine code. This isn't necessarily true is it?

A compiler is something that takes code in one language and converts it to another. It can be a Python to Javascript compiler, or a C to x86 Assembly Compiler (which can then be assembled using an appropriate assembler).

I'm reading both Louden's "Compiler Construction: Principles and Practice" and the Dragon Book. They are both good so far.

Re:Basics of Compiler Design [pdf] by wlievens on Monday May 11, 2009 @05:38AM (#603229)
The thing is, if you make the definition too generic, everything turns out to be a compiler. For instance, Photoshop is a compiler that turns commands in the UI (the input language) into PSD files (the output language). It's a lot harder to define terms like "compiler" than it actually seems.
Re:Basics of Compiler Design [pdf] by eru on Monday May 11, 2009 @12:04PM (#603701)
And you have to differentiate your definition for 'compiler' from 'interpreter'. And point out, that those two sit on opposite ends of the same spectrum.
Re:Basics of Compiler Design [pdf] by wlievens on Monday May 11, 2009 @04:15PM (#604230)
Even that is a fuzzy barrier. You have lots of languages that have the compiler built-in to the runtime environment (Smalltalk, and I guess most lisps?). Anything with JIT blurrs the line, too.
Re:Basics of Compiler Design [pdf] by eru on Tuesday May 12, 2009 @04:16AM (#605054)
Yes, that's what I was trying to say by mentioning a "spectrum". Threaded interpreters are also closer to compilers than most.