Comparing “Go” to “Brand X”

The old-timers might figure out what Brand X really is before the end. For the rest of us, the reveal at the end is just as shocking as the author intended.  All and all, it confirms what I suspected: Go nice enough, but it is hardly original.  Sure it looks like a great language to write in compared to C, but then again, what doesn’t?

Comparison of Google’s new language “Go” to mysterious “Brand X”, and the shocking reveal of Brand X’s true identity.

As found through http://www.foldl.org/, a digest blog on various programming language topics.

Native Client at UWCS lecture

Available for streaming and download, Google Native Client presented at UW’s computer science lecture series. Covers the restrictions on x86 code, new alignment rules, and performance on various benchmarks. 5% overhead, that’s nothing compared to many other sandboxing techniques.

Native client is 50KB download?  Wild. It really is just a gatekeeper, runtime library separate.

Of course, I would love to get away from x86.  LLVM, or ARM, or even Amd64.  x86 makes me a sad panda.

On the value of consistent API design

Raymond Chen writes in “We’re using a smart pointer, so we can’t possibly be the source of the leak“.  The most immediate cause is a subtle misuse of CComPtr, using operator= which performs an AddRef on a return value that has already been AddRef’d, leading to one AddRef too many.

The less immediate failure was a poorly designed API.

Well, not poorly designed.  Unfortunately designed.

Continue reading “On the value of consistent API design”

PDC 2009 top picks

Personal picks for PDC 2009 thus far.  Haven’t watched them yet, so no reviews.

Small complaint on behalf of those who were physically in attendance: I imagine it’s really annoying to find related topics always be in the same slot.  Concurrency Fuzzing and C++ manycore; Axum and F# Parallel/Async; I would think it would be annoying to have to choose between those pairs.

Of course, I always watch online after-the-fact when the videos are up, so no negative consequence for me.

#aaron

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: http://themechanicalbride.blogspot.com/2009/07/introducing-rx-linq-to-events.html

Programming Language Popularity

Some interesting metrics of programming language popularity.

  • LangPop.com – statistics on greping search queries on various web properties — usage in open source projects, books published on Amazon.com, 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”

Return-code vs. Exception handling

(Originally authored Feb 2008.  This is a revision of an older post from before I began blogging on the internet at large.  It’s been edited for style, not content)

This is one of those “religous wars” in programming language theory; return code handling (RCH) vs exception handling (EH).  Firstly, I am biased.  Secondly, I will try to remain objective as well, partitioning observations of code using these mechanism from how I feel this reflects on the utility of either mechanism.  I tend to _prefer_ EH in general, but not universally, and generally follow the viewpoint that “exceptions are for exceptional things”.  With that aside…

Raymond Chen wrote an article a while back on RCH vs EH[2]. There, he points out accurately some facts about code review of RCH and EH, concluding that it’s generally harder to conclude the failure-safety of some example the RCH code than some comparable EH code.

He’s right.  And he’s wrong.  His article is incomplete.  Lets start with defining the playing field.

Continue reading “Return-code vs. Exception handling”