Essence, Ceremony, and Deja-Vu

Posted by Rick DeNatale Thu, 21 Aug 2008 18:13:00 GMT

Stu Halloway just pointed out an interesting article on a Scala blog.

Stu asks us to consider whether making a Scala object an application by extending a trait, as described by the Scala article, affects the question of essence vs. ceremony. It certainly does cut down on boilerplate code.

Although this appears to be part of the standard Scala library, it is documented in such a way as to discourage its use, for the same reasons given in the article.

What strikes me is that the reasons seem to be tied up in language implementation and in particular the ways of the JVM. Perhaps this is an example of how the JVM, at least as it is today might be a good, but not the best platform for dynamic language implementation.

Putting on my old curmudgeon’s hat, this strongly reminds me of the early days of PL/I. The earliest PL/I compilers were notoriously bad at generating efficient code for subroutine linkage. PL/I was designed for the IBM/360, which used a subroutine calling mechanism entailing chaining invocation frames in a doubly linked list rather than on a stack. The brute force way to do a call was to perform a system getmain (OS/360 for malloc) at the beginning of a subroutine, and a freemain(free) upon return. This was fairly expensive.

As a result of this, early PL/I programmers were admonished not to use subroutines/functions, or at least to use them sparingly.

This is not bad language design, it is bad implementation.

And perhaps it is just one example, or maybe there are two here, one in Scala and one in PL/I, of how well meaning decisions based on the characteristics of the implementation at hand, particularly when compounded can give us magnificent complexities, that we really don’t need.

Posted in  | Tags ,  | no comments | no trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
http://talklikeaduck.denhaven2.com/articles/trackback/506

Comments are disabled