Extensible languages
Tuesday, March 28th, 2006 | Academe
Yesterday I attended a colloquium where Erik van Wyk from University of Minnesota spoke on techniques and tools for making extensible languages. Now extensible language may sound like a strange concept, but it is a fairly simple idea that lies at heart of this: I want to add this new construct to my language because it may simplify my work
. Now that’s a pretty basic motivation for us to do some work, so we don’t have to do so much work.
van Wyk et al. have developed something called Silver that allows them to specify these extensions using attribute grammars, which is a context-free grammar that has been extended with attributes, semantic rules and conditions. He described how they use forwarding in the attribute grammars to get modularity through refinement of the functionality of the extension.
What this means is that at the core level you could write an extension, say to introduce SQL statements directly in your language, you could introduce using connection select name, address from customers where balance > `balance and have it automatically converted to connection.Execute("select name, address from customers where balance > " + balance). This means at the core level your extension is nothing but a macro in the pre-processing sense.
Given your extension at the core level any error reporting, for instance is forwarded, is forwarded to your generated code. This is where the extension refinement comes in, because if you define the appropriate error reporting extensions to your module you could return better errors. And their framework builds further onto this, also making syntax- and control-flow analysis available using two temporal logics, CTL and LTL-FV. You can read more about temporal logics in Logic in Computer Science by Huth and Ryan.
Everything cannot be bliss, however, as this thing requires that the host language is written with these extensions in mind – that is, it has been written in Silver. van Wyk’s team is working on both a C and Java implementation, but given the sizes of in particular Java, it probably isn’t realistic that they’ll get a full model of Java for this. Another problem is, of course, that writing a full-fledged extension requires the programmer to know about attribute grammars, forwarding, temporal logic and a lot of other nitty gritty things. So, get ready to hire me or someone like me.
On a more realistic note I think the ramifications of having support for this in a language are huge as you can customise your language on the basis of your needs very easily. But I don’t think it will be feasible until the day that these extensions become easier to write. Until then I’m afraid it will remain an academic exercise, but here’s to hoping.
No comments yet.
Leave a comment
Categories
Archives
- July 2011
- June 2011
- November 2010
- October 2010
- April 2010
- November 2009
- October 2009
- June 2009
- May 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- December 2006
- November 2006
- October 2006
- September 2006
- June 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- June 2004
- April 2004
- February 2004
- November 2003
- January 2003
- November 2002