Monday, November 3, 2008

Thinking about libraries in lisp

One of the things that always confused me with lisp is that for a fifty year old language, there is bugger all in the way of battle hardened libraries. Take java, a mere puppy at ten, and yet it has more libraries than you can poke a stick at. And don't get me started about c. We'd be here until Christmas. The year after next.

Now that I am playing with ANTLR, I think I have understood why there are no libraries. You see, the desire for libraries is to reduce the programming effort to achieve a goal. The amount of code required to write all the database access layer in a reasonable sized webapp is considerable, so people use Hibernate instead. No one likes Hibernate, in fact there are rants upon rants about how bad it is, but all said and done, using hibernate is better than not shipping at all.

The problem with Hibernate and co is that the programmer winds up giving up control. He (or she) has no choice but to interact with the library on it's terms. If you don't like the terms, find another library or write your own. If you want to do something like what Hibernate does, but slightly different? Fork it, if you are brave. More likely, you will curb your tongue, and agree that Hibernate's way is the one and only way, and deal.

With a code generator, this is suddenly not a trade off I have to make. As long as I can write prototype code from the database up to the user interface layer, and I can express my design in some computable data format, then I can slice up the prototype code into templates, and generate out the whole application. Libraries suddenly are a source of headache, constriction, and bugs, instead of being a saviour.

In other news, I'm finding Google less and less useful as a source of knowledge. Thanks to an explosion of indexed content of varied value - i'm thinking of web forums full of questions - my keyword searches are returning pages full of my keywords, but no actual usable information.

I'm resorting to long form book purchases to get the knowledge I need, often in pdf format. A positive thing for artists and authors, but worrying for the big G.