Friday, February 22, 2008

Ted Neward speculates on the future of development tools

I think Ted Neward really hit the nail on the head with this recent blog post about modular toolchains. In it, he describes a future in which a series of languages all compile their syntax to the same Abstract Syntax Tree (AST), and that AST is then projected into many different forms, e.g. code in several languages, binary compiled code, virtual machine bytecode, and runtime-interpreted code. Also, each of these projections (code, compiled binary, etc) would be convertible back into the original AST, which allows for a very flexible toolchain.

Imagine being able to convert code in language X into language Y on the fly (e.g. take someone's Java code and view it in Ruby syntax) -- developers could develop in their language of choice without forcing an entire team to program in X. As Ted points out, the possibilities for domain-specific languages (DSLs) are also huge - as long as the DSL that you created had a way to be converted into the core AST, it would be possible to have that DSL directly generating code without any sort of post-processing/interpretive layer, and you wouldn't be constrained by the "parent language" that the DSL is being written in.

As Ted points out, this utopian vision is still a bit of a ways out:

How likely is this utopian vision? I'm not sure, honestly--certainly tools like LLVM and Phoenix seem to imply that there's ways to represent code across languages in a fairly generic form, but clearly there's much more work to be done, starting with this notion of the "uber-AST" that I've been so casually tossing around without definition. Every AST is more or less tied to the language it is supposed to represent, and there's clearly no way to imagine an AST that could represent every language ever invented. Just imagine trying to create an AST that could incorporate Java, COBOL and Brainf*ck, for example. But if we can get to a relatively stable 80/20, where we manage to represent the most-commonly-used 80% of languages within this AST (such as an AST that can incorporate Java, C#, and C++, for starters), then maybe there's enough of a critical mass there to move forward.

But that doesn't stop me from dreaming of such a future. None of the problems mentioned are intractable, which means that this vision of the future has a real chance of becoming reality. Here's hoping!