<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Talk Like A Duck: Tag scala</title>
    <link>http://talklikeaduck.denhaven2.com/articles/tag/scala</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>In Ruby, it's not the dog, it's the tricks!</description>
    <item>
      <title>Essence, Ceremony, and Deja-Vu</title>
      <description>&lt;p&gt;&lt;a href="http://blog.thinkrelevance.com/2008/8/21/essence-vs-ceremony-pop-quiz"&gt;Stu Halloway&lt;/a&gt; just pointed out &lt;a href="http://scala-blogs.org/2008/07/application-trait-considered-harmful.html"&gt;an interesting article on a Scala blog&lt;/a&gt;.
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;What strikes me is that the reasons seem to be tied up in language implementation and in particular the ways of the &lt;span class="caps"&gt;JVM&lt;/span&gt;.  Perhaps this is an example of how the &lt;span class="caps"&gt;JVM&lt;/span&gt;, &lt;a href="http://blogs.sun.com/jrose/entry/dynamic_invocation_in_the_vm"&gt;at least&lt;/a&gt; &lt;a href="http://blogs.sun.com/jrose/entry/the_golden_spike"&gt;as it&lt;/a&gt; &lt;a href="http://blog.headius.com/2008/05/power-of-jvm.html"&gt;is today&lt;/a&gt; might be a good, but not the best platform for dynamic language implementation.&lt;/p&gt;
&lt;p&gt;Putting on my old curmudgeon&amp;#8217;s hat, this strongly reminds me of the early days of &lt;a href="http://en.wikipedia.org/wiki/PL/I"&gt;PL/I&lt;/a&gt;. The earliest PL/I compilers were notoriously bad at generating efficient code for subroutine linkage.  PL/I was designed for the &lt;span class="caps"&gt;IBM&lt;/span&gt;/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.&lt;/p&gt;
&lt;p&gt;As a result of this, early PL/I programmers were admonished &lt;strong&gt;not&lt;/strong&gt; to use subroutines/functions, or at least to use them sparingly.&lt;/p&gt;
&lt;p&gt;This is not bad language design, it is bad implementation.&lt;/p&gt;
&lt;p&gt;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&amp;#8217;t need.&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 21 Aug 2008 14:13:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:248bda94-dc4a-4f71-85a4-1a0b860d836b</guid>
      <author>Rick DeNatale</author>
      <link>http://talklikeaduck.denhaven2.com/articles/2008/08/21/essence-ceremony-and-deja-vu</link>
      <category>war_stories</category>
      <category>scala</category>
      <category>essenceandceremony</category>
      <trackback:ping>http://talklikeaduck.denhaven2.com/articles/trackback/506</trackback:ping>
    </item>
  </channel>
</rss>
