News for hackers. Stuff that matters.
Re:Let’s Build a Compiler (1995) by jacquesm on Saturday September 25, 2010 @12:10PM (#1727220)
Wow, what a great article compared to more 'angelgate' stuff.

Interesting how something from 1988 can still be applicable today, even if pascal is 'mostly dead' the principles are valid.

It would be neat if someone took this as a base and used it to implement - and document - a language that people are more familiar with today.

If not for Borland Pascal would have died out long ago, but even today a fairly large number of people still hold on to the modern incarnation of it.

Re:Let’s Build a Compiler (1995) by barrkel on Saturday September 25, 2010 @01:06PM (#1727338)
A problem is that the closest language, in terms of abstraction stack, would probably be C, and people who know C wouldn't benefit as much from it, because C users these days tend to be older and more experienced, and because far fewer beginners start out with C. Pascal has always been more beginner friendly. Ironically, the most maligned part of Pascal historically - its type safety - has long since won the day, albeit with polymorphism that Pascal lacked.

In theory, it might be nice to do something along the lines of Ruby, Python or Javascript, but those languages are, I think, too far removed from the CPU opcodes to get the same effect. Meta-circular interpreters, like in Lisp etc., are cute and are good for explaining the fundamental semantics of the language, but there's still an awful lot of magic baked in, in the same way that a C compiler written in C can embed the meaning of '\n' as a '\n' literal constant in the source itself. Of course, that magic may be subverted, most famously in the trusting trust essay:

http://cm.bell-labs.com/who/ken/trust.html

Re:Let’s Build a Compiler (1995) by kragen on Sunday September 26, 2010 @03:40AM (#1728760)
I wrote a metacircular compiler-compiler that generates parsers in PostScript: http://github.com/kragen/peg-bootstrap and a bootstrapping compiler for a very simple Forth-like language: http://github.com/kragen/stoneknifeforth (although I need to fix it so it will run on current kernels; apparently I cut some corner in the ELF spec...)
Re:Let’s Build a Compiler (1995) by sjs on Saturday September 25, 2010 @02:37PM (#1727505)
I don't know if it's that important as Pascal is pretty straight forward. I was able to follow along[1] and translate Pascal to Ruby on the fly even though I don't really know any Pascal. I certainly understand the resulting Pascal-ish language.

I have a feeling that most people with the will to read a tutorial on compilers, and actually make it through the first chapter, are smart enough and work hard enough to figure it out.

[1] In case anyone's interested: http://github.com/samsonjs/compiler instead of emitting assembly instructions it emits x86 machine code directly.