DSL -- A Programmer's View
This was a survey of different techniques for implementing domain specific languages (DSLs) given by an academic. I thought it was a good blend of principles and practice, summarizing the advantages and disadvantages of different approaches.
Of the tools discussed, I had only seen ANTLR before. There was also a tool called SableCC that really seemed to offer little advantage over ANTLR. The main difference I saw was that you could embed little snippets of your target language in ANTLR but not SableCC.
The core examples were done in Haskell and, although I'm barely familiar with the language, I think it works really well in this kind of scenario because its syntax is clean and therefore does not distract one from the points being made. Both the embedded parser (Parsec) and embedded language worked well.
My recollection of the major points:
- compilers offer optimization and high performance (if you put enough effort into them) but are very inflexible and the source tends to get "lost" in compilation, leading to problems understanding the resulting system, particularly if it needs to be debugged
- interpreters are quite flexible and can be made to generate high quality error messages customized for the domain; performance is often poor
- DSLs implemented with either compilers or interpreters are hard to compose, hard to decompose; on the other hand you can easily add new semantics for the language just by writing a new compiler or interpreter for it
- for the presenter, a very interesting option is "polymorphic embedding"; unfortunately he did not have time to present this, so I'll have to read the slides when I get them
That's it for OOPSLA for me this year. Next year it's SPLASH in Reno. I haven't yet decided if I want to go again or try something else instead.
Random Observations
The Jeopardy-style quiz was interesting. None of the three teams could identify a design pattern projected as a diagram on the big screen. Even the audience, which included big names from the pattern community, had problems. It looked a bit like the Proxy pattern, a bit like Strategy. It turned out to be the Bridge, which I think is a good choice for a quiz. It is not one that ever struck me as one I'll be eager to apply. Perhaps it's a good interview question if you want to deliberately make a candidate uncomfortable.
I finally did get to talk to some people informally on Wednesday, but for an outsider, the "hallway track" seems pretty mythical. I had the impression there were cliques and tribes and I felt very much the outsider. Perhaps this is an argument for going to the same conference multiple times, though I could see the danger of it getting incestuous after a while. And OOPSLA has been going for decades now...