The L programming language
Author: Larry McVoy
As the Tcl/Tk community knows, we use Tcl/Tk for our GUIs at BitMover. What may not be as well known is that we easily spend 10x more time reading code than we spend writing it. At BitMover, writing is easy, reading is hard. Anything we can do to make reading easier pays off with a 10x multiplier.
We have a love/hate relationship with Tcl/Tk. We love what we can do with the language, it's amazingly powerful. Far more powerful than any simple language like C. On the other hand, it's hard for humans (well some humans) to parse.
We spent some amount of effort trying to get the Tcl language to evolve to be something that us mere mortals could read. I'm here to tell you that that was a mistake. Messing about with Tcl is just a mistake, if you want to make it simple you lose the power. We finally realized that. Tcl is cool, it's just fine where it is and we should leave it alone.
None the less, we wanted something that mere mortals could write and (more importantly) read. So how do we do that? Well, we realized that Tcl is really a runtime plus a byte code interpreter. The runtime is cool, we like that. And the byte code interpreter gave us an out. We're a bunch of C programmers. What if we were to add to Tcl a way to type C like code and have that be compiled to Tcl byte codes? And what if we insisted that the C like code (which we call L) obey all the Tcl calling conventions and Tcl variables? Could we have a system where you could mix and match Tcl code and C like L code, having them call each other and not know the difference?
The answer is yes, we've done that, and this paper is about how we did it and what it looks like. It looks a lot like:
We'll demo what we have and listen to suggestions as to how it ought to be evolved. The code is open source under the same license as tcl. We'll maintain tcl/tk distributions for pretty much all platforms (a superset of what ActiveState maintains) so people can play without having to recompile.
While our goal of this work was to get to a language that we could use for major projects (>100K lines), the ideal answer is that this brings more people to the Tcl/Tk community.
--- lm at bitmover.com http://www.bitkeeper.com