Metacircular thoughts

March 5, 2007

Running out of steam?

Filed under: Uncategorized — metacircular @ 2:48 pm

I’ve been learning Haskell.

I thought it would be an interesting exercise to try to create a metadata language that could describe 95% of simple to medium-complexity web applications (up to, say, Basecamp or Reddit) in a much briefer manner than currently exists, embedded in Haskell.

Well it turns out that doing that is pretty hard. Even when it seems that you’re doing boilerplate stuff, if you’re making an excellent user interface and making something that really fits a niche, it’ll take nearly as much mental effort to start banging out lines of working code as it would to write down a declarative specification of it.

You could create a language that would let you make a to-do list application in about 200 LOC (including the database schema, all view templates, and all the controller code, plus whitespace), but it wouldn’t have a good user interface and it wouldn’t really be flexible. Code generation and generative programming are not a basis for creating products.


Some random thoughts. Paul Graham has a list of languages compared by what they fix. To his list I would like to add the following.

Haskell
There are too many experimental lazy, pure functional programming languages.
Scala
There’s no reason not to support both functional and object-oriented programming. And we need better support for components. Plus functional languages have no libraries.
F#
OCaml has no libraries and it has too many needless “wouldn’t it be cool if” features.

3 Comments »

  1. [...] at Metracircular, Warren Henning, connoiseur of less-than-mainstream languages, confesses that he’s run up against a brick wall trying to build a code generator using the functional language Haskell. To get a final result [...]

    Pingback by Bob On Development » Is There a Place for Code Generation in Your Tool Kit? — March 5, 2007 @ 9:01 pm | Reply

  2. Great post, Warren. It inspired me to write about code generation in general. You are right, it seems like a great idea but it has its limitations.

    http://bobondevelopment.com/2007/03/05/is-there-a-place-for-code-generation-in-your-tool-kit/

    Comment by Bob Grommes — March 6, 2007 @ 5:34 am | Reply

  3. Hi Warren,

    You say that “Code generation and generative programming are not a basis for creating products.”

    It sounds like you have tried (and failed) to create a domain-specific language (DSL) in Haskell. I don’t know if you were aware but there are specialist tools for creating DSLs.

    Check out the site I run – The Code Generation Network (http://www.codegeneration.net) and our recent conference ‘Code Generation 2007′ (http://www.codegeneration.net/cg2007/index.php) for some pointers or drop me a line.

    Best wishes,
    Mark Dalgarno
    Editor Code Generation Network

    Comment by Mark Dalgarno — September 6, 2007 @ 6:44 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.