Meijer throws down!

Okay, not really. Saw this latest on LtU, regarding the recent JVM conference.  Erik Meijer was talking his recent work on the .Net Reactive Framework, and had this to say in passing:

And of course you say, “Erik, [why] are you making a big deal?  Category s–t like that.  The design pattern book fifty years ago mentioned these things [Iterator and Observer].”  The funny thing is that if you look in the back of the book at the related patterns, these two patterns are completely unrelated.  They are not even mentioned that they’re related.  Where as in reality these are super-duper related, right?  No two more interfaces on the planet, in the universe, are more intimately connected than these guys, because they’re connected by mathematics, ok.  And these guys — I think this book is crap — [audience laughter, nervous chuckling] I cannot trust these guys anymore

He’s kidding, about the GoF book being crap of course.  “Design Patterns: Elements of Reusable Object-Oriented Software”.  At least that’s my interpretation.  He’s just expecting more of the book — it defines, observes, studies, and documents 23 different software patterns, drawing up relations about the patterns based on in-the-wild observations of what patterns fraternize with which others.  And somehow this relationship between Iterator and Observer has just never come up!

I’ve been looking a lot at the Iterator pattern, the Observer/Visitor patterns, and Continuation Passing Style lately.  The relationships between these different patterns are fascinating — the latter especially, because you are able to switch freely between Iterator and Observer features with CPS, choosing the best features you want.  Well, not quite freely, because there’s a cost, in that different languages support different patterns to different degrees.  Especially in the case of CPS, some languages support it well (Ruby, Scheme, JavaScript), others with some moderate effort (C# 3.0 and later), and others require exorbitant effort and skill (C# 1.0, Python, C++).  Don’t get me wrong, I’m not bashing or especially holding high any particular language here — these are all languages I enjoy and prefer, but they have different strengths and, on this dimension, show great disparity in code readability and maintainability, for me and some peers.

So I’ve been thinking a lot about this divide, on such a fundamental abstraction as a sequence, and different behavioral modes it takes on.

Excellent talk, the portion available on youtube at least.  If you want more info on his work or Reactive Programming in general, it looks like MSDN channel 9 covered Erik on Reactive Programming back in July, so check that out.  Or check out Erik’s personal page on Microsoft Research with links to papers and talks on past and present research and application.

Edit add:

Saw this added on the LtU discussion and found it a good overview of Rx, from the unfold blog:

Programming Language Popularity

Some interesting metrics of programming language popularity.

  • – statistics on greping search queries on various web properties — usage in open source projects, books published on, etc.
  • TIOBE index – similar listing, of search engine results exclusively.  Longer tail listing, and shows trending.
  • Happiest users – this one is just a static blog post, but takes the additional dimension of not just frequency of posts, but the satisfaction level being expressed.  The data set is absymally small — I hope eventually another group will follow up with a more comprehensive analysis of more languages, and more satisfaction dimensions.

Usage data might be more interesting or ‘scientific’ (number of statements executing, new applications/modules shipped, etc).  However, ‘mindshare’ is itself an interesting dimension, as the technical merits of programming languages are typical less considered than social pressures and perception.

Continuation Patterns

Interesting paper on the topic of various program patterns implemented in coroutine.  As mentioned in a previous post, continuations are a powerful control flow primitive — they can be used for:

Call with Current Continuation Patterns, Ferguson & Deugo

  • Escaping recursive procedures and loops
  • Reentry into recursion
  • Coroutines
  • Backtracking
  • Simulating multitasking

The paper covers these patterns, and gives sample implementations.

Continue reading “Continuation Patterns”