Erlang R11B-5 in Fink

My good friend and Fink packager extraordinaire Aleix has kindly heeded my request for updating Fink’s erlang-otp port to the latest Erlang release: you can find it (with installation instructions) here. It’s working like a charm on my machine. Sweet!

Everything is dynamically typed

I’ve just seen David Weinberger’s recent Authors@Google talk, a deeply interesting overview of his new book, Everything is Miscellaneous. At first sight, Weinberger’s talk has little to do with programming. He discusses our efforts to classify objects in the world, starting with Aristotelian categories, where there was one and only place for every thing (and, presumably, one thing for every place)–a line of thought rooted on our direct experience with physical objects, culminated with Dewey’s decimal classification system. A line of thought that our modern, digital world has made obsolete. Weinberger is an excellent communicator and makes his points with a fine sense of humour, so, if you have fifty minutes to spare, you can do far worse than pressing the play button below before go on reading why am i mentioning this video in programming musings:

Still with me? Well, the fact is that hearing Weinberger’s thoughts i’ve been remembered of a little exercise i was doing this morning, as part of my recent efforts to finally come to grips with Haskell. You know what? Static typing feels a lot like Aristotelian categorisation: one and only one type for each variable. As is the case with Aristotelian categorisation, there are many situations where a rigid type system works well: we use categories all the time, and they obviously capture part of the structure of the world out there. But they inevitably break down at some point. In my little Haskell exercise (an interpreter for propositional logic), there was a point where it would have been extremely convenient to have more than one type for some of the variables i were using. Maybe it’s just than i’m used to working that way in dynamically typed languages, where the types of the parameters of my functions are in constant flow, and i cherish the ability to widen their domain on the fly.

As mentioned in the talk, Aristotle would be horrified at the prospect of having anything in more than one place of the tree: that would be chaos!. But in our digital world, tagging and mash-ups are arguably revealing themselves as more apt ways to organise our knowledge of the world. There are myriad faces to everything, and allowing different points of view is not only natural, but seemingly useful.

In the same (or, at least, analogous) way, static typing abhors (actually prohibits) variables with mutating types. One has union or algebraic types, that’s true, but one has also the feeling that using too heterogeneous types to construct them is going a bit afield. Could that be as misguided as Aristotelian categories? I don’t know. Building software is so complex that maybe we need the safety net of rigid categorisations. But i’ve noticed repeatedly while programming in, say, Lisp, that using dynamic typing makes things easier in many contexts. The nagging feeling of insecurity i had when i started using Scheme about the lack of type declarations has progressively disappeared, up to the point that languages as beautiful as Haskell can sometimes feel like a straitjacket.

I might be misguided, and perhaps my sense of security is bogus because it derives from very small projects (i have never participated in a large project using a dynamic language), and that liberally bending the type system really leads to chaos in the long run. Maybe the right way to realise this many-facets approach to modeling the world is to put type classes and parametric polymorphism to good use–although even there, i find CLOS generics more natural. But one wonders, could it be that, like our data, the real world problems out there are too complex, too multifarious to fit in a static ontology?

Come to think of it, i’m realising than i’m just badly restating the line of thought people like Alan Kay or Gerry Sussman have been defending for years. Specially their seeking inspiration in biological systems (those complex, messy things so marvelously organised) to model our computing and programming systems. I think that what i’m trying to express (and much, much more) is finely put, for instance, by Alan Kay in his famous talk The Computer Revolution hasn’t happen yet (if you haven’t seen it, please click that play button below) or, more recently by Sussman and Hanson in their paper Building Robust Systems. As i mentioned, in both cases, convincing parallelisms with biological systems are put on the table, and a dynamic outlook to programming systems (including generic functions and MOPs) are favoured. My gut feeling is that these ideas are to programming what Weinberger’s are to data management. I hope that reading and hearing Weinberger, Kay, Sussman and Hanson will convey this feeling better than these somewhat iffy ramblings.

All that said, i still get a kick out of learning Haskell. It must be the Aristotelian in me! :-)

Update: Some interesting comments over at reddit.com point out how my analogies could be (and probably are) flawed. In particular, there’s a reference to what looks like a very entertaining book: Practical Foundations of Programming Languages (PDF), which argues exactly the opposite:

This is a working draft of a book on the foundations of programming languages. The central organizing principle of the book is that programming language features may be seen as manifestations of an underlying type structure that governs its syntax and semantics. The emphasis, therefore, is on the concept of type, which codifies and organizes the computational universe in much the same way that the concept of set may be seen as an organizing principle for the mathematical universe. The purpose of this book is to explain this remark.

Also, check the comments here in WP: they’re quite interesting too!

Alan Kay Live

From the University of Pisa’s web site:

The University of Pisa is granting to Alan Curtis Kay a Honoris Causa Degree in Informatica for his contributions to the development of the personal computer and of object oriented programming.The ceremony will be held on June 15th, 2007 and it will be webcast live.

This page gives a bit more detail and, most importantly, contains links to the live webcast, which includes a Lection Doctoralis by Alan at 11:30 CET and an interview on the evening where he’ll talk about his recurrent themes (the yet-to-come computer revolution and computer education) and the OLPC project.

(If you read Italian, there’s a page on the motivations for the degree… not that there’s much need of it!)

Scheme on the Erlang VM

Recently, someone in the Erlang-questions mailing list wondered about the possibility of writing a Scheme-to-Erlang compiler, possibly inspired on earlier work by Marc Feeley and Martin Larose on Etos, a Erlang-to-Gambit compiler (don’t miss the great article Compiling Erlang to Scheme about Etos’ implementation). Well, Marc has risen to the bait and produced a prototype implementation of Stoe: join the fun and get it here!

Follow

Get every new post delivered to your Inbox.

Join 26 other followers