Hi everybody,
I'd like to thank Charlie for setting up a fun night of conversation about my (and I'm sure many others') favorite topic. I learned a few things about some interesting work, like OMeta, that I probably wouldn't have looked into on my own.
The subject of parsers and parser-generators came up and was talked about quite a bit. The PEG/packrat angle was explored in some detail. For folks who are more old-fashioned (like me) and are happy with LALR(1) -- I just wanted to point out what's arguably the absolute best treatment of the LA-set determination algorithm (with apologies to Al Aho and the dragon book's awkward pumping technique). I've written a few parser generators based on this relational technique, and it's the same one used in the GNU Bison tool (and presumably Jison):
http://www.win.tue.nl/~wsinswan/softwaretools/material/DeRemer_Pennello.pdf
Parsing aside (moving on to, you know, compilers) I was hoping to talk a little bit about some of the things I'm toying with in my little compiler project. So far, it's a fairly typical division with a monomorphically-typed lambda calculus on top, compiling to an abstract machine code, and finally to x86 machine code (and I've already written all of the tedious packaging code to generate PE files for Windows, and ELF files for Linux). I had to dust off my Intel processor manuals to get the code generator out, but I think that it's worth it to know how the whole thing works bottom to top.
Also, maybe a more mundane compiler topic, I've come to the conclusion, after the last few years of writing compilers for functional languages, that function application rightly ought to be treated as a case of overloading within compilers. Qualified types (
http://www.amazon.com/Qualified-Types-Practice-Distinguished-Dissertations/dp/0521543266) and type classes give us a principled approach to overloading, and the traditional problems of so-called "lambda lifting" and "defunctionalization" ought to be recast in those terms. I've found that reworking my compiler in this way has made the introduction and elimination of closures (and their optimization) much more natural. As well, making the overloading of function application primitive makes it easier to support other, less common, reasonable interpretations (like arrays as functions from their indexes to their elements, likewise for hash maps, etc).
Finally, after a couple of conversations with fellow attendees, I wonder if others are familiar with the application of algebra and calculus at the level of datatypes (
http://blog.lab49.com/archives/3011). There's some fertile ground here for designers of programming languages (let's all at least agree to start with algebraic data types).
I look forward to talking with you all at the next meetup.
-Kalani