<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Homoiconic on Roads Less Taken</title><link>https://goran.krampe.se/categories/homoiconic/</link><description>Recent content in Homoiconic on Roads Less Taken</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 19 Jul 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://goran.krampe.se/categories/homoiconic/index.xml" rel="self" type="application/rss+xml"/><item><title>Is Spry a Smalltalk?</title><link>https://goran.krampe.se/2016/07/19/is-spry-a-smalltalk/</link><pubDate>Tue, 19 Jul 2016 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2016/07/19/is-spry-a-smalltalk/</guid><description>&lt;p>I love &lt;a href="http://world.st" target="_blank" rel="noopener noreferrer">Smalltalk&lt;/a>
 and I have been in love with it since approximately 1994. I have used VisualWorks, VisualAge (IBM Smalltalk), Dolphin Smalltalk, GemStone, &lt;a href="http://squeak.org" target="_blank" rel="noopener noreferrer">Squeak&lt;/a>
 and &lt;a href="http://pharo.org" target="_blank" rel="noopener noreferrer">Pharo&lt;/a>
 quite a lot, and I was very active in the Squeak community for a long period.&lt;/p>
&lt;p>But the last few years, finally, I have started to feel the &amp;ldquo;burn&amp;rdquo;&amp;hellip; as in &lt;a href="http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html#29" target="_blank" rel="noopener noreferrer">&amp;ldquo;Let&amp;rsquo;s burn our disk packs!&amp;rdquo;&lt;/a>
. And last year I started doing something about it - and the result is &lt;a href="http://sprylang.org" target="_blank" rel="noopener noreferrer">Spry&lt;/a>
. Spry is only at version 0.break-your-hd and several key parts are still missing, but its getting interesting already.&lt;/p>
&lt;p>&lt;strong>Now&amp;hellip; is Spry a Smalltalk? And what would that even mean?&lt;/strong>&lt;/p>
&lt;p>I think the reason I am writing this article is because I am feeling a slight frustration that not more people in the Smalltalk community find Spry interesting. :)&lt;/p>
&lt;p>And sure, who am I to think Spry is anything remotely interesting&amp;hellip; but I would have loved more interest. It may of course change when Spry starts being useful&amp;hellip; or perhaps the lack of interest is because it&amp;rsquo;s not &amp;ldquo;a Smalltalk&amp;rdquo;?&lt;/p>
&lt;h2 id="smalltalk-family">
 Smalltalk family
 &lt;a class="heading-link" href="#smalltalk-family">
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading">&lt;/i>
 &lt;span class="sr-only">Link to heading&lt;/span>
 &lt;/a>
&lt;/h2>
&lt;p>The Smalltalk family of languages has a fair bit of variation, for example &lt;a href="http://www.selflanguage.org" target="_blank" rel="noopener noreferrer">Self&lt;/a>
 is clearly in this family, although it doesn&amp;rsquo;t even have classes, but it maintains a similar &amp;ldquo;feel&amp;rdquo; and shares several Smalltalk &amp;ldquo;values&amp;rdquo;. There have been a lot of Smalltalks over the years, even at PARC they made different variants before releasing Smalltalk-80.&lt;/p>
&lt;p>&lt;strong>So&amp;hellip; if we look at Spry, can it be considered a member of the Smalltalk family?&lt;/strong>&lt;/p>
&lt;p>There is an &lt;a href="http://wiki.squeak.org/squeak/172" target="_blank" rel="noopener noreferrer">ANSI standard&lt;/a>
 of Smalltalk - but not many people care about it, except for some vendors perhaps. I should note however that &lt;a href="http://www.seaside.st" target="_blank" rel="noopener noreferrer">Seaside&lt;/a>
 apparently (I think) has brought around a certain focus on the ANSI standard since every Smalltalk implementation on earth wants to be able to run Seaside and Seaside tries to enforce relying on the ANSI standard (correct me if I am wrong).&lt;/p>
&lt;p>Most Smalltalk implementations share a range of characteristics, and a lot of them also follow the ANSI standard, but they can still differ on pretty major points.&lt;/p>
&lt;p>My &lt;strong>personal take&lt;/strong> on things in Smalltalk that are pretty darn important and/or unique are:&lt;/p>
&lt;ol>
&lt;li>Everything is an object including meta levels&lt;/li>
&lt;li>A solid model for object oriented programming&lt;/li>
&lt;li>The image model&lt;/li>
&lt;li>100% live system&lt;/li>
&lt;li>The browser based IDE with advanced cross referencing, workspaces and debuggers&lt;/li>
&lt;li>The keyword syntax and message cascades&lt;/li>
&lt;li>Message based execution model&lt;/li>
&lt;li>Dynamic typing and polymorphism&lt;/li>
&lt;li>Closures everywhere with lightweight syntax and non local return&lt;/li>
&lt;li>Very capable Collections and a good standard library&lt;/li>
&lt;/ol>
&lt;p>Not all Smalltalks cover all 10. For example, there are several Smalltalks without the image model and without a browser based IDE. Self and Slate and other prototypical derivatives don&amp;rsquo;t have classes. Some Smalltalks have much less evolved class libraries for sure, and some are more shallow in the &amp;ldquo;turtle department&amp;rdquo;.&lt;/p>
&lt;p>In Spry we are deviating on a range of these points, but we are also definitely &lt;strong>matching some&lt;/strong> of them!&lt;/p></description></item><item><title>Spry Modules, part II</title><link>https://goran.krampe.se/2016/05/03/spry-modules-ii/</link><pubDate>Tue, 03 May 2016 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2016/05/03/spry-modules-ii/</guid><description>&lt;p>In the &lt;a href="http://goran.krampe.se/2016/04/16/spry-modules" target="_blank" rel="noopener noreferrer">last article&lt;/a>
 I outlined a simple &lt;strong>model of modules&lt;/strong> and that is kinda implemented but needs a few fixes. The next step is how to find and combine modules and this is an area where I want to push the envelope a bit. Most popular package/module systems today are quite trivial in nature. Often it&amp;rsquo;s a command line tool that queries central catalog(s) and then proceeds by downloading code in the form of source files onto disk. Then the compiler or runtime environment finds and loads the code by simply looking for files on disk. There are several parts of this that are very primitive.&lt;/p>
&lt;p>When I built &lt;a href="http://map.squeak.org" target="_blank" rel="noopener noreferrer">SqueakMap&lt;/a>
 waaay back I was already then tainted with the idea of &lt;a href="https://gemtalksystems.com" target="_blank" rel="noopener noreferrer">shared object models&lt;/a>
 and one of the primary ideas in SqueakMap was to make sure each local Smalltalk environment got a full live object model of the catalog which then could be queried, viewed and reasoned about inside the Smalltalk environment. Much more powerful than a bunch of JSON files on disk. This led to the approach of downloading the full catalog in a serialized form - and then loading it into &lt;a href="http://www.squeak.org" target="_blank" rel="noopener noreferrer">Squeak&lt;/a>
.&lt;/p>
&lt;p>With &lt;a href="http://sprylang.org" target="_blank" rel="noopener noreferrer">Spry&lt;/a>
 I want us to create a simpler meta model - at least for starters - but with an even smarter infrastructure backing it&amp;hellip;&lt;/p></description></item><item><title>Spry Modules</title><link>https://goran.krampe.se/2016/04/16/spry-modules/</link><pubDate>Sat, 16 Apr 2016 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2016/04/16/spry-modules/</guid><description>&lt;p>As discussed in &lt;a href="http://goran.krampe.se/2016/04/09/spry-image-model/" target="_blank" rel="noopener noreferrer">the previous article&lt;/a>
 I want Spry to have a trivially accessible persistence mechanism enabling something similar to the &lt;strong>Smalltalk image model&lt;/strong>, but based on a database. The memory organisation in Spry is basically nested Maps. After dwelling a bit on the inevitable hard question about &lt;strong>modules and namespaces&lt;/strong> I have decided on a design that I hope will turn out simple and reasonably powerful!&lt;/p>
&lt;img src="https://goran.krampe.se/spry/modules.jpg" alt="Modules" style="float:right; margin:0 0 1em 1em;">

&lt;p>Smalltalk has a Dictionary holding all the globals forming &amp;ldquo;the roots&amp;rdquo; of the object memory. In Smalltalk this Dictionary is also itself a global variable accessible as &lt;code>Smalltalk&lt;/code>, in other words &lt;code>Smalltalk == (Smalltalk at: #Smalltalk)&lt;/code>. The primary use of &lt;code>Smalltalk&lt;/code> is to hold all classes by name, so they are all reachable as globals. Obviously &lt;code>Smalltalk&lt;/code> can also hold any kind of object (not just classes) as a global.&lt;/p>
&lt;p>Spry also has such a top level Dictionary, but in Spry we call a Dictionary a &lt;code>Map&lt;/code> to be a little bit more aligned in terminology with other languages (and it&amp;rsquo;s shorter). This top level Map is the &lt;code>root&lt;/code> Map and it is accessible via the word &lt;code>root&lt;/code>. In Spry the &lt;code>root&lt;/code> word is actually bound to a primitive function returning this &lt;code>Map&lt;/code>, so in Spry we also have &lt;code>root == (root at: 'root)&lt;/code>.&lt;/p>
&lt;p>Ok, so Spry has a &lt;code>Map&lt;/code> of globals and one way of using Spry is simply by populating &lt;code>root&lt;/code> with words bound to functions making these functions globally accessible, it&amp;rsquo;s how I have done it so far. Yeah, yeah, I know, but for smaller systems it probably works just fine!&lt;/p>
&lt;p>But&amp;hellip;&lt;/p></description></item><item><title>Spry image model</title><link>https://goran.krampe.se/2016/04/09/spry-image-model/</link><pubDate>Sat, 09 Apr 2016 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2016/04/09/spry-image-model/</guid><description>&lt;p>In developing Spry - &lt;a href="https://goran.krampe.se/ni-is-now-spry" >renamed from Ni&lt;/a>
 - I am getting closer to the &lt;strong>Really Fun Stuff&lt;/strong>.&lt;/p>
&lt;p>As a Smalltalker I dream &amp;ldquo;bigger&amp;rdquo; than just managing source code as text in files&amp;hellip;&lt;/p>
&lt;p>&lt;a href="http://www.azquotes.com/quote/847274" title="Kent Beck quote">&lt;img src="http://www.azquotes.com/picture-quotes/quote-i-mean-source-code-in-files-how-quaint-how-seventies-kent-beck-84-72-74.jpg" alt="I mean, source code in files; how quaint, how seventies! - Kent Beck" />
&lt;/a>&lt;/p>
&lt;p>Smalltalk uses the &amp;ldquo;image model&amp;rdquo; in which the system is alive and running all the time, the full development environment is also live together with your application, and we are in fact modifying object structures when we develop Smalltalk programs. We can also snapshot that object memory onto disk and fire it up somewhere else. Several Lisp implementations have used a similar approach I think.&lt;/p>
&lt;p>The image model has tons of really cool benefits, I don&amp;rsquo;t have time repeating all of them, but a modern implementation of the idea should take a few things into account that was not considered in the 1970s:&lt;/p>
&lt;ul>
&lt;li>The &amp;ldquo;image&amp;rdquo; in Spry will be buildable from source&lt;/li>
&lt;li>You should be able to use Spry without the image mechanism (you can already)&lt;/li>
&lt;li>Spry code will have a readable text format and file structure&lt;/li>
&lt;li>The image model does not have to be all or nothing, it can be partial&lt;/li>
&lt;li>The image mechanism will be a module for the Spry VM, so you can skip it entirely&lt;/li>
&lt;/ul>
&lt;p>Some argue that the image model has downsides - like being an &amp;ldquo;ivory tower&amp;rdquo; incapable of interacting with the outside world. The Smalltalk environments have indeed historically suffered a bit in varying degree, but we can easily find ways around those issues while still &lt;strong>reaping the awesomeness of a fully live&lt;/strong> programming environment, especially if we give the above items proper thought &lt;strong>from the start&lt;/strong>.&lt;/p>
&lt;p>With Spry I think I have a beginning to a novel approach&amp;hellip; as well as taking the above into account.&lt;/p></description></item></channel></rss>