<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pharo on Roads Less Taken</title><link>https://goran.krampe.se/categories/pharo/</link><description>Recent content in Pharo on Roads Less Taken</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 24 May 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://goran.krampe.se/categories/pharo/index.xml" rel="self" type="application/rss+xml"/><item><title>Spry Performance</title><link>https://goran.krampe.se/2016/05/24/spry-performance/</link><pubDate>Tue, 24 May 2016 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2016/05/24/spry-performance/</guid><description>&lt;p>When writing Spry I am so far mainly ignoring performance. The general execution of Spry code will be a regular interpreter (although stackless I hope) and not a JIT. But that doesn&amp;rsquo;t prevent us from playing around and learning something!&lt;/p>
&lt;p>In this article I do some silly experiments around interpreter startup time and fooling around with 40 million element arrays. As usual, I am fully aware that the languages (Pharo Smalltalk, NodeJS, Python) I compare with a) have lots of other ways to do things b) may not have been used exactly as someone else would have done it. A truck load of salt required. Now&amp;hellip; let&amp;rsquo;s go!&lt;/p>
&lt;img src="https://goran.krampe.se/spry/thetruth.jpg" alt="The" style="display:block; margin:0 auto;"></description></item><item><title>Squeak to Nim, come in Nim...</title><link>https://goran.krampe.se/2014/11/03/squeak-to-nim/</link><pubDate>Mon, 03 Nov 2014 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2014/11/03/squeak-to-nim/</guid><description>&lt;p>In my exploration of &lt;a href="http://nim-lang.org" target="_blank" rel="noopener noreferrer">Nim&lt;/a>
 the turn has come to see how we can use Nim together with &lt;a href="http://squeak.org" target="_blank" rel="noopener noreferrer">Squeak&lt;/a>
.&lt;/p>
&lt;p>Squeak (and Pharo) has two basic mechanisms of interfacing with the C world:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="http://stephane.ducasse.free.fr/FreeBooks/CollectiveNBlueBook/greenberg.pdf" target="_blank" rel="noopener noreferrer">Squeak VM plugins&lt;/a>
. That pdf is old, but still fairly accurate I guess.&lt;/li>
&lt;li>&lt;a href="http://wiki.squeak.org/squeak/1414" target="_blank" rel="noopener noreferrer">Squeak FFI&lt;/a>
, Foreign Function Interface.&lt;/li>
&lt;/ul>
&lt;p>The VM plugins are basically a controlled way to introduce new &amp;ldquo;named&amp;rdquo; primitives in Smalltalk that can be invoked from Smalltalk. A plugin can be built either linked into the VM binary (statically) or as a dynamically loaded library (dll, so, dylib etc). When &amp;ldquo;all else fails&amp;rdquo; a plugin is the way to go, but they are a bit awkward to work with.&lt;/p>
&lt;p>Then we have the FFI which is a generic way to dynamically call dynamically loaded libraries. In other words, no compilation step needed - just type the correct Smalltalk line and the library will load and the calls work. Now&amp;hellip; sure, the FFI mechanism is a bit slower, since it needs to look at arguments and make the proper type conversions for the call. But the FFI is heavily used in the commercial Terf system, in fact, all the OpenGL calls are done through it. So its quite proven, and not that slow.&lt;/p>
&lt;p>&lt;strong>NOTE:&lt;/strong> There are in fact several FFIs today, the old one, the one called Alien and Pharo is brewing a new one called UFFI.&lt;/p>
&lt;p>Let&amp;rsquo;s see if we can use the good old FFI with Nim.&lt;/p></description></item><item><title>Cog vs LuaJIT2</title><link>https://goran.krampe.se/2014/10/13/cog-vs-luajit/</link><pubDate>Mon, 13 Oct 2014 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2014/10/13/cog-vs-luajit/</guid><description>&lt;p>In the open source Smalltalk community we have a &lt;strong>pretty fast&lt;/strong> VM these days - its called &lt;a href="http://www.mirandabanda.org/cog/" target="_blank" rel="noopener noreferrer">Cog&lt;/a>
 and is written by the highly gifted and experienced &lt;a href="http://www.mirandabanda.org/cogblog/microbio/" target="_blank" rel="noopener noreferrer">Eliot Miranda&lt;/a>
 who also happens to be a really nice guy! Cog is fast and its also still improving with some more developers joining recently.&lt;/p>
&lt;p>Another &lt;strong>very fast&lt;/strong> VM is &lt;a href="http://luajit.org" target="_blank" rel="noopener noreferrer">LuaJIT2&lt;/a>
 for the &lt;a href="http://www.lua.org" target="_blank" rel="noopener noreferrer">Lua&lt;/a>
 language (version 5.1), also written by a single individual with extraordinary programming talent - Mike Pall. LuaJIT2 is often mentioned as the &lt;strong>fastest dynamically typed language&lt;/strong> (or VM) and even though Lua is similar to Smalltalk (well, its actually very similar to Javascript) its also clearly a different beast with other characteristics. If you start looking at the world of game development - then Lua appears &lt;strong>everywhere&lt;/strong>.&lt;/p></description></item><item><title>Moving to SmalltalkHub</title><link>https://goran.krampe.se/2013/01/07/moving-to-smalltalkhub/</link><pubDate>Mon, 07 Jan 2013 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2013/01/07/moving-to-smalltalkhub/</guid><description>&lt;p>As a long time Squeak/Pharo (Smalltalk) developer I have accumulated a set of packages that I have written or co-written and that have been published open source for others to use. Since quite a few years &lt;a href="http://www.squeaksource.com" target="_blank" rel="noopener noreferrer">SqueakSource&lt;/a>
 has been the natural hosting place, but it has reached the end of the road and it&amp;rsquo;s &lt;a href="http://news.squeak.org/2012/11/18/move-your-squeaksource-files/" target="_blank" rel="noopener noreferrer">high time to move on&lt;/a>
.&lt;/p></description></item><item><title>Oak</title><link>https://goran.krampe.se/2012/12/29/oak/</link><pubDate>Sat, 29 Dec 2012 00:00:00 +0000</pubDate><guid>https://goran.krampe.se/2012/12/29/oak/</guid><description>&lt;p>In a customer project right now I need to be able to work and evolve code fast, with a relatively complex model. And by &lt;em>fast&lt;/em> I mean that I want to cut away as much as possible of the efforts related to persistence. Generally this is what OODBs excel at.&lt;/p>
&lt;p>In the Squeak world we have &lt;a href="http://www.gemstone.com/products/gemstone" target="_blank" rel="noopener noreferrer">GemStone&lt;/a>
 (commercial), &lt;a href="http://wiki.squeak.org/squeak/3492" target="_blank" rel="noopener noreferrer">GOODS&lt;/a>
 and &lt;a href="http://wiki.squeak.org/squeak/2665" target="_blank" rel="noopener noreferrer">Magma&lt;/a>
 as &amp;ldquo;full fledged&amp;rdquo; OODBs. Last century :) I worked with GemStone (both Gemstone/S and /J) and its a great product - but I want something lightweight and open source. And simple. And hackable. And new. :)&lt;/p>
&lt;p>I also used Magma in the Gjallar project, and while I respect it highly - this time I want to try something with an &amp;ldquo;externally supported backend&amp;rdquo;. I also had a mixed performance experience, but this was &amp;ldquo;pre Cog&amp;rdquo; and Magma has also surely evolved lots since then, and I am not sure we did everything the way we should have either.&lt;/p>
&lt;p>SandstoneDB could also be interesting to look more closely at, but since I have been working with &lt;a href="http://www.nicolas-petton.fr" target="_blank" rel="noopener noreferrer">Nicolas Petton&lt;/a>
 on improving &lt;a href="http://smalltalkhub.com/#!/~gokr/Phriak" target="_blank" rel="noopener noreferrer">Phriak&lt;/a>
 (Riak interface for Pharo) it was natural to take a look at one of his &amp;ldquo;under the radar&amp;rdquo; projects - &lt;a href="http://www.smalltalkhub.com/#!/~NicolasPetton/Oak" target="_blank" rel="noopener noreferrer">Oak&lt;/a>
, an &amp;ldquo;OODBish&amp;rdquo; solution on top of Riak. At this point I have been doing much more than looking, in fact I am hacking on it! And oh, yeah, of course there are &lt;a href="http://wiki.squeak.org/squeak/512" target="_blank" rel="noopener noreferrer">lots more persistence options&lt;/a>
 available too.&lt;/p></description></item><item><title>Literal arrays vs JSON vs STON vs Tirade</title><link>https://goran.krampe.se/2012/05/08/literal-arrays-vs-json-vs-ston-vs-tirade/</link><pubDate>Tue, 08 May 2012 00:11:22 +0000</pubDate><guid>https://goran.krampe.se/2012/05/08/literal-arrays-vs-json-vs-ston-vs-tirade/</guid><description>&lt;p>Recently there were a range of threads on the pharo-dev mailinglist discussing the textual format to use for Smalltalk source code metadata. The discussion veered off from the specific use case but basically four different formats were discussed and compared, of which one I am the author. And oh, sorry for the formatting of this article - I need to change theme on this blog for better readability.&lt;/p></description></item><item><title>Current Smalltalk obsessions...</title><link>https://goran.krampe.se/2012/02/07/current-smalltalk-obsessions/</link><pubDate>Tue, 07 Feb 2012 00:15:10 +0000</pubDate><guid>https://goran.krampe.se/2012/02/07/current-smalltalk-obsessions/</guid><description>&lt;p>These days I am, as usual, torn between several interesting technical projects.&lt;/p>
&lt;h1 id="amber">
 Amber
 &lt;a class="heading-link" href="#amber">
 &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;/h1>
&lt;p>The new &lt;a href="http://www.world.st" target="_blank" rel="noopener noreferrer">Smalltalk&lt;/a>
 called &lt;a href="http://www.amber-lang.net" target="_blank" rel="noopener noreferrer">Amber&lt;/a>
 (by Nicolas Petton) that compiles to javascript is pretty awesome and there are tons of interesting things one can do with it. My contributions so far include the beginning of a package model, a faster simpler chunk format exporter/importer, a command line compiler, a Makefile system so that Amber can be built fully from the command line and a bunch of &lt;a href="https://github.com/NicolasPetton/amber/tree/master/examples" target="_blank" rel="noopener noreferrer">examples&lt;/a>
 running on top of &lt;a href="http://nodejs.org" target="_blank" rel="noopener noreferrer">Nodejs&lt;/a>
 and &lt;a href="http://developer.palm.com" target="_blank" rel="noopener noreferrer">webOS&lt;/a>
, and a few other odds and ends.&lt;/p></description></item><item><title>ESUG day 3</title><link>https://goran.krampe.se/2011/08/24/esug-day-3/</link><pubDate>Wed, 24 Aug 2011 10:07:30 +0000</pubDate><guid>https://goran.krampe.se/2011/08/24/esug-day-3/</guid><description>&lt;p>Suddenly it is Wednesday and we are already on day three at &lt;a href="Http://www.esug.org" >ESUG&lt;/a>
 - a superb software developer conference focused on &lt;a href="http://www.world.st" target="_blank" rel="noopener noreferrer">Smalltalk&lt;/a>
. Time flies. Yesterday I mainly hacked together with Nicolas Petton on &lt;a href="Http://www.jtalk-project.org" >Jtalk&lt;/a>
, really fun, unfortunately I missed a few interesting presentations, like Fuel and Bifrost etc.&lt;/p>
&lt;p>This day starts with Stéphane presenting &amp;ldquo;Humane assessment&amp;rdquo;. Mmm, got distracted by my Touchpad, but Stéphane is showing some cool visualizations right now, clearly useful for large systems and organisations that need understand their own &amp;ldquo;huge legacy software&amp;rdquo;. Hehe, the browsers shows visual queues on &amp;ldquo;bad designs&amp;rdquo; like marking methods as &amp;ldquo;BrainMethod&amp;rdquo; or marking a class as &amp;ldquo;God Class&amp;rdquo; - that is indeed very slick!&lt;/p></description></item><item><title>ESUG 2011 in Edinburgh</title><link>https://goran.krampe.se/2011/08/11/esug-2011-in-edinburgh/</link><pubDate>Thu, 11 Aug 2011 11:59:57 +0000</pubDate><guid>https://goran.krampe.se/2011/08/11/esug-2011-in-edinburgh/</guid><description>&lt;p>Each year I try to attend at least one developer conference. Earlier OOPSLA was a given but it lost its appeal quite a few years back and now it is not even called OOPSLA anymore. As a die hard &lt;a href="http://www.world.st" target="_blank" rel="noopener noreferrer">Smalltalker&lt;/a>
 I instead attended the &lt;a href="http://www.esug.org/wiki/pier/Conferences" target="_blank" rel="noopener noreferrer">ESUG conference&lt;/a>
 in Brest 2009 and it was easily the most rewarding conference I ever have attended! Missed last year in Barcelona but this year I am going to &lt;a href="http://www.esug.org/wiki/pier/Conferences/2011" target="_blank" rel="noopener noreferrer">Edinburgh&lt;/a>
 for a week of Smalltalking.&lt;/p></description></item><item><title>Tirade, supporting embedded text</title><link>https://goran.krampe.se/2011/04/15/tirade-supporting-embedded-text/</link><pubDate>Fri, 15 Apr 2011 01:22:58 +0000</pubDate><guid>https://goran.krampe.se/2011/04/15/tirade-supporting-embedded-text/</guid><description>&lt;p>Two years ago I ended up creating &lt;a href="http://goran.krampe.se/2009/03/16/tirade-a-file-format-for-smalltalkers/" target="_blank" rel="noopener noreferrer">Tirade&lt;/a>
 - a new &amp;ldquo;file format&amp;rdquo; for Smalltalkers. Or rather, a way to serialize stuff into a sequence of Smalltalk messages with literals as arguments. I have written a &lt;a href="http://goran.krampe.se/categories/tirade" target="_blank" rel="noopener noreferrer">few blog articles about Tirade&lt;/a>
 so I will not go into details in this one.&lt;/p>
&lt;p>One thing that has been disturbing with Tirade is that I wanted it to be the main format for serializing Deltas, the new implementation of &amp;ldquo;21st Century ChangeSets&amp;rdquo;. This means I want Tirade to handle Smalltalk source code in the best possible way. Ideally I would want the Tirade file to be editable in a text editor if I wanted, and not being broken by that.&lt;/p></description></item><item><title>Preaching Smalltalk inside a nuclear reactor</title><link>https://goran.krampe.se/2011/04/08/preaching-smalltalk-inside-a-nuclear-reactor/</link><pubDate>Fri, 08 Apr 2011 12:07:35 +0000</pubDate><guid>https://goran.krampe.se/2011/04/08/preaching-smalltalk-inside-a-nuclear-reactor/</guid><description>&lt;p>&amp;hellip;is what I did yesterday. It was the &lt;a href="http://sites.google.com/site/stockholmgtug" target="_blank" rel="noopener noreferrer">Stockholm GTUG&lt;/a>
 group having a loose and laid back meetup in a rather special venue - R1, &lt;a href="http://sv.wikipedia.org/wiki/R1_%28reaktor%29" target="_blank" rel="noopener noreferrer">Sweden&amp;rsquo;s first nuclear reactor&lt;/a>
! 27 meters below ground, kinda&amp;hellip; funky.&lt;/p>
&lt;p>Anyway, I tried doing an ultra compact version of several of my other presentations around &lt;a href="http://www.world.st" target="_blank" rel="noopener noreferrer">Smalltalk&lt;/a>
 and &lt;a href="http://www.seaside.st" target="_blank" rel="noopener noreferrer">Seaside&lt;/a>
 - didn&amp;rsquo;t really go 100% since I both had some technical issues (keyboard problems and projector issues too) and ended up taking more time than was planned. Hopefully noone got upset about that.&lt;/p></description></item><item><title>Tirade, first trivial use</title><link>https://goran.krampe.se/2009/04/20/tirade-first-trivial-use/</link><pubDate>Mon, 20 Apr 2009 00:43:55 +0000</pubDate><guid>https://goran.krampe.se/2009/04/20/tirade-first-trivial-use/</guid><description>&lt;p>Last night I started hooking &lt;a href="http://goran.krampe.se/2009/03/16/tirade-a-file-format-for-smalltalkers/" target="_blank" rel="noopener noreferrer">Tirade&lt;/a>
 into Deltas. Quick background: Deltas is &amp;ldquo;Changesets for the 21st century&amp;rdquo;, or in other words an intelligent patch system under development for Squeak. Tirade is a Smalltalk/Squeak centric &amp;ldquo;JSON&amp;rdquo;-kinda-thingy. I made Tirade in order to get a nice file format for Deltas. Just wanted to share how the first trivial code looks, and thus illustrate simple use of Tirade.&lt;/p>
&lt;p>I have a DSDelta (a Delta being almost like a ChangeSet). It consists of some metadata (a UUID, a Dictionary of properties and a TimeStamp) and a DSChangeSequence (which holds the actual DSChange instances). As a first shot I only implemented the metadata bit. So step by step:&lt;/p></description></item><item><title>Tirade, part 2</title><link>https://goran.krampe.se/2009/03/20/tirade-part-2/</link><pubDate>Fri, 20 Mar 2009 00:34:07 +0000</pubDate><guid>https://goran.krampe.se/2009/03/20/tirade-part-2/</guid><description>&lt;p>In an article recently I described &lt;a href="http://goran.krampe.se/2009/03/16/tirade-a-file-format-for-smalltalkers/" target="_blank" rel="noopener noreferrer">Tirade&lt;/a>
 - a new generic &amp;ldquo;file format&amp;rdquo; for Smalltalk/Squeak, or actually a sub language! Since that article I have refined Tirade a bit. Tirade consists today of 4 classes (parser, reader, writer, recorder) totalling &lt;strong>about 500 lines of code&lt;/strong>, excluding tests. Tests are &lt;strong>green in 3.10.2, pharo-10231, 3.9, 3.8 and 3.7&lt;/strong>. It does turn red in 3.6 due to old initialize behavior, some missing methods etc, probably easily fixed if anyone cares. There are no dependencies on other packages. Compared to using the old Compiler&amp;raquo;evaluate: it is about 5-7 times faster.&lt;/p></description></item><item><title>Tirade, a file format for Smalltalkers</title><link>https://goran.krampe.se/2009/03/16/tirade-a-file-format-for-smalltalkers/</link><pubDate>Mon, 16 Mar 2009 00:24:07 +0000</pubDate><guid>https://goran.krampe.se/2009/03/16/tirade-a-file-format-for-smalltalkers/</guid><description>&lt;p>In my revived work on &lt;a href="http://wiki.squeak.org/squeak/6001" target="_blank" rel="noopener noreferrer">Deltastreams&lt;/a>
 in Squeak I ended up facing the choice of native file format for Deltas. Matthew has made an advanced format called &lt;a href="http://www.squeaksource.com/InterleavedChangeSet.html" target="_blank" rel="noopener noreferrer">InterleavedChangeset&lt;/a>
 which manages to squeeze a binary representation of a Delta into a &lt;a href="http://wiki.squeak.org/squeak/1105" target="_blank" rel="noopener noreferrer">Changeset&lt;/a>
 file (which is in Smalltalk chunk format). An impressive feat, and it has the advantage of being backwards compatible in the sense that a Delta in this format can be filed in as a plain old Changeset into an old Squeak image.&lt;/p></description></item></channel></rss>