<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Squeak on Roads Less Taken</title><link>https://goran.krampe.se/categories/squeak/</link><description>Recent content in Squeak on Roads Less Taken</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 03 Nov 2014 00:00:00 +0000</lastBuildDate><atom:link href="https://goran.krampe.se/categories/squeak/index.xml" rel="self" type="application/rss+xml"/><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>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 4</title><link>https://goran.krampe.se/2011/08/25/esug-day-4/</link><pubDate>Thu, 25 Aug 2011 16:50:52 +0000</pubDate><guid>https://goran.krampe.se/2011/08/25/esug-day-4/</guid><description>&lt;p>This day started with some stress, Nicolas and I whipped up the last details of our co-presentation on &lt;a href="Http://jtalk-project.org" >Jtalk&lt;/a>
 (Nicolas decided to skip &lt;a href="Http://www.iliadproject.org" >Iliad&lt;/a>
) - and my Eris demo suddenly got b0rken. But I managed to fix it and our presentation was &lt;strong>very well&lt;/strong> received - it was great fun!&lt;/p>
&lt;p>Nicolas managed to do quite a few &amp;ldquo;on the fly&amp;rdquo; demonstrations of various Jtalk snippets etc, and running &lt;a href="Http://nicolas-petton.fr/presentations/esug2011" >the slides&lt;/a>
 in Jtalk was of course a killer thing. I explained how jtalkc is being run on top of Node.js and quickly proceeded into showing the &lt;a href="Http://github.com/gokr/jtalk/tree/master/nodejs/trivialserver" >TrivialServer&lt;/a>
 demo in Node.is - when Apache benchmark showed &lt;strong>1800 requests/second&lt;/strong> there was a spontaneous applause. :)&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>Node.js vs Nginx/Squeak, part 1</title><link>https://goran.krampe.se/2011/03/14/node-js-vs-nginxsqueak-part-1/</link><pubDate>Mon, 14 Mar 2011 16:55:58 +0000</pubDate><guid>https://goran.krampe.se/2011/03/14/node-js-vs-nginxsqueak-part-1/</guid><description>&lt;p>Hmmm, after seeing the &lt;a href="http://nodejs.org" target="_blank" rel="noopener noreferrer">Node.js&lt;/a>
 presentation at &lt;a href="http://swdc-central.com/dyncon2011/index.html" target="_blank" rel="noopener noreferrer">Dyncon 2011&lt;/a>
 I couldn&amp;rsquo;t help installing Nginx and Blackfoot (SimpleCGI) in a Squeak 4.2 image running on the Cog VM to make some performance tests! In fact I started doing that during the presentation. :)&lt;/p>
&lt;p>My first run on Nginx/Squeak looked quite unimpressive. Well, one client doing 1300 req/s to a small helloworld was decent although Node.js handled approximately 2x that. With Nginx we have a two tier solution so a factor of 2 is not really surprising in this trivial case. Top showed similar load, both solutions only seem to consume 8-9% of my CPU power on this box, but the Nginx/Squeak solution of course spreads load between them with approximately 1/3 or 1/4 on nginx.&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>