I just got this nifty programming-musings.org domain and redirected it to this blog… as you may have guessed, plans are to restart my musings about programming real soon now (i just bought some free time at a bargain price). Stay tunned! :)
I just got this nifty programming-musings.org domain and redirected it to this blog… as you may have guessed, plans are to restart my musings about programming real soon now (i just bought some free time at a bargain price). Stay tunned! :)
I just spent half an hour watching Martin Fowler‘s Introduction to Domain Specific Languages presentation at last year’s JAOO conference (nice name for a conference, i must say). It’s a quite good introductory talk. Fowler acknowledges Lisp’s strength in the DSL camp, takes the opportunity to make fun of it, puts XML closer to where it deserves and does a good job explaining the differences and trade-offs between what he calls internal and external DSLs. For those of you prefering reading to watching, the talk covers the first half of this article.
Fowler likes to call DSL-based programming Language-Oriented programming, and had what looks like an interesting conversation with Neal Ford last August: if you liked the above video, just follow this link. I have not finished watching it yet, but i’ve enjoyed its first 20 minutes. As a teaser, here’s how the talk begins:
Why is there so much XML mixed in with my Java code? Why would not everybody shut up already about Ruby on Rails? It seems like any time you talk to someone about Ruby on Rails they are irrationally exuberant about it and there has got to be some reason for that and why do things like aspects exist? Why do we actually need something like aspects if Java is enough and is there an evolutionary step beyond object-oriented programming? Is the abstraction layer we have been using so far, is that sufficient for the problems that we are trying to solve today and what the heck is language-oriented programming anyway? That is what Martin and I am here to talk about is this idea of language-oriented programming.
Enjoy!
I don’t know whether Monty Python ever wrote a gag on programming languages, but if they did, this Erlang video must be it. The funniest thing is that it is pretty serious, and does a great job showing one of my most cherished abilities when using dynamic languages, namely, adding new functionality to a running system on the fly. As for the Monty Python bit, well, you have to see the to know what i mean: i kept laughing out loud during most of its twelve minutes (those Ericsson engineers seem to be taken from The Larch, but then maybe it’s just my sense of humor).
Update: Mike, one of the engineers in the film, has been kind enough to post a comment about the experience, which I’m reproducing here for your convenience:
We gave a well received “demo” in 1990, conjunction with ISS90, a big telecoms conference in Stockholm. We made this movie to record the demo. We actually used a professional company to do the filming, but I won’t mention their names as they would probably sue me for libel.
The worse of it all, is that we were deadly serious at the time. The Monty Python aspect must be due to our backgrounds. Of the people involved, Joe is English, Robert is Swedish – but brought up in Australia, Bjarne is also Swedish but spend some formative years in Scotland and I’m half Welsh half Scottish with some Irish thrown in somewhere.
In 1990, when we made the movie, the very idea of using anything other than C, Plex, assembly language etc to design embedded concurrent systems was heresy, we expected to take the world by storm. It seems that the cheap communication and multi core processors are giving Erlang a boost 16 years later. Well at least in the intervening time we have tested the hell out of Erlang and its implementations!
/mike
PS. If you look carefully at the film, you can see that Erlang at that time had a Prolog like syntax.
PPS. I can’t watch the movie without laughing (at) myself
While we’re at it, let me mention that i like many a thing of Erlang. It’s a curious mix of good stuff: a simple syntax and kind of minimalist flavor that reminds of Scheme, pattern matching and functional variables like Haskell’s, and what amounts to a programming paradigm of its own based on mailboxes and processes (which, as you surely know, are amazingly cheap). Also worth mentioning is Erlang’s error handling philosophy, which is, at first sight, a bit startling (i’m not still sure if it makes perfect sense, but after playing with the language a bit, it looks like it does–this is an interesting post on those matters). Definitely worth a look: see for instance Joe Armstrong‘s thesis, or, if you have some bucks to spare, the forthcoming Programming Erlang.
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!
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!)
Richard Hamming’s three questions for new hires at Bell Labs:
(from R. Hamming’s You and your research. Essential reading.)
n the last issue of MIT’s Technology Review, there’s an interesting report, An Alternative to the Computer Mouse on Manu Kumar‘s new way to interact with your computer via eye-sight. The innovative part comes in the combination of eye and hand: you fix your stare on a given screen region, but that has no effect unless you press the appropriate key. Once you do that, magic happens. For instance, the region you were looking at gets amplified. Or if you were reading a text near the end of the visible area, it will scroll automatically for you. There’s no secret hardware involved (a high-resolution web cam and a bunch of infrared light-emitting diodes), although that does not mean that the equipment is cheap: Kumar uses a $25,000 monitor! The tricky part happens to be a good eye-tracking algorithm, because it seems pupils are prone to jitter even when fixated on a point. Kumar’s solution is not yet perfect (tests show that it misbehaves around 20% of the times), but people participating in tests seem to prefer eyes to mouses. The system is called EyePoint, and you’ll find some screenshots here or, download a demo video here. The project is integrated in Standford HCI Group‘s GUIDe (Gaze-enhanced User Interface Design, if you have to know), which includes other curious applications like EyeExposé (i’ll let you try and imagine what it does).
Although not as fancy as other exotic input methods we’ve seen in the past, this one looks much more practical: i can perfectly picture myself using EyePoint together with my keyboard and Emacs to browse around during code editing sessions. I’ll have to wait until prices drop a little bit, and algorithms get better, but that should be only a question of time.
Babar Kazar has compiled an awesome (and i mean awesome) list of Classic Texts in Computer Science. There one finds almost every paper to read if one is serious about computers. The list is too long to put it all here, and virtually all of them are interesting in one way or the other, so i won’t make a selection right now: just take a look at them, and try to pick one: i bet you’ll have a hard time deciding!
Although it’s a bit late for new year’s resolutions, here is mine: i plan to at least skim through all these texts, read many of them, and, of course, keep you informed.
On December 3 and 4 of 2004, the Computer Science Department at Indiana University hosted a conference on the occasion of Dan Friedman’s sixtieth birthday. It brought together many of his former and present students, colleagues, research collaborators, co-authors and friends. That is, it brought together many of the big names in the Lisp/Scheme community (not in vain Shriram Krishnamurthi once imagined the Scheme community “a brotherhood of Dan”). Guy Steele delivered a one hour keynote, which was followed by more than twenty half-an-hour talks by people like Sussman, Dybvig, Shivers or Kiselyov, just to name a few.
The extremely good news is that, in the conference’s webpage, one can find the videos for almost all these talks! So, don’t be surprised if i’m missing during a few days! Besides the obvious interest in their contents, i’ll also find amusing to connect names with faces (it’s funny how one makes up fictitious faces for the authors of papers one reads and re-reads)… how many of them do you recognise?:
(I admire the work of many of these people, and i was convinced i wouldn’t be able to single out one among them… but to my surprise, and with all due respect to all schemers, i can: to my amusement, one of the participants is one of my few personal heroes. I’m not sure about the connection between him and Dan, but i’m very pleased to know there’s one. Surely you can spot this (to me, at least) rara avis?)
One of the things i would really, really like to see some day is a working quantum computer. Quantum mechanics is deep magic that nobody really understands, but we have learnt a lot about how to use it during the last century–including its application to some kinds of computation. As you surely know, the most outstanding quantum algorithm is Shor’s prime factorization, which allows factoring a number N with a time complexity . That means that we go from exponential to polynomial time when going from classical to quantum for this particular problem (and related ones: the Wikipedia article on QC gives a pretty good survey; see also David Deutsch’s introductory lectures). I’m stressing the last point because there’s a widespread misconception that quantum computers will be able to solve NP-complete problems in polynomial time. Not so. On the contrary, experts are almost sure by now that this won’t be the case (note, by the way, that factoring is not NP-complete).
The most recent examples of such bogus claims are the reports on D-wave’ demos of their ‘quantum computer’, which are surrounded by piles of hype. So please, before taking them at face value, see Scott Aaronson’s The Orion Quantum Computer Anti-Hype FAQ (more here here here). Scott Aaronson is an expert in the field and the author of a PhD thesis under the title Limits on Efficient Computation in the Physical World (for a less technical introduction to quantum computing, see his nice Quantum Computing Since Democritus lectures). For an executive summary, here’s the first entry in the FAQ:
- Q: Thanks to D-Wave Systems — a startup company that’s been in the news lately for its soon-to-be-unveiled “Orion” quantum computer — is humanity now on the verge of being able to solve NP-complete problems in polynomial time?
- A: No. We’re also not on the verge of being able to build perpetual-motion machines or travel faster than light.
The old rule applies: no silver bullet. But, of course, their limitations notwithstanding, quantum computers would (will?) be an interesting challenge for us programmers, and we do not have to wait for the hardware to play with them: see this Brief survey of quantum programming languages, or a more in-depth description of how an imperative quantum programming language looks like, although, if you ask me, functional quantum languages like QML are nicer. Simon Gay has also put together a comprehensive Bibliography of Quantum Programming Languages.
Finally, if you’d rather write some code, there’s André van Tonder’s Scheme simulator (which will work with any R5RS scheme), and a QML simulator written in Haskell. Haskellers will also enjoy Jerzy Karczmarczuk’s Structure and Interpretation of Quantum Mechanics: a functional framework.
Happy quantum hacking!