<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>sin-ack&#39;s writings</title>
    <link>https://sin-ack.github.io/</link>
    <description>Recent content on sin-ack&#39;s writings</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 08 Dec 2025 08:30:00 +0000</lastBuildDate>
    <atom:link href="https://sin-ack.github.io/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>What We Take For Granted</title>
      <link>https://sin-ack.github.io/posts/20251207-what-we-take-for-granted/</link>
      <pubDate>Mon, 08 Dec 2025 08:30:00 +0000</pubDate>
      <guid>https://sin-ack.github.io/posts/20251207-what-we-take-for-granted/</guid>
      <description>&lt;p&gt;This is the lightning(-ish) talk I gave at &lt;a href=&#34;https://luma.com/rrvc0wyn&#34;&gt;TigerBeetle 1000x World Tour Belgrade&lt;/a&gt;,&#xA;transcribed to article form. Huge thanks to &lt;a href=&#34;https://x.com/ludwigABAP&#34;&gt;Ludwig&lt;/a&gt;&#xA;for hosting the event and &lt;a href=&#34;https://x.com/TigerBeetleDB&#34;&gt;the TigerBeetle folks&lt;/a&gt;&#xA;for setting it up.&lt;/p&gt;&#xA;&lt;p&gt;The slides are available in &lt;a href=&#34;https://sin-ack.github.io/documents/20251204-tb-1000x-talk.pdf&#34;&gt;PDF format as well&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AoC 2022 in ZigSelf, day 2</title>
      <link>https://sin-ack.github.io/posts/zigself-aoc-2022-day2/</link>
      <pubDate>Fri, 02 Dec 2022 06:00:00 +0000</pubDate>
      <guid>https://sin-ack.github.io/posts/zigself-aoc-2022-day2/</guid>
      <description>&lt;p&gt;The second day of &lt;a href=&#34;https://adventofcode.com/&#34;&gt;Advent of Code&lt;/a&gt; was also rather&#xA;easy on the question side, like day 1. Rather, the hard part was reading the&#xA;question. :^) Here&amp;rsquo;s the solution in&#xA;&lt;a href=&#34;https://github.com/sin-ack/zigself&#34;&gt;ZigSelf&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AoC 2022 in ZigSelf, day 1</title>
      <link>https://sin-ack.github.io/posts/zigself-aoc-2022-day1/</link>
      <pubDate>Thu, 01 Dec 2022 06:00:00 +0000</pubDate>
      <guid>https://sin-ack.github.io/posts/zigself-aoc-2022-day1/</guid>
      <description>&lt;p&gt;Hi there. I had mentioned that I would be solving AoC puzzles this year with&#xA;ZigSelf. I plan to commit to it as much as possible, but no promises. :^)&lt;/p&gt;&#xA;&lt;p&gt;The first day of AoC has always been quite easy, and today is no exception, so&#xA;this was rather simple.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The inner workings of ZigSelf&#39;s actor model</title>
      <link>https://sin-ack.github.io/posts/zigself-actor/</link>
      <pubDate>Sat, 26 Nov 2022 21:00:00 +0000</pubDate>
      <guid>https://sin-ack.github.io/posts/zigself-actor/</guid>
      <description>&lt;p&gt;Hi there. I wanted to do a series of deep dives about various parts of ZigSelf&#xA;in order to give others a more thorough explanation of how everything works, and&#xA;also as a braindump in order to verify my thinking. The first post I wanted to&#xA;make is regarding ZigSelf&amp;rsquo;s implementation of the actor model, as it&amp;rsquo;s the&#xA;feature I believe is one of the most interesting aspects of the language.&lt;/p&gt;</description>
    </item>
    <item>
      <title>That Time I Tried Porting Zig to SerenityOS</title>
      <link>https://sin-ack.github.io/posts/sycl-talk-20221007/</link>
      <pubDate>Wed, 19 Oct 2022 19:00:00 +0000</pubDate>
      <guid>https://sin-ack.github.io/posts/sycl-talk-20221007/</guid>
      <description>&lt;p&gt;This was a talk I gave at the &lt;a href=&#34;https://sycl.it/&#34;&gt;Software You Can Love 2022&lt;/a&gt;&#xA;conference. You can find the slides &lt;a href=&#34;https://sin-ack.github.io/documents/sycl-talk-20221007.pdf&#34;&gt;right here&#xA;(PDF)&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;Today I want to tell you a story about the time I ported the Zig compiler to&#xA;SerenityOS.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m going to tell you a bit about what my motivation was to do this. Then I&amp;rsquo;ll&#xA;explain the steps I took and the various challenges I faced (there were a lot of&#xA;those!). We&amp;rsquo;re going to go into the details of some of the problems that I had&#xA;to deal with. And finally, I&amp;rsquo;ll finish it off with my general thoughts&amp;hellip; and&#xA;maybe a little surprise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ZigSelf Update, August 2022</title>
      <link>https://sin-ack.github.io/posts/zigself-202208/</link>
      <pubDate>Sat, 13 Aug 2022 10:00:00 +0100</pubDate>
      <guid>https://sin-ack.github.io/posts/zigself-202208/</guid>
      <description>&lt;p&gt;Hi there. It&amp;rsquo;s been quite a while since I posted here, mostly due to real life&#xA;responsibilities. I&amp;rsquo;m planning on making monthly updates here from now on so&#xA;that I can showcase the new things that are in ZigSelf. For the first update&#xA;though, let&amp;rsquo;s play some catch-up.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ZigSelf: An implementation of Self in Zig</title>
      <link>https://sin-ack.github.io/posts/zigself-01/</link>
      <pubDate>Tue, 01 Mar 2022 10:00:00 +0100</pubDate>
      <guid>https://sin-ack.github.io/posts/zigself-01/</guid>
      <description>&lt;p&gt;Hello there. I have not posted in a while, and not without good reason. In my&#xA;&lt;a href=&#34;https://sin-ack.github.io/posts/a-tour-of-self/&#34;&gt;first article&lt;/a&gt; I had mentioned that I was going to make&#xA;posts about my own implementation of Self called mySelf. That project never took&#xA;off, and my interest shifted to other things. I had largely forgotten about it,&#xA;but then LangJam happened.&lt;/p&gt;&#xA;&lt;h2 id=&#34;langjam&#34;&gt;LangJam&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/langjam/langjam&#34;&gt;LangJam&lt;/a&gt; is a programming jam that works&#xA;similar to game jams, but instead of developing video games you develop a&#xA;programming language based around the theme of the jam. When I heard about it&#xA;back in August, I remembered about my interest in implementing Self, and decided&#xA;to join the jam. My implementation &lt;a href=&#34;https://github.com/langjam/jam0001/blob/main/TeamDailyDose&#34;&gt;went largely nowhere&lt;/a&gt;,&#xA;as it wasn&amp;rsquo;t really interesting from the standpoint of the jam&amp;rsquo;s theme. However,&#xA;spending 48 hours to implement the lexer, parser and then a basic interpreter&#xA;was pretty fun, and I started wondering again.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How malloc broke Serenity&#39;s JPGLoader, or: how to win the lottery</title>
      <link>https://sin-ack.github.io/posts/jpg-loader-bork/</link>
      <pubDate>Thu, 03 Jun 2021 00:00:00 +0200</pubDate>
      <guid>https://sin-ack.github.io/posts/jpg-loader-bork/</guid>
      <description>&lt;p&gt;I got the chance to investigate an interesting bug in&#xA;&lt;a href=&#34;https://serenityos.org/&#34;&gt;SerenityOS&lt;/a&gt; this week. It was related to the decoding&#xA;of JPG images in the operating system. For some reason, when a JPG image is&#xA;viewed, it comes out like this:&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://sin-ack.github.io/images/serenity-jpgloader/lenna-broken.png&#34;&#xA;    alt=&#34;Lenna,&#xA;showing up with incorrect colors.&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;Lenna,&#xA;showing up with incorrect colors.&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Weird, huh? Also seems like a simple confusion of RGB vs. BGR. And sure enough,&#xA;making the following change on &lt;code&gt;JPGLoader.cpp&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-diff&#34; data-lang=&#34;diff&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gd&#34;&gt;-   const Color color { (u8)block.y[pixel_index], (u8)block.cb[pixel_index], (u8)block.cr[pixel_index] };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gd&#34;&gt;&lt;/span&gt;&lt;span class=&#34;gi&#34;&gt;+   const Color color { (u8)block.cr[pixel_index], (u8)block.cb[pixel_index], (u8)block.y[pixel_index] };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gi&#34;&gt;&lt;/span&gt;    context.bitmap-&amp;gt;set_pixel(x, y, color);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;makes the image show up correctly. Case closed!&lt;/p&gt;&#xA;&lt;p&gt;&amp;hellip;not. Why did this even break in the first place?&lt;/p&gt;</description>
    </item>
    <item>
      <title>A look at Self&#39;s object system</title>
      <link>https://sin-ack.github.io/posts/self-object-system/</link>
      <pubDate>Mon, 29 Mar 2021 13:00:00 +0200</pubDate>
      <guid>https://sin-ack.github.io/posts/self-object-system/</guid>
      <description>&lt;p&gt;When I &lt;a href=&#34;https://sin-ack.github.io/posts/a-tour-of-self/&#34;&gt;first introduced Self&lt;/a&gt;, I mentioned that Self is&#xA;a programming language which employs &lt;em&gt;prototype-based inheritance&lt;/em&gt;; it does not&#xA;depend on a class-instance distinction to facilitate object-oriented&#xA;programming, but rather, it uses a &lt;em&gt;prototype object&lt;/em&gt; from which copies are&#xA;created. The methods associated with a prototype is stored in a &lt;em&gt;traits object&lt;/em&gt;&#xA;which is just another object storing methods that can be used on a prototype and&#xA;all its copies through a parent slot.&lt;/p&gt;&#xA;&lt;p&gt;The trouble begins when we actually try to implement this prototype-based&#xA;inheritance system as an actual virtual machine, particularly with regards to&#xA;memory consumption. Say that I have a prototype object &lt;code&gt;point&lt;/code&gt; with a constant&#xA;parent slot pointing to &lt;code&gt;traits point&lt;/code&gt; and two assignable slots, &lt;code&gt;x&lt;/code&gt; and&#xA;&lt;code&gt;y&lt;/code&gt;.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; When we copy this object, we would expect to copy all three fields. But&#xA;if we scale that up, that&amp;rsquo;s so much unnecessary data being copied! For one, for&#xA;every copy of the &lt;code&gt;point&lt;/code&gt; prototype we make, we&amp;rsquo;re copying that &lt;code&gt;traits point&lt;/code&gt;&#xA;parent slot reference. Not to mention, because our language is dynamic, we can&amp;rsquo;t&#xA;simply treat &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; as offsets into memory, because they might be constant&#xA;or assignable (Self can&amp;rsquo;t intrinsically know). So our naive implementation would&#xA;be pretty inefficient.&lt;/p&gt;&#xA;&lt;p&gt;Can we make this more memory-efficient? In fact, we can; we can exploit the fact&#xA;that most Self objects that are copied only ever have their assignable slots&#xA;modified. Let&amp;rsquo;s take a look at how the original developers of Self have&#xA;optimized the memory usage of the Self virtual machine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>An introduction to Morphic: Self&#39;s UI toolkit</title>
      <link>https://sin-ack.github.io/posts/morphic-intro/</link>
      <pubDate>Sun, 17 Jan 2021 17:35:06 +0100</pubDate>
      <guid>https://sin-ack.github.io/posts/morphic-intro/</guid>
      <description>&lt;p&gt;In my previous two posts, I talked about Self as the language, and the system&#xA;which allows it to serialize objects into text format. Now let&amp;rsquo;s talk about&#xA;another big part of Self, which is the programming environment and the UI&#xA;toolkit that it is created from: Morphic.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Self Transporter: how to share your Self code</title>
      <link>https://sin-ack.github.io/posts/self-transporter/</link>
      <pubDate>Sat, 16 Jan 2021 22:13:00 +0100</pubDate>
      <guid>https://sin-ack.github.io/posts/self-transporter/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://sin-ack.github.io/posts/a-tour-of-self/&#34;&gt;previous post&lt;/a&gt;, I talked about Self and gave a&#xA;general tour of the language and the programming environment. I mentioned that&#xA;Self was an image-based programming language. Of course, if you want to develop&#xA;a Self application with multiple people, an image is not suitable for&#xA;collaborating (except in real-time &amp;ndash; we&amp;rsquo;ll come back to that in a later post).&#xA;Your Self image contains everything in your programming environment (provided&#xA;you don&amp;rsquo;t forget to save it!), including the active morphs you have on the&#xA;screen, and stuff you are working on. Therefore, obviously, it is not possible&#xA;to collaborate using your world images on version control.&lt;/p&gt;&#xA;&lt;p&gt;So then the question becomes &amp;ldquo;How can we extract just the parts of our&#xA;application so that they can be re-imported to other Self worlds independently?&amp;rdquo;&#xA;And the answer to that is the Transporter system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A tour of Self</title>
      <link>https://sin-ack.github.io/posts/a-tour-of-self/</link>
      <pubDate>Thu, 14 Jan 2021 16:51:08 +0100</pubDate>
      <guid>https://sin-ack.github.io/posts/a-tour-of-self/</guid>
      <description>&lt;p&gt;Hey there. This is the first post I will be making here, and I wanted to give a&#xA;tour of Self before making posts about my current implementation, mySelf.&lt;/p&gt;&#xA;&lt;p&gt;Throughout this post, I will be showing examples from the regular implementation&#xA;of the Self programming environment, available&#xA;&lt;a href=&#34;https://github.com/russellallen/self&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-self&#34;&gt;What is Self?&lt;/h2&gt;&#xA;&lt;p&gt;To quote the &lt;a href=&#34;https://selflanguage.org/&#34;&gt;Self language homepage&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Self is a prototype-based dynamic object-oriented programming language,&#xA;environment, and virtual machine centered around the principles of simplicity,&#xA;uniformity, concreteness, and liveness. Self includes a programming language, a&#xA;collection of objects defined in the Self language, and a programming&#xA;environment built in Self for writing Self programs. The language and&#xA;environment attempt to present objects to the programmer and user in as direct&#xA;and physical a way as possible. The system uses the prototype-based style of&#xA;object construction.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
