<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[RawPointers]]></title><description><![CDATA[Serious Fun with Computers]]></description><link>https://news.rawpointers.io</link><image><url>https://substackcdn.com/image/fetch/$s_!Pkzp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F863c92ae-c96b-4d14-8721-a1b13bb0b8c1_512x512.png</url><title>RawPointers</title><link>https://news.rawpointers.io</link></image><generator>Substack</generator><lastBuildDate>Wed, 06 May 2026 12:19:19 GMT</lastBuildDate><atom:link href="https://news.rawpointers.io/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Lukasz Janyst]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[newsletter@rawpointers.io]]></webMaster><itunes:owner><itunes:email><![CDATA[newsletter@rawpointers.io]]></itunes:email><itunes:name><![CDATA[Lukasz Janyst]]></itunes:name></itunes:owner><itunes:author><![CDATA[Lukasz Janyst]]></itunes:author><googleplay:owner><![CDATA[newsletter@rawpointers.io]]></googleplay:owner><googleplay:email><![CDATA[newsletter@rawpointers.io]]></googleplay:email><googleplay:author><![CDATA[Lukasz Janyst]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Threading From Scratch]]></title><description><![CDATA[I have always found that building useless things from scratch in my spare time is the best way to cure my ignorance.]]></description><link>https://news.rawpointers.io/p/threading-from-scratch</link><guid isPermaLink="false">https://news.rawpointers.io/p/threading-from-scratch</guid><dc:creator><![CDATA[Lukasz Janyst]]></dc:creator><pubDate>Thu, 14 Apr 2022 14:23:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Pkzp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F863c92ae-c96b-4d14-8721-a1b13bb0b8c1_512x512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have always found that building useless things from scratch in my spare time is the best way to cure my ignorance. Coincidentally, it also seems to be one of the best ways to cure boredom and disillusionment with technology that many people <a href="https://news.ycombinator.com/item?id=31001155">complain</a> about these days. I have been lucky enough to have somebody point me to <a href="https://www.asc.ohio-state.edu/kilcup.1//262/feynman.html">this snippet</a> from "<a href="https://www.amazon.com/dp/0393316041">Surely you're joking, Mr. Feynman</a>" very early during my university career:</p><blockquote><p>Then I had another thought: Physics disgusts me a little bit now, but I used to enjoy doing physics. Why did I enjoy it? I used to play with it. I used to do whatever I felt like doing - it didn't have to do with whether it was important for the development of nuclear physics, but whether it was interesting and amusing for me to play with. When I was in high school, I'd see water running out of a faucet growing narrower, and wonder if I could figure out what determines that curve. I found it was rather easy to do. I didn't have to do it; it wasn't important for the future of science; somebody else had already done it. That didn't make any difference. I'd invent things and play with things for my own entertainment.</p></blockquote><p>This strategy worked wonders for me. It allowed me to retain relative sanity, and I have always had an absolute blast doing it. It has also led me to <a href="https://jany.st/about.html">unique places</a> and opened up great opportunities as a byproduct.</p><p>This post is about one of these things that I played with for no good reason other than pure fun. At one point, I decided that I would like to know how threading works and that the best way to do it was to write a threading library entirely from scratch. I mean the stuff that hides behind all those <code>pthread_*</code> calls that you know and love from C. Amazingly, I was able to chew through all this bit by bit and build something reasonably simple that still did all those things that mystified me in the past.</p><p>The posts linked below describe a more or less complete threading library written in simple C and based on Linux syscalls. The library (almost) does not use glibc, but it takes some inspiration from it. I start from the basics like calling syscalls from C, heap management, printing text, etc. Then, I move to thread creation, cancelation, joining, and scheduling on top of that. It all ends with synchronization primitives: a mutex implementation with priority inheritance, as well as condition variables and RW locks.</p><p>Here's <a href="https://github.com/ljanyst/threading-from-scratch">the code</a> and a nice <a href="https://resources.rawpointers.io/threading/cross-ref/tb/">clickable cross-reference</a> if you want to cut right to the chase.</p><p></p><h4>Table of Contents</h4><ol><li><p><a href="https://jany.st/post/2016-01-30-threading-from-scratch-1-syscalls-memory-and-your-first-therad.html">Syscalls, memory, and your first therad</a></p></li><li><p><a href="https://jany.st/post/2016-02-03-threading-from-scratch-2-the-pointer-to-self-and-thread-local-storage.html">The pointer to self and thread-local storage</a></p></li><li><p><a href="https://jany.st/post/2016-02-15-threading-from-scratch-3-futexes-mutexes-and-memory-sychronization.html">Futexes, mutexes, and memory sychronization</a></p></li><li><p><a href="https://jany.st/post/2016-02-24-threading-from-scratch-4-joining-threads-and-dynamic-initialization.html">Joining threads and dynamic initialization</a></p></li><li><p><a href="https://jany.st/post/2016-03-01-threading-from-scratch-5-cancelation.html">Cancellation</a></p></li><li><p><a href="https://jany.st/post/2016-03-05-threading-from-scratch-6-scheduling-and-task-priority.html">Scheduling and task priority</a></p></li><li><p><a href="https://jany.st/post/2016-03-09-threading-from-scratch-7-rw-locks.html">RW Locks</a></p></li><li><p><a href="https://jany.st/post/2016-03-18-threading-from-scratch-8-condition-variables.html">Condition variables</a></p></li><li><p><a href="https://jany.st/post/2016-03-19-threading-from-scratch-9-final-thoughts.html">Final thoughts</a></p></li></ol>]]></content:encoded></item><item><title><![CDATA[GhostSCAD: Marrying OpenSCAD and Golang ]]></title><description><![CDATA[OpenSCAD is awesome.]]></description><link>https://news.rawpointers.io/p/ghostscad-marrying-openscad-and-golang</link><guid isPermaLink="false">https://news.rawpointers.io/p/ghostscad-marrying-openscad-and-golang</guid><dc:creator><![CDATA[Lukasz Janyst]]></dc:creator><pubDate>Tue, 05 Apr 2022 17:20:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rWV9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://openscad.org">OpenSCAD</a> is awesome. Being a software engineer, the ability to code up my 3D models and keep them readably under version control pleases me immensely. I started learning OpenSCAD from <a href="https://openhome.cc/eGossip/OpenSCAD/">this</a> fantastic tutorial that quickly showed me the expressive power of the relatively few basic concepts provided by the system. It also made me realize some of the system's limitations.</p><p>For example, when doing the <a href="https://openhome.cc/eGossip/OpenSCAD/FunctionGrapher.html">function grapher</a> exercise, I was disappointed that I could not pass the function being plotted to the module doing the work. Instead, I had to generate an array of 3D points in a particular order so that the grapher could build the desired polyhedron out of them. It is cumbersome, and it could, in principle, be automated. It also makes the grapher module leak abstraction. You need to be aware of its internal workings to plot what you want.</p><p>The issue of leaking abstractions became more visible when I started using OpenSCAD to model the enclosure for my <a href="https://jany.st/post/2021-03-17-building-a-nas-1-chassis--assembly.html">NAS project</a>.</p><p>Firstly, I wanted part of the enclosure holding the disks to be parametrized by the number of disks it could contain and their size. I also wanted the part of the enclosure holding the optical drive and the ARM board to be parametrized by the size of these components. Everything worked fine until I had to figure out how to connect these parts. I could not determine the locations of bolts and screws without knowing the internals of each of the modules, and there was no obvious way for the modules to expose the necessary information to the outside world. I ended up defining a bunch of helper functions that would compute this information when supplied with the same parameters as the modules they described. It quickly became cumbersome, though, and started to look pretty ugly.</p><p>Secondly, I needed to design the components separately to 3D print them later. But I also wanted to visualize the model as a whole to see if things fit together. That ended up being impossible without knowing the dimensions of the parametrized components, the arrangement of attachments (which were a non-trivial function of the module's input parameters), and the frame of reference in which each part was designed.</p><p>The last two issues fundamentally stem from the fact that, in OpenSCAD, the abstract syntax tree of the program you're writing represents the geometry tree of the model you are designing. Significant improvements can be made if you divorce the two. For example, doing so would allow the module objects to have properties that you could use for integration without exposing how these properties were calculated internally. It would also allow for writing programs that analyze or manipulate the geometry tree in interesting ways before it is rendered. Solving the first issue is just a matter of making functions first-class citizens, which would probably be an easy change to the OpenSCAD language.</p><p>I finally managed to find enough time to make good on the <a href="https://jany.st/post/2021-03-17-building-a-nas-1-chassis--assembly.html#465fcb48c22690b3">threats</a> I had made when I designed the chassis for my NAS and played with solving the issues mentioned above. I decided to use Go because it's a garbage-collected language with great tooling, and it compiles really fast. I designed a Java3D-like API that can be used to build the geometry tree of a model, which can then be compiled to OpenSCAD source and further processed by vanilla OpenSCAD. I used this system to design something of a non-trivial size that I needed - a small computer rack for all the electronic gadgets that accumulated under my TV table and evolved into a maze of wires, routers, and bare PCB boards.</p><p>I called the system <a href="https://github.com/ljanyst/ghostscad">GhostSCAD</a>, and the TV table rack project is <a href="https://github.com/ljanyst/tv-table-rack">here</a>. This article summarizes the results of this investigation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rWV9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rWV9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 424w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 848w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 1272w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rWV9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png" width="600" height="338" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/c068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:338,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:130135,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rWV9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 424w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 848w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 1272w, https://substackcdn.com/image/fetch/$s_!rWV9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc068748a-91c6-446e-acf5-7ecb6109be7a_600x338.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://jany.st/post/2022-04-04-ghostscad-marrying-openscad-and-golang.html#f2e697a86207d013">Read more</a>.</p>]]></content:encoded></item><item><title><![CDATA[Coming soon]]></title><description><![CDATA[This is RawPointers, a newsletter about Serious Fun with Computers.]]></description><link>https://news.rawpointers.io/p/coming-soon</link><guid isPermaLink="false">https://news.rawpointers.io/p/coming-soon</guid><dc:creator><![CDATA[Lukasz Janyst]]></dc:creator><pubDate>Tue, 05 Apr 2022 05:46:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Pkzp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F863c92ae-c96b-4d14-8721-a1b13bb0b8c1_512x512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>This is RawPointers</strong>, a newsletter about Serious Fun with Computers.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://news.rawpointers.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://news.rawpointers.io/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item></channel></rss>