Wednesday, April 29, 2009

Generating code...

Like pretty much every programmer I know, I'm trying to automate what I do. What this amounts to, is that I'm trying to generate code to eliminate the boilerplate from my life.

For a variety of reasons, I get paid to code in Java. One of the most verbose languages on the planet. I'd like to be able to rip out code generators to generate all the boiler plate i need to keep the kids from hurting themselves on the sharp knives.

I've tried ANTLR, but honestly it's tree transformation language is in need of better tooling support to help with debugging. I'm part way through trying to fathom JetBrain's MPS. It's complicated as all hell, but on the upside, it understands the Java AST. It's at about this point that I contemplate whether I should just bite the bullet and do it the traditional way, with lisp macros all the way.

The upside of using MPS is that it knows Java, and it comes with a decent editing environment. The downside of MPS is that it has all the complexities of building a editor, instead of just using emacs like everyone else. I don't think i'm ready to give up on MPS yet. I like the pretty.