Friday, January 8, 2010

Why do I love APL?

I love the strangest languages for various reasons. Some of them have immense power, but can easily produce unmaintainable messes. Some have the elegant simplicity of zen, but never attracted the people who build kitchen sinks. Some are perfect matches for certain applications, and quickly degenerate for other usages.

In Scala I have found for the first time a positive combination of these attributes. Immense power, kitchen sinks, check. Simplicity? Perhaps not, but more so than the more popular alternatives. Some code has definitely a zen-like quality to it. And, yet, it is of general use, and has good enough resilience against unmaintainable messes. Not perfect, but better than anything else I know of, for now.

That doesn't mean I do not appreciate other languages. There is much to learn and admire in many, many languages, and I would not mind using quite a few of them if chance favors it.

So I'll leave you with the answer that came to my mind as I explained to a bewildered person why I loved APL -- a language I could spend a whole afternoon producing half a line of code:

There's joy to be found in writing code which is solely about what you want, and not about how to get there. Of expressing the fulness of your intent as a single expression. It's like the ultimate perfect katana cut.

Of course, in a real fight I'd rather have a gun.

7 comments:

  1. And then u spare us by not showing the APL snippet you found? :O

    ReplyDelete
  2. This wasn't about snippets, y'know?

    ReplyDelete
  3. right it was about that "katana VS Pistol" thing. Still its nice to see famous APL one liners..

    ReplyDelete
  4. APL is still the best example of a math calculator or spreadsheet macro language. APL as a Scala DSL with a screen APL keyboard would be quite interesting.

    ReplyDelete
  5. Motivating comments about Scala. I checked out APL on the Wikipedia for the first time and my gosh, you can read that stuff?? let alone write in it, wow. Hats off to you!!

    ReplyDelete
  6. I used to work on asset securitization models in APL2. IBM consultants told us that we had some of the largest workspaces they had ever seen (100K+ LoC's, if i remember correctly.

    I'm not sure I loved it, especially working 18 hours/day, but today functional programming (erlang and clojure, mostly) doesn't seem so alien to me

    ReplyDelete
  7. 100K+ lines of APL code should be enough to build Skynet...

    ReplyDelete