<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><title>nsf.name</title><subtitle>The personal website of Nathaniel Flores.</subtitle><link>https://nsf.name/blog/</link><updated>2026-11-26T18:59:45Z</updated><author><name>Nathaniel Flores</name></author><entry><title>Cadabby: Content-Aware Mirroring</title><link href="https://nsf.name/blog/cadabby-content-aware-mirroring/"/><updated>2026-11-26T18:59:45Z</updated><summary>An attempt to do something useful with Rust in class.</summary><content type="html">&lt;blockquote&gt;&#10;&lt;p&gt;Note: this project is still in progress, I&amp;rsquo;ll update this when I finish it.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This semester I have been taking a class on filesystems, and for the final project I realized that it would be somewhat fun to think about file archiving. Some of this was driven by the fact that I&amp;rsquo;ve found &lt;a href="https://github.com/systemd/casync/"&gt;&lt;code&gt;casync&lt;/code&gt;&lt;/a&gt; useful, but also because I found myself downloading lots of data from &lt;a href="https://esgf.github.io/nodes.html"&gt;ESGF&lt;/a&gt; and, while waiting around for the slow downloads to finish, kept thinking of ways that I could make downloading hundreds of gigabytes of easily-compressible data simple and efficient.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/nsf-name/cadabby"&gt;&lt;code&gt;cadabby&lt;/code&gt;&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; is an attempt to do this, and something I plan to keep working on after this course is over. Its job is to make downloading big data from mirrors simpler: you should be able to request files over a network, get the minimum number of unique blocks of data in a compressed wire format, and then reconstruct the thing on your client, in parallel.&lt;/p&gt;&#10;&lt;h2 id="content-aware-chunking"&gt;Content-Aware Chunking&lt;/h2&gt;&#10;&lt;p&gt;Let&amp;rsquo;s start with the idea of content-awareness. We can abstractly think of a file as a big bag of &lt;code&gt;[&amp;amp;u8]&lt;/code&gt;. How do we tell which parts are likely going to repeat across files? Fortunately, many &lt;em&gt;content-defined chunking&lt;/em&gt; algorithms exist. I will use &lt;a href="https://www.usenix.org/conference/atc16/technical-sessions/presentation/xia"&gt;FastCDC&lt;/a&gt; because it is streaming, already &lt;a href="https://docs.rs/fastcdc/latest/fastcdc/"&gt;implemented in Rust&lt;/a&gt;, and isn&amp;rsquo;t nondetermistic like &lt;a href="https://dl.acm.org/doi/10.1145/3357223.3362731"&gt;RapidCDC&lt;/a&gt; or &lt;a href="https://ieeexplore.ieee.org/document/9644788"&gt;QuickCDC&lt;/a&gt;, which go even faster at the expense of skipping chunks, potentially missing data.&lt;/p&gt;&#10;&lt;p&gt;So now our &lt;code&gt;[&amp;amp;u8]&lt;/code&gt; is now defined in terms of many chunk offsets and lengths. When we repeat this over many files and take the hashes of these chunks, we should eventually see (ideally lots of) collisions where files share the same chunks. We then only need to store each unique chunk exactly one time, saving on space compared to the original files.&lt;/p&gt;&#10;&lt;p&gt;There are other benefits to this: chunks are small, so it&amp;rsquo;s easy to parallelize jobs like compressing and hashing them. Because of how content-defined chunking works, it&amp;rsquo;s likely that chunks will have some form of internal structure, making compression more efficient (provided we check the &lt;a href="https://en.wikipedia.org/wiki/Entropy_(information_theory)"&gt;Shannon entropy&lt;/a&gt; of the chunk first to see if it&amp;rsquo;s even compressible).&lt;/p&gt;&#10;&lt;h2 id="mirroring-content"&gt;Mirroring Content&lt;/h2&gt;&#10;&lt;p&gt;Right now, mirrors are one of the most ubiquitous yet inefficient services on the Internet. You go to a mirror, download some content over HTTP, which downloads every byte of the source file, usually wrapped in some archive format. This is fine for small files, but when you reach multi-gigabyte downloads, there&amp;rsquo;s often enough redundancy in what you&amp;rsquo;re downloading that standard &lt;code&gt;gzip&lt;/code&gt; or &lt;code&gt;xz&lt;/code&gt; is leaving substantial storage benefits on the table that could be gained with content-awareness. This is especially true of the types of highly-repetitive data that exists in stuff like climate datasets or LLM model weights&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;!&lt;/p&gt;&#10;&lt;p&gt;You might reasonably ask if &lt;code&gt;zstd&lt;/code&gt; or other newer compression algorithms solve this. They are definitely better in this regard&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;, but compression algorithms that are lossless always fail on at least some data and bloat the size of the thing they are compressing due to the &lt;a href="https://en.wikipedia.org/wiki/Lossless_compression"&gt;pigeonhole principle&lt;/a&gt;. Content-aware chunking and compression are &lt;em&gt;orthogonal&lt;/em&gt; axes of improvement: you can use chunks to make compression smarter, and compression works better with well-defined chunks.&lt;/p&gt;&#10;&lt;h2 id="cadabbys-design"&gt;&lt;code&gt;cadabby&lt;/code&gt;&amp;rsquo;s Design&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;cadabby&lt;/code&gt; takes an interesting approach to solve the problem. The rough flow of the application looks like this:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Walk the directory the user passed in and, using an index tree, build up a succinct in-memory representation of our file tree.&lt;/li&gt;&#10;&lt;li&gt;Then, filter this tree down to get all files in our tree.&lt;/li&gt;&#10;&lt;li&gt;Iterate through this list in parallel for each file:&#10;&lt;ul&gt;&#10;&lt;li&gt;Read the file linearly and use FastCDC to chunk the file.&lt;/li&gt;&#10;&lt;li&gt;Use &lt;code&gt;mmap()&lt;/code&gt; to load select parts of the file into memory and run BLAKE3 on chunks to compute hashes. This takes advantage of the fact that we likely already have parts of the file in warm cache, so this could potentially do no disk I/O, making this random seeking much cheaper.&lt;/li&gt;&#10;&lt;li&gt;Check the file extension, the file&amp;rsquo;s magic bytes, and then the Shannon entropy to determine if the file is likely to be incompressible or not.&lt;/li&gt;&#10;&lt;li&gt;Do a comparison against a global hash table of chunk hashes to determine which chunks are unique; we can delete anything which we know isn&amp;rsquo;t unique.&lt;/li&gt;&#10;&lt;li&gt;Compress all remaining chunk data, checking to see if space is saved; if it isn&amp;rsquo;t, throw away the compressed result and use the original data.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Finally, serialize out all the chunks to disk with our directory tree.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The idea is that our in-memory state is roughly the same as that which we&amp;rsquo;ll put on disk, which lets us use &lt;code&gt;serde&lt;/code&gt; to conveniently serialize out our data structures. This whole design is one of those things where I&amp;rsquo;ll only know if it&amp;rsquo;s more efficient once I&amp;rsquo;ve actually built the whole thing; if this doesn&amp;rsquo;t prove to be more efficient, I think the result will still be interesting regardless.&lt;/p&gt;&#10;&lt;p&gt;Of course, this is also only the design at present. The whole structure of &lt;code&gt;cadabby&lt;/code&gt; will make it easy to transition to letting users make partial requests for the tree over a network, since that&amp;rsquo;s just the same process except repeated over a subtree of our main tree. I plan to think more about the networking and daemon-chunk-serve part of this once the course is over, since that&amp;rsquo;s a bit out of scope at the moment.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;Named after the &lt;a href="https://en.wikipedia.org/wiki/Abby_Cadabby"&gt;Sesame Street character&lt;/a&gt;, because &lt;a href="https://www.kermitproject.org"&gt;&lt;code&gt;kermit&lt;/code&gt;&lt;/a&gt; exists, so it&amp;rsquo;s fitting.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;I suspect the real reason OpenAI agents &lt;a href="https://en.wikipedia.org/wiki/OpenAI_rogue_agent_breach_of_Hugging_Face#Targeting_of_Hugging_Face"&gt;broke into HuggingFace&lt;/a&gt; was so they could get a faster download of the model weights they wanted; even LLMs grow tired of how slow their CDN is.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:3"&gt;&#10;&lt;p&gt;There is an attempt to solve this at Meta called &lt;a href="https://openzl.org"&gt;OpenZL&lt;/a&gt; and it&amp;rsquo;s very cool, but requires writing custom-tooled compressors per data type. This is great when you&amp;rsquo;re Meta and can throw infinite engineers at writing exactly the ones you need, but for general-purpose usecases OpenZL is inferior to &lt;code&gt;zstd&lt;/code&gt;, which works with anything out of the box.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="rust"/></entry><entry><title>Eternal Two-Language Problem</title><link href="https://nsf.name/blog/eternal-two-language-problem/"/><updated>2026-11-26T18:42:14Z</updated><summary>Thoughts on the two-language problem and why no solution so far really works.</summary><content type="html">&lt;p&gt;For a long time it&amp;rsquo;s been well understood that there are essentially two types of languages one can use for scientific programming:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;Lower-level&lt;/em&gt; languages, where more direct attention is needed to the specifics of how the computation is done and speed is the reward (Fortran, C/C++, Rust)&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;Higher-level&lt;/em&gt; languages, where more direct attention can be spent on just doing your task at hand and implementation speed is the reward (Python, R, MATLAB)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Development speed is usually the top priority, so higher-level languages being slow isn&amp;rsquo;t necessarily a bad thing, but it really hurts when you need to scale up your operations. Thus the traditionally flawed approach is to try and take the lower-level languages, implement your slowest parts in them, and then bridge to the higher-level languages. This is usually insufficient, as often linking the two languages requires itself a substantial amount of programming skill (your average Python user will be unable to figure out how to use the C FFI), and even when you do, you&amp;rsquo;re often bound by the speed of the slower language anyways (like a global interpreter lock, garbage collection, etc).&lt;/p&gt;&#10;&lt;p&gt;In an attempt to overcome this problem there have been a few more approaches explored in recent years. I would like to explain why these tools are still fundamentally inadequate and why the problem resists any form of clean solution.&lt;/p&gt;&#10;&lt;h2 id="julias-leaky-abstractions"&gt;Julia&amp;rsquo;s Leaky Abstractions&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://julialang.org"&gt;Julia&lt;/a&gt; is an up-and-coming programming language that primarily focuses on making scientific programming both fast and expressive. I think Julia gets lots of things right, and even gave it a test drive for my own thesis as a potential implementation language, but there are still a lot of areas in which Julia is severely lacking; it is not a solution to the two-language problem now and never will be.&lt;/p&gt;&#10;&lt;p&gt;For example, to even know &lt;em&gt;why&lt;/em&gt; you should pick Julia over Python or R, you would need to know that its strength is that it uses &lt;a href="https://docs.julialang.org/en/v1/devdocs/llvm/"&gt;LLVM&lt;/a&gt; to compile the code efficiently into something native, and then run it. Most of the Julia ecosystem is tailored around its &lt;a href="https://juliagpu.org"&gt;GPU offloading&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;; you had better get an understanding of what it actually is that the GPU does well. Since Julia uses multiple (not dynamic) dispatch, you&amp;rsquo;d better get a good understanding of what distinguishes it from object-oriented or functional paradigms of programming to use it effectively. That&amp;rsquo;s a whole lot of computer science background knowledge many students and definitely quite a lot of scientists will &lt;em&gt;not&lt;/em&gt; know before going in!&lt;/p&gt;&#10;&lt;p&gt;The issue with Julia is that its abstractions are &lt;em&gt;leaky&lt;/em&gt;: they expose too many details for domain-focused scientists to use them without having to also be burdened with an enormous amount of computer science. Consider the relatively common Python case of wanting to return different types:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;def&lt;/span&gt; &lt;span style="color:#268bd2"&gt;process&lt;/span&gt;(x):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;return&lt;/span&gt; x &lt;span style="color:#719e07"&gt;*&lt;/span&gt; &lt;span style="color:#2aa198"&gt;2&lt;/span&gt; &lt;span style="color:#719e07"&gt;if&lt;/span&gt; x &lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#2aa198"&gt;0&lt;/span&gt; &lt;span style="color:#719e07"&gt;else&lt;/span&gt; &lt;span style="color:#2aa198"&gt;&amp;#34;zero&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#586e75"&gt;# Python doesn&amp;#39;t care about this type&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In Julia, you would write this code instead:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-julia" data-lang="julia"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;function&lt;/span&gt; process(x)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt; x &lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#2aa198"&gt;0&lt;/span&gt; &lt;span style="color:#719e07"&gt;?&lt;/span&gt; x &lt;span style="color:#719e07"&gt;*&lt;/span&gt; &lt;span style="color:#2aa198"&gt;2&lt;/span&gt; &lt;span style="color:#719e07"&gt;:&lt;/span&gt; &lt;span style="color:#2aa198"&gt;&amp;#34;zero&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;end&lt;/span&gt; &lt;span style="color:#586e75"&gt;# this always returns Union{Int64, String}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The difference between them is that Julia&amp;rsquo;s implementation will be much slower. Julia promises faster performance but only as long as you understand that the compiler &lt;em&gt;must&lt;/em&gt; get concrete return types otherwise performance falls off a cliff. No such cognitive barrier exists in other languages, and it&amp;rsquo;s deeply unintuitive to most non-programmers!&lt;/p&gt;&#10;&lt;p&gt;Here&amp;rsquo;s another common failure case of Julia: global variables. Even though this is typically bad practice, people use them all the time in notebooks and exploratory programming, making this a serious shortcoming. In Python you simply write:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;x &lt;span style="color:#719e07"&gt;=&lt;/span&gt; &lt;span style="color:#2aa198"&gt;5&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;def&lt;/span&gt; &lt;span style="color:#268bd2"&gt;foo&lt;/span&gt;(): &lt;span style="color:#719e07"&gt;return&lt;/span&gt; x &lt;span style="color:#719e07"&gt;+&lt;/span&gt; &lt;span style="color:#2aa198"&gt;1&lt;/span&gt; &lt;span style="color:#586e75"&gt;# fine&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However in Julia you write this and then experience mysterious slowdowns everywhere:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-julia" data-lang="julia"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;x &lt;span style="color:#719e07"&gt;=&lt;/span&gt; &lt;span style="color:#2aa198"&gt;5&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;foo() &lt;span style="color:#719e07"&gt;=&lt;/span&gt; x &lt;span style="color:#719e07"&gt;+&lt;/span&gt; &lt;span style="color:#2aa198"&gt;1&lt;/span&gt; &lt;span style="color:#586e75"&gt;# type-unstable and slow&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;const&lt;/span&gt; x &lt;span style="color:#719e07"&gt;=&lt;/span&gt; &lt;span style="color:#2aa198"&gt;5&lt;/span&gt; &lt;span style="color:#586e75"&gt;# now it&amp;#39;s fine but you have to know to do this&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since mutable globals are extremely useful, most people will simply eat the performance cost, making Julia effectively slower Python with worse libraries in some of the most common use-case for high-level languages in scientific programming without being a low-level language either (no language with garbage collection can be one, and Julia&amp;rsquo;s startup times are embarrassingly slow).&lt;/p&gt;&#10;&lt;h2 id="maturin-and-meeting-in-the-middle"&gt;&lt;code&gt;maturin&lt;/code&gt; and Meeting In The Middle&lt;/h2&gt;&#10;&lt;p&gt;The Julia approach of trying to &lt;em&gt;be&lt;/em&gt; a middle language between high-level and low-level is, in my opinion, fundamentally flawed. Non-programmers are forced to learn a bunch of computer science background to be effective in a language that&amp;rsquo;s going to force substantial amounts of relearning to be productive in again, and programmers suffer from the language not being low-level enough for their high-performance needs.&lt;/p&gt;&#10;&lt;p&gt;What about meeting &lt;em&gt;in&lt;/em&gt; the middle instead? I think the better solution is to just improve the ability for languages to meet in the middle. The high-level languages are that way because they&amp;rsquo;re serving an important purpose; the goal shouldn&amp;rsquo;t be to bolt on low-level features, or bolt on high-level features to a low-level language, but rather making it easier to use them together.&lt;/p&gt;&#10;&lt;p&gt;Enter &lt;a href="https://www.maturin.rs"&gt;&lt;code&gt;maturin&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/PyO3/pyo3"&gt;&lt;code&gt;pyo3&lt;/code&gt;&lt;/a&gt;, two projects that solve this issue (at least for Rust + Python). You simply write normal Rust, annotate it for Python, and it just works:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;use&lt;/span&gt; pyo3::prelude::&lt;span style="color:#719e07"&gt;*&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 2&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 3&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;#[pyfunction]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 4&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;fn&lt;/span&gt; &lt;span style="color:#268bd2"&gt;sum_squares_parallel&lt;/span&gt;(py: &lt;span style="color:#268bd2"&gt;Python&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#b58900"&gt;&amp;#39;_&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt;, arr: &lt;span style="color:#b58900"&gt;Vec&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#dc322f"&gt;f64&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt;) -&amp;gt; &lt;span style="color:#dc322f"&gt;f64&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 5&lt;/span&gt;&lt;span&gt; py.allow_threads(&lt;span style="color:#719e07"&gt;||&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 6&lt;/span&gt;&lt;span&gt; arr.par_iter().map(&lt;span style="color:#719e07"&gt;|&lt;/span&gt;x&lt;span style="color:#719e07"&gt;|&lt;/span&gt; x &lt;span style="color:#719e07"&gt;*&lt;/span&gt; x).sum() &lt;span style="color:#586e75"&gt;// rayon!&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 7&lt;/span&gt;&lt;span&gt; })&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 8&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 9&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;10&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;#[pymodule]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;11&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;fn&lt;/span&gt; &lt;span style="color:#268bd2"&gt;mylib&lt;/span&gt;(m: &lt;span style="color:#719e07"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#268bd2"&gt;Bound&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#b58900"&gt;&amp;#39;_&lt;/span&gt;, PyModule&lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt;) -&amp;gt; &lt;span style="color:#268bd2"&gt;PyResult&lt;/span&gt;&lt;span style="color:#719e07"&gt;&amp;lt;&lt;/span&gt;()&lt;span style="color:#719e07"&gt;&amp;gt;&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;12&lt;/span&gt;&lt;span&gt; m.add_function(&lt;span style="color:#268bd2"&gt;wrap_pyfunction!&lt;/span&gt;(sum_squares, m)&lt;span style="color:#719e07"&gt;?&lt;/span&gt;)&lt;span style="color:#719e07"&gt;?&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;13&lt;/span&gt;&lt;span&gt; &lt;span style="color:#b58900"&gt;Ok&lt;/span&gt;(())&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;14&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, in Python, it looks like any normal module and everything is beautiful:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;from&lt;/span&gt; somelib &lt;span style="color:#719e07"&gt;import&lt;/span&gt; sum_squares&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;sum_squares([&lt;span style="color:#2aa198"&gt;1.0&lt;/span&gt;, &lt;span style="color:#2aa198"&gt;2.0&lt;/span&gt;, &lt;span style="color:#2aa198"&gt;3.0&lt;/span&gt;]) &lt;span style="color:#586e75"&gt;# it just works&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The best part is that it&amp;rsquo;s pleasingly parallel because there&amp;rsquo;s no GIL, and this approach lets you immediately take advantage of two incredible library ecosystems. A Julia implementation might, in theory, be equivalent in speed, but the beauty of Python is that &lt;a href="https://numba.pydata.org/"&gt;&lt;code&gt;numba&lt;/code&gt;&lt;/a&gt; also exists:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;from&lt;/span&gt; numba &lt;span style="color:#719e07"&gt;import&lt;/span&gt; njit&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;import&lt;/span&gt; numpy &lt;span style="color:#719e07"&gt;as&lt;/span&gt; np&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;4&lt;/span&gt;&lt;span&gt;&lt;span style="color:#268bd2"&gt;@njit&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;5&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;def&lt;/span&gt; &lt;span style="color:#268bd2"&gt;sum_squares&lt;/span&gt;(arr):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;6&lt;/span&gt;&lt;span&gt; s &lt;span style="color:#719e07"&gt;=&lt;/span&gt; &lt;span style="color:#2aa198"&gt;0.0&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;7&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;for&lt;/span&gt; x &lt;span style="color:#719e07"&gt;in&lt;/span&gt; arr:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;8&lt;/span&gt;&lt;span&gt; s &lt;span style="color:#719e07"&gt;+=&lt;/span&gt; x &lt;span style="color:#719e07"&gt;*&lt;/span&gt; x&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;9&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;return&lt;/span&gt; s&#9;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you&amp;rsquo;ve got Julia native speed without needing to drop to it!&lt;/p&gt;&#10;&lt;p&gt;Again, all of this has come from a lot of coordinated effort on the Python side (performance improvements, immutable structures like &lt;code&gt;frozendict()&lt;/code&gt; and soon &lt;code&gt;frozenset()&lt;/code&gt; that can cross FFI easier, removing the GIL) and on the Rust side (creating really good libraries and build systems to automate linking pain). Nowadays you just pick the language that&amp;rsquo;s better at the domain you want, and none of them have to be some kludge between two things they&amp;rsquo;re not. Two different mindsets for two different languages lets each succeed at one thing and do it well.&lt;/p&gt;&#10;&lt;h2 id="intractability-of-the-problem"&gt;Intractability of the Problem&lt;/h2&gt;&#10;&lt;p&gt;What does the unreasonable effectiveness of the meet-in-the-middle approach teach us? It teaches us that the two-language problem has more to do with &lt;em&gt;semantics&lt;/em&gt; than with &lt;em&gt;implementation&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p&gt;You can&amp;rsquo;t specify low-level details in a high-level context without fundamentally making it less accessible to those without that background, and there&amp;rsquo;s no amount of sorcery that will make a high-level language fast regardless of what you&amp;rsquo;re doing in it. At some level, you have to understand how the computer really works to get performance. Julia is yet another attempt to do this in the same way that &lt;code&gt;numba&lt;/code&gt; and &lt;code&gt;numpy&lt;/code&gt; are, but suffers from the additional effect of imposing cognitive and performance burdens everywhere, in all code, all the time, whereas in Python it&amp;rsquo;s purely localized to FFI boundaries and specific, optimized blocks.&lt;/p&gt;&#10;&lt;p&gt;The only decent solution is to make the languages meet more in the middle rather than &lt;em&gt;becoming&lt;/em&gt; the middle. Julia tries to become the missing middle language and fails. Being able to seamlessly hand off from a high-level environment to something low-level for a brief period is more like most real workloads (where the high-level language is merely glue connecting a bunch of lower-level libraries), which is why Python and R being slow is negligible for most people in the first place.&lt;/p&gt;&#10;&lt;p&gt;Perhaps another, more viable approach is to make expressions which slow down performance fundamentally impossible to express, but even then adoption remains &lt;a href="/blog/the-awesome-language-paradox/"&gt;an uphill battle&lt;/a&gt;. Modern Fortran is headed in this direction and it shows a lot of promise, especially in the &lt;a href="https://lfortran.org"&gt;LFortran&lt;/a&gt; compiler, which makes Fortran interactive and GPU-friendly. Julia has a lot to learn from it.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;Admittedly I make fun of Julia a lot in this article but it is really good at this. &lt;a href="https://lwn.net/Articles/1095731/"&gt;Rust&lt;/a&gt; and &lt;a href="https://lfortran.org"&gt;Fortran&lt;/a&gt; are both catching up fast in this department, so Julia really is only winning by being first rather than being the best.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="essay"/><category term="programming"/></entry><entry><title>Senior Thesis: Part Two</title><link href="https://nsf.name/blog/senior-thesis-part-two/"/><updated>2026-11-02T14:05:36Z</updated><summary>The second part of my senior thesis on melt-freeze timing with Arctic sea ice.</summary><content type="html">&lt;blockquote&gt;&#10;&lt;p&gt;This article discusses the second part of my senior thesis, namely the work on simulation testing and writing some opening sections. It is part of a series of articles on my senior thesis; use the &amp;ldquo;thesis&amp;rdquo; tag to see all of them.&#10;This is a living document; once the thesis moves into the tracer phase, I will write another part.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;h2 id="simulator-verification"&gt;Simulator Verification&lt;/h2&gt;&#10;&lt;p&gt;After the last couple of months of hard work, the simulator now works! This is a huge step forwards, since now we have reliable tracking that provably works against the IABP dataset. However, with over 2,700 buoys, not all simulations will perfectly match even the cleaned real-world dataset, so further work is currently locked behind understanding the simulator&amp;rsquo;s failure modes.&lt;/p&gt;&#10;&lt;p&gt;So far, production runs of the simulator have the following outcomes:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Works perfectly (the simplest and fortunately most common case)&lt;/li&gt;&#10;&lt;li&gt;Data input issues:&#10;&lt;ul&gt;&#10;&lt;li&gt;IABP data outputs nonsensical GPS coordinates (need to improve cleaning process, since there&amp;rsquo;s often a valid path within the noise)&lt;/li&gt;&#10;&lt;li&gt;Polar Pathfinders has no data for a specific tile (in which case we cannot test against that buoy since we lack comparisons)&lt;/li&gt;&#10;&lt;li&gt;Buoy in real life moves too close to shore for Polar Pathfinders (we cannot ever get closer than 25km offshore due to data limits)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Simulator code issues:&#10;&lt;ul&gt;&#10;&lt;li&gt;Run is far too short (usually solved by switching from weekly to daily vector data)&lt;/li&gt;&#10;&lt;li&gt;Plotting fails to render (solved by increasing the error handling in the R plotter)&lt;/li&gt;&#10;&lt;li&gt;Incorrect out-of-season behavior (in development)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;I am still in the middle of manually reviewing all buoy model runs to see what the failure modes are for each, which is letting me catch some of the most difficult-to-find bugs within the simulator. Reviewing each run is needed to find ones that are beneficial for the thesis as benchmarks, even if there were no bugs; I want runs that span the whole melt-freeze season and play nice with the restrictions of the Polar Pathfinders dataset. Further work is also needed to write a cleaning method more sophisticated than the ones currently available in the literature, since review indicates that there are clearly useful buoys in there that are only non-viable for this benchmarking merely because of some extraneous GPS coordinates that haven&amp;rsquo;t been properly removed (but there are just too many to delete them manually).&lt;/p&gt;&#10;&lt;h2 id="continuous-integration"&gt;Continuous Integration&lt;/h2&gt;&#10;&lt;p&gt;Once we&amp;rsquo;re done verifying all the runs, how do we make sure the simulator continues to produce reasonable and physically accurate results? The best way to go about it is to steal from the software engineering world and write some &lt;em&gt;continuous integration&lt;/em&gt; code. What this means is that on every upload of new code to GitHub, the remote server will run the code and check to see if the behavior is what we expect the code to reliably do, and if it doesn&amp;rsquo;t match, warns about this discrepancy.&lt;/p&gt;&#10;&lt;p&gt;Given that this simulator must match the Polar Pathfinders dataset as closely as possible to enable doing useful science with it, and has a lot of complex behavior that could emerge by combining the various simulator options in different ways, I think writing tests is paramount to ensuring that no future code subtly breaks anything going forward. Currently this is happening with the &lt;a href="https://hypothesis.readthedocs.io/en/latest/"&gt;&lt;code&gt;hypothesis&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://coverage.readthedocs.io/en/latest/"&gt;&lt;code&gt;coverage.py&lt;/code&gt;&lt;/a&gt; Python libraries to help ensure coverage both over many possible bad inputs and code in the project; I would do this for the R code as well, but that is not complex enough to justify the hassle at the moment.&lt;/p&gt;&#10;&lt;p&gt;The other metric I am looking to add is an &amp;ldquo;error score&amp;rdquo;, which is essentially the distance between where the simulated buoy is and the actual buoy is (matched by closest timestamp). This score could then be calculated for each run; if it ever changes between code commits, there&amp;rsquo;s some level of nondeterminism. This is both more complex to write and more complex to test (since it requires running the whole sim all over again), but once it&amp;rsquo;s done, it should then be substantially harder to introduce mistakes by accident.&lt;/p&gt;&#10;&lt;h2 id="tracing-data"&gt;Tracing Data&lt;/h2&gt;&#10;&lt;p&gt;In the coming months, once the Introduction and Methods sections are written, I intend to start extending the model to trace data along the path, so that we can see climate variables from a buoy&amp;rsquo;s-eye-view, so to speak. This will enable actually addressing the question this thesis is all about, since running the tracers and starting from many locations and times all across the Arctic should yield more than enough data to find such a relationship, if it exists. At present, this is still quite a long ways away.&lt;/p&gt;&#10;</content><category term="programming"/><category term="python"/><category term="thesis"/></entry><entry><title>RSS Is Great, Actually</title><link href="https://nsf.name/blog/rss-is-great-actually/"/><updated>2026-11-26T18:42:14Z</updated><summary>Why RSS is still great even in the current year.</summary><content type="html">&lt;p&gt;Do you know about &lt;a href="https://en.wikipedia.org/wiki/RSS"&gt;RSS&lt;/a&gt;? If you don&amp;rsquo;t, you should give it a try! It&amp;rsquo;s a really simple web standard. When websites update their posted content, they similarly update their RSS feed (a small file containing a list of content that&amp;rsquo;s been posted to their site). Your RSS feed reader then polls this content and displays it to you, in chronological order. If it sounds a lot like social media, that&amp;rsquo;s because it &lt;em&gt;is&lt;/em&gt; like social media, except it works with basically just about everything and lets you collect feeds on content from all over the Internet into one place.&lt;/p&gt;&#10;&lt;h2 id="how-to-get-started"&gt;How to Get Started&lt;/h2&gt;&#10;&lt;p&gt;The first step is to download a RSS reader. Fortunately there are very many excellent readers for just about every platform in existence. On macOS/iOS there&amp;rsquo;s &lt;a href="https://netnewswire.com"&gt;NetNewsWire&lt;/a&gt;, on Linux there&amp;rsquo;s &lt;a href="https://newsboat.org"&gt;NewsBoat&lt;/a&gt;, on Android there&amp;rsquo;s &lt;a href="https://github.com/spacecowboy/Feeder"&gt;Feeder&lt;/a&gt;, and on Windows there&amp;rsquo;s &lt;a href="https://github.com/martinrotter/rssguard"&gt;RSSGuard&lt;/a&gt;. If you&amp;rsquo;re into self-hosting or have a spare server lying around, you can use &lt;a href="https://miniflux.app"&gt;Miniflux&lt;/a&gt; to make a web reader (which will then do all the hard work of polling links for you).&lt;/p&gt;&#10;&lt;p&gt;Once you&amp;rsquo;ve got one installed you&amp;rsquo;ll need to get some feeds. This part has become unfortunately less intuitive as time has gone on. You can always lazily try copy-pasting the URL of some website into your feed reader and seeing if it&amp;rsquo;ll work, but some popular sites require&#10;special workarounds:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;YouTube: Copy-pasting the channel&amp;rsquo;s URL works (not videos/playlists)&lt;/li&gt;&#10;&lt;li&gt;BlueSky: Copy-pasting the user&amp;rsquo;s profile URL works (posts won&amp;rsquo;t work)&lt;/li&gt;&#10;&lt;li&gt;Twitter: No solution that I know of :(&lt;/li&gt;&#10;&lt;li&gt;Reddit: You can get a free API key from &lt;a href="https://redlisten.com/docs#rss"&gt;this service&lt;/a&gt; and generate feeds&lt;/li&gt;&#10;&lt;li&gt;Twitch: You can get VOD notifications thanks to &lt;a href="https://twitchrss.appspot.com"&gt;this service&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;HackerNews: Provided via &lt;a href="https://hnrss.github.io"&gt;this service&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Basically every other site you will run into issues with has details on how to get its feed listed &lt;a href="https://gist.github.com/thefranke/63853a6f8c499dc97bc17838f6cedcc2"&gt;here&lt;/a&gt;. Even sites that don&amp;rsquo;t appear to have feeds usually do have them, they just take some searching to find; it&amp;rsquo;s incredibly common for website content frameworks to include RSS feed generation by default, so it&amp;rsquo;s rare that a site truly lacks one.&lt;/p&gt;&#10;&lt;p&gt;If you&amp;rsquo;re the academic sort, did you know that RSS feeds exist for all your favorite journals, too? You can even &lt;a href="https://guides.zsr.wfu.edu/zotero/feeds"&gt;use Zotero as an RSS reader&lt;/a&gt; to keep up to date with them as well!&lt;/p&gt;&#10;&lt;h2 id="scroll-no-more"&gt;Scroll No More&lt;/h2&gt;&#10;&lt;p&gt;I find RSS to be an infinitely more useful service than most social media. Personally I only still keep Instagram around since it contains (although these days increasingly fewer) posts by actual people I know in real life, making it the last social media site that functions in the way that they were originally designed to, which is as a convenient service for people to share content with their real-world friends/community.&lt;/p&gt;&#10;&lt;p&gt;RSS is great because it&amp;rsquo;s simple. There will never be some random predatory addictive anti-feature, no algorithm trying to force me to watch what it thinks I want to watch, and no random ads injected in the middle of the content. It&amp;rsquo;s easy to end up wasting countless hours going through some Twitter or TikTok feed to get a drip-feed of the stuff you presumably came for because the app is designed to keep you scrolling, while RSS sessions never drag on because there&amp;rsquo;s no infinite-scroll feed.&lt;/p&gt;&#10;&lt;p&gt;Much has been said about RSS dying since &lt;a href="https://en.wikipedia.org/wiki/Google_Reader"&gt;Google Reader&amp;rsquo;s death&lt;/a&gt; over a decade ago, but in practice I find that the vast majority of sites that have worthwhile content still support RSS. If anything, the sites that have been dropping RSS support (mostly just Reddit/Twitter/Instagram) are sites that are already so user-hostile and toxic that I can&amp;rsquo;t imagine willingly wanting to visit them.&lt;/p&gt;&#10;</content><category term="essay"/></entry><entry><title>Williams Record: Computation Op-Ed</title><link href="https://nsf.name/blog/williams-record-computation-op-ed/"/><updated>2026-10-10T13:35:48Z</updated><summary>Op-ed for the Williams Record arguing for a Computational Skills Requirement to graduate.</summary><content type="html">&lt;p&gt;There was an interesting period in the last academic year (2025-26) where nearly every Williams Record op-ed article focused almost nonstop on the developments regarding AI. I had attempted to throw my own hat into the ring for some time, but didn&amp;rsquo;t settle on a good article idea until after the semester ended.&lt;/p&gt;&#10;&lt;p&gt;I have substantially rewritten this article a few times; it was initially written on June 11th and I continued working on it intermittently roughly up until August 22nd; it was published in the September 23rd issue which is &lt;a href="https://williamsrecord.com/473210/opinions/centering-computation-in-the-colleges-curriculum/"&gt;available here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;For those of you who didn&amp;rsquo;t go to Williams: we have QFR (Quantitative Skills Requirement), WS (Writing Skills) and DPE (Difference, Power, and Equity) &lt;a href="https://catalog.williams.edu/degree-requirements/"&gt;requirements to graduate&lt;/a&gt;. This is my proposal to add yet another skill class to graduate. I deliberately kept the phrase &amp;ldquo;computation&amp;rdquo; vague because being more specific prevents the audience from pattern-matching it to whatever they think it should mean, which is exactly what I want.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="centering-computation"&gt;Centering Computation&lt;/h2&gt;&#10;&lt;p&gt;It’s common to enter Sawyer Library or Paresky and see a sea of laptops staring back at you. Despite our dependence on computers for much of our academic and professional work, how much time outside of computer science classes do we devote to actually understanding this technology?&lt;/p&gt;&#10;&lt;p&gt;I believe that centering engagement with computational skills in our curriculum would be extremely beneficial for students of all majors. “Computation” refers to the skilled creation and application of software towards solving problems. While some departments, including statistics, geosciences, and physics, are incorporating it into their curriculums, we should go a step further and create a computational skills requirement (call it the CSR) that would apply to all students.&lt;/p&gt;&#10;&lt;p&gt;I’m not advocating for everyone to be dragged, kicking and screaming, into CSCI 134, but I do believe that students should leave college understanding the computational tools of their profession. The existence of a CSR would challenge each department to think carefully about what the technological tools of the trade look like for their students, and design courses to help ensure their students leave the College prepared to use them in their careers. This could include courses in sound design and mixing for music majors or data mining and corpus analysis for history majors.&lt;/p&gt;&#10;&lt;p&gt;More fundamentally, the CSR would acknowledge how technology extends the mind. The core of a liberal arts education is training students to think; we must recognize that the limits of thinking are not the limits of our mind. The more students can control and understand the tech they use, the further they can take their ideas. The CSR would challenge students to grapple with the metacognitive challenges of modernity.&lt;/p&gt;&#10;&lt;p&gt;We are living in times where the most powerful and influential derive their strength from our collective ignorance about how exactly their technology works and what it does to us. If we do not train students to see what technology can do and how to control it, they will be powerless to stop it from being wielded against them.&lt;/p&gt;&#10;&lt;p&gt;The College has a unique opportunity to be the first liberal arts college in the country — and one of the first institutions in higher education ­— to give students greater knowledge and agency over the technology that governs modernity. Centering these powerful skills in everyone’s education through the implementation of a CSR is the first step in ensuring that computer science’s power remains democratized, which is, in turn, how we ensure society rules technology — and not vice versa.&lt;/p&gt;&#10;</content><category term="williams-record"/><category term="essay"/></entry><entry><title>Emacs, the Eternal Editor</title><link href="https://nsf.name/blog/emacs-the-eternal-editor/"/><updated>2026-10-10T13:21:46Z</updated><summary>Why Emacs is truly the Editor of a Lifetime.</summary><content type="html">&lt;p&gt;GNU Emacs is, in my opinion, the best text editor in existence&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, and will likely remain so potentially for as long as text editors are still being used. I don&amp;rsquo;t think it&amp;rsquo;s particularly useful to try and argue that &lt;em&gt;everyone&lt;/em&gt; should use Emacs; not everyone &lt;em&gt;should&lt;/em&gt; use Emacs (especially those new to programming). What I do want to do is dispel some common rumors about Emacs that I hear a lot in real life, because sometimes people dismiss Emacs based on entirely pre- or ill-conceived notions of what Emacs is capable of and designed for.&lt;/p&gt;&#10;&lt;h2 id="emacs-is-a-text-editor-thats-it"&gt;Emacs is a Text Editor (That&amp;rsquo;s It)&lt;/h2&gt;&#10;&lt;p&gt;Most programs are, philosophically speaking, the exact opposite of Emacs. In normal software, there&amp;rsquo;s a predefined limited number of operations you can do/extend. You might be able to compose them, but every extension language has fundamental limits to how much it can overhaul (you can&amp;rsquo;t, say, make Excel into a music player using just Visual Basic&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;). Emacs, instead, implements as much of itself as possible in Lisp so that you can overhaul and compose just about anything in it (and the C core that you can&amp;rsquo;t edit can still be extended with dynamic compiled modules). The environment is very introspective at its core; it&amp;rsquo;s Lisp all the way down.&lt;/p&gt;&#10;&lt;p&gt;Many people interpret this as Emacs effectively being a type of operating system&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;. While this is true in a sense that it abstracts hardware, this comparison is silly, because many of Emacs&amp;rsquo; primitives are about &lt;em&gt;text editing&lt;/em&gt;. It is a text editor with a text-based interface with Lisp and C primitives that are primarily useful for text editing.&lt;/p&gt;&#10;&lt;h2 id="emacs-is-compositional"&gt;Emacs is Compositional&lt;/h2&gt;&#10;&lt;p&gt;Because Emacs is all about text, improving the editing experience of any one of its core components pays off when using the rest of the editor since it&amp;rsquo;s all fundamentally just text interfaces, whereas in other programs those interfaces are separate.&lt;/p&gt;&#10;&lt;p&gt;Consider a package like &lt;a href="https://github.com/oantolin/orderless"&gt;&lt;code&gt;orderless&lt;/code&gt;&lt;/a&gt;, which implements a better search ordering for Emacs. It overrides the base-function called &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html"&gt;&lt;code&gt;completing-read&lt;/code&gt;&lt;/a&gt;, which means that you feel its benefits in nearly every single search interface within Emacs. Another favorite of mine is &lt;a href="https://github.com/eki3z/binky.el"&gt;&lt;code&gt;binky&lt;/code&gt;&lt;/a&gt;: you can create register-based bookmarks to cycle through buffers, and since everything in Emacs is a buffer, the more you do in it, the more &lt;code&gt;binky&lt;/code&gt; pays off. I can jump from coding to files locally, viewing remote directories with &lt;code&gt;tramp&lt;/code&gt; and &lt;code&gt;dired,&lt;/code&gt; to writing my commit with &lt;a href="https://magit.vc/"&gt;&lt;code&gt;magit&lt;/code&gt;&lt;/a&gt; and it&amp;rsquo;s all seamlessly handled through this same interface, without having to modify any of those packages.&lt;/p&gt;&#10;&lt;p&gt;All of Emacs feels like this and it&amp;rsquo;s really nice to see the Emacs team keeps adding better and better primitives for this. &lt;a href="https://tree-sitter.github.io/tree-sitter/"&gt;&lt;code&gt;tree-sitter&lt;/code&gt;&lt;/a&gt; is a recent &amp;amp; huge one: nowadays Emacs knows semantically where you are in the syntax tree of code, so it&amp;rsquo;s easy to have editing that works on the shape of code in the tree and is language-agnostic (see &lt;a href="https://github.com/mickeynp/combobulate"&gt;&lt;code&gt;combobulate&lt;/code&gt;&lt;/a&gt; for a really cool package that does this). The best part? Often the community moves &lt;em&gt;way&lt;/em&gt; faster than Emacs core, so if there&amp;rsquo;s a cool new feature in another editor, it will be in Emacs very soon, like LLM-coding with &lt;a href="https://gptel.org"&gt;&lt;code&gt;gptel&lt;/code&gt;&lt;/a&gt; or language-serve debugging with &lt;a href="https://github.com/svaante/dape"&gt;&lt;code&gt;dape&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="emacs-is-boring"&gt;Emacs is Boring&lt;/h2&gt;&#10;&lt;p&gt;One of the nice things about Emacs is that you can really make it exactly how you want, and no two people will end up with the exact same configuration file (you can find &lt;a href="https://github.com/nsf-name/emacs-config"&gt;my config on GitHub&lt;/a&gt;). I find this to be quite nice because while Emacs does have an interface that&amp;rsquo;s initially very hard to get used to, you can adjust just about any part of it until it&amp;rsquo;s just to your liking, at which point it will remain that way until you change it.&lt;/p&gt;&#10;&lt;p&gt;Mainline Emacs updates, in my experience, almost never break anything (if it happens to you, you can always roll back your version alongside your packages with something like &lt;a href="https://radian-software.github.io/straight.el/"&gt;&lt;code&gt;straight.el&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://github.com/progfolio/elpaca"&gt;&lt;code&gt;elpaca&lt;/code&gt;&lt;/a&gt;) and are usually skippable if you&amp;rsquo;re in a hurry. They usually only add features, which you&amp;rsquo;re never forced to use. As a result, I feel like Emacs is the only major piece of software where I&amp;rsquo;m &lt;em&gt;excited&lt;/em&gt; to see updates, rather than dreading them. Emacs is very boring, and that&amp;rsquo;s great!&lt;/p&gt;&#10;&lt;h2 id="editor-of-a-lifetime"&gt;Editor of a Lifetime&lt;/h2&gt;&#10;&lt;p&gt;From time to time someone tells me about some supposedly &amp;ldquo;superior&amp;rdquo; editor. I&amp;rsquo;m always willing to try them out, but nothing ever works quite like Emacs does. Because of its intelligent, compositionally-focused design, I can rely on Emacs to always be able to extend itself to handle whatever my workflow demands, and its excellent community means that the work I have to do is usually as short as one &lt;code&gt;use-package&lt;/code&gt; call away.&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s a really great tool and one that I would recommend if you spend substantial amounts of time doing text-based work!&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;Unless they ever release a multithreaded rewrite into a more modern Lisp, in which case I might reconsider. Clojure or Common Lisp flavored Emacs would be amazing.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;You probably could do this in Excel actually, and since Office 2024 you can even do it &lt;a href="https://support.microsoft.com/en-us/excel/functions/lambda-function"&gt;quite ergonomically&lt;/a&gt;, but let&amp;rsquo;s pretend Microsoft didn&amp;rsquo;t allow such horrors.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:3"&gt;&#10;&lt;p&gt;Emacs can&amp;rsquo;t be an OS since it&amp;rsquo;s not a kernel but with some effort you can &lt;a href="http://informatimago.free.fr/i/linux/emacs-on-user-mode-linux.html"&gt;get pretty close&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="essay"/><category term="programming"/></entry><entry><title>ZSA Moonlander Recommendation</title><link href="https://nsf.name/blog/zsa-moonlander-recommendation/"/><updated>2026-09-10T13:46:15Z</updated><summary>My (largely positive) experience with the ZSA Moonlander keyboard.</summary><content type="html">&lt;p&gt;Relatively recently, I started learning more about keyboards, specifically ergonomic-mechanical keyboards, and decided to splurge on a rather expensive&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; one: the &lt;a href="https://www.zsa.io/moonlander"&gt;ZSA Moonlander&lt;/a&gt;. I will waste no time with explaining the largely uninteresting reasons that I looked into and recommend you try out an ergo-mech keyboard, and will instead simply say: if your hands hurt while typing fast and you do so for many hours at a time, you should really consider one, it&amp;rsquo;ll make your life a lot nicer.&lt;/p&gt;&#10;&lt;p&gt;Now, there are many keyboards in this category, which all promise similar things with regards to the ergonomic benefits. I am fortunate to have had the very excellent &lt;a href="https://www.cs.williams.edu/~jannen/index.html"&gt;Professor Bill&lt;/a&gt; as one of my professors in college, who has successfully evangelized me about these keyboards; thanks to him, I was able to try out two keyboards: the Kinesis Advantage2&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; and a very ancient custom-build of the &lt;a href="https://ergodox-ez.com/"&gt;ZSA Ergodox EZ&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="the-first-two-keyboards"&gt;The First Two Keyboards&lt;/h2&gt;&#10;&lt;p&gt;I no longer have the Kinesis Advantage2 for a photo, so here&amp;rsquo;s the two ZSA boards:&lt;/p&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/zsa-keyboards_hu_522b6e9ebc0e0fc7.webp" type="image/webp"&gt;&#10; &lt;img src="/images/zsa-keyboards.png"&#10; alt="ZSA Moonlander and ZSA Ergodox EZ"&#10; width="4032"&#10; height="2426"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;&lt;em&gt;Pictured: the Moonlander, with the Ergodox EZ sitting between its halves&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;It took a very long time to get used to typing on both; surprisingly, I think moving from staggered -&amp;gt; ortholinear (that means the keys are in straight columns) was harder for me than Qwerty -&amp;gt; Colemak, but very worth it in terms of comfort. To make a boring story short, I eventually came to prefer the Ergodox EZ over the Advantage2 for the following reasons:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Overall sturdier build: not made out of a weird, plastic hardshell&lt;/li&gt;&#10;&lt;li&gt;It&amp;rsquo;s a split board: I found the Advantage2 to not be wide enough for me&lt;/li&gt;&#10;&lt;li&gt;Much quieter: the Advantage2 is very loud to type on (probably because I bottom out keys when I type, which resonates the whole shell)&lt;/li&gt;&#10;&lt;li&gt;Easier to transport: I can&amp;rsquo;t fit the Advantage2 into a backpack&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;However, I was disappointed largely with the remapping, sound, switches, and the thumb placement. Reaching the thumb positions was uncomfortable (my hands are too small for them), I could still hear &lt;em&gt;clack, clack, clack&lt;/em&gt; on Zoom call recordings I was on, the switches were the same smooth plastic that sucks on stock MacBook keyboards, and I couldn&amp;rsquo;t remap the keys to a hardware Colemak layout (invaluable with Windows machines or devices where you can&amp;rsquo;t switch to it in software). It also wasn&amp;rsquo;t backlit, which isn&amp;rsquo;t a huge deal given I almost never look at keys while typing but it feels like the bare minimum for any &amp;ldquo;serious&amp;rdquo; keyboard.&lt;/p&gt;&#10;&lt;h2 id="the-zsa-moonlander"&gt;The ZSA Moonlander&lt;/h2&gt;&#10;&lt;p&gt;I eventually decided that if I wanted to seriously resolve my issues with the Ergodox EZ, I would need to switch to something less frustrating. Since the Ergodox EZ was already quite along the way to being what I was ultimately looking for, I decided to spring for the Moonlander (especially after I read some &lt;a href="https://xeiaso.net/blog/zsa-moonlander-first-impressions-2020-10-27/"&gt;other glowing reviews&lt;/a&gt; about it), which is basically its successor.&lt;/p&gt;&#10;&lt;p&gt;The Moonlander has resolved nearly every issue I&amp;rsquo;ve had with the other board. I got mine with Cherry Quiet Reds and it&amp;rsquo;s extremely quiet, even when bottoming out; the only noise you can hear is the very quiet &lt;em&gt;click&lt;/em&gt; of the keyframe against the board surface. (It&amp;rsquo;s possible to change the switches, so someday I might even spring for some quieter ones or put rubber rings on the stock ones.) It&amp;rsquo;s got excellent remapping support, the thumbs are way closer and can be angled if they&amp;rsquo;re still not comfortable, the backlight is bright and has endless customization options, and the keycaps feel really good to type on. It even comes with all the cables you need plus a travel carry case!&lt;/p&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/zsa-layout_hu_514b7ef5c3e2e922.webp" type="image/webp"&gt;&#10; &lt;img src="/images/zsa-layout.png"&#10; alt="ZSA Moonlander Layout"&#10; width="1012"&#10; height="740"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;&lt;em&gt;Pictured: my Layer 0 layout for the Moonlander (Soft-Colemak version)&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;More deserves to be said about the remapping since it&amp;rsquo;s really good. You can customize almost every aspect of the board&amp;rsquo;s firmware from the GUI, which saves you from ever learning &lt;a href="https://qmk.fm"&gt;QMK&lt;/a&gt;. I have been completely able to ditch &lt;a href="https://karabiner-elements.pqrs.org"&gt;Karabiner Elements&lt;/a&gt; since this keyboard can do everything it&amp;rsquo;s capable of, but in hardware, which is magical. I use a layout kind of inspired by &lt;a href="https://dreymar.colemak.org/layers-extend.html"&gt;DreymaR&amp;rsquo;s &amp;ldquo;Extend&amp;rdquo;&lt;/a&gt;; their website is a really valuable source of general keyboard wisdom I recommend (you should consider using Extend if you don&amp;rsquo;t already!). For RGB-theming maniacs, you can even change the colors, but I&amp;rsquo;ve personally got no interest as the stock lighting themes are already good.&lt;/p&gt;&#10;&lt;p&gt;My only gripes with the board are that the number keys don&amp;rsquo;t have sub-labels on them for what symbol they make when &lt;code&gt;Shift&lt;/code&gt;-ed, and that the little rubber feet for tenting often don&amp;rsquo;t work super well (to raise the board, I often end up propping up the board with a book), but they sell a mounting kit which addresses the latter of my two complaints and the former is very minor given that you shouldn&amp;rsquo;t look while typing (plus, for other non-English languages the symbols vary a lot).&lt;/p&gt;&#10;&lt;h2 id="recommend"&gt;Recommend?&lt;/h2&gt;&#10;&lt;p&gt;For most people? No. The vast majority of people have no problems with a stock laptop keyboard or the basic Apple Magic board. I don&amp;rsquo;t think they would use enough of the Moonlander&amp;rsquo;s functionality or be able to stand the retraining period long enough to not grow insanely frustrated with the board.&lt;/p&gt;&#10;&lt;p&gt;For anyone doing lots of computer work (typing)? Absolutely yes. It&amp;rsquo;s a great, incredibly durable, highly customizable board. Even if you change nothing about it from stock, it&amp;rsquo;s still a better keyboard out of the box than basically anything else in its price range. While it&amp;rsquo;s an expensive price to many I would say that the cost of carpal tunnel treatment plus the convenience hardware-Extend provides me is well worth the money, especially when you consider how many years this keyboard will last before needing repairs.&lt;/p&gt;&#10;&lt;p&gt;Also, their customer support is top-notch. They shipped it from Taipei to Denver in a little under four days which is absurdly fast, and then helped with a bunch of questions I had about getting &lt;code&gt;SysRq&lt;/code&gt; to work on Linux embedded hardware. It&amp;rsquo;s refreshing to see a support team staffed by people who actually know what their audience is.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;There are some much more expensive options in this category, including the &lt;a href="https://svalboard.com"&gt;Svalboard&lt;/a&gt;, and with custom mods you could easily end up spending thousands of dollars on a board, but you almost certainly shouldn&amp;rsquo;t unless this stuff is your hobby.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;They aren&amp;rsquo;t available after December of 2026, but the &lt;a href="https://kinesis-ergo.com/keyboards/advantage360/"&gt;Kinesis Advantage360&lt;/a&gt; is functionally the same thing. Alternatively, buy one used.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="essay"/></entry><entry><title>We Need A Public NTS Pool</title><link href="https://nsf.name/blog/we-need-a-public-nts-pool/"/><updated>2026-08-20T13:12:18Z</updated><summary>The case for a global NTS pool and why time is important for security.</summary><content type="html">&lt;p&gt;The Internet&amp;rsquo;s security model hinges on time synchronization as a fundamental security primitive. Since 1985, &lt;a href="https://en.wikipedia.org/wiki/Network_Time_Protocol"&gt;NTP&lt;/a&gt; has delivered time updates to nearly every computer, and it is usually served via a NTP pool, which is a group of computers that load-balance NTP requests.&lt;/p&gt;&#10;&lt;p&gt;However, it is high time that we switched this over to &lt;a href="https://datatracker.ietf.org/doc/html/rfc8915"&gt;NTS&lt;/a&gt;, a new and secure time protocol that will make the synchronization of servers safe and private. It will also fix some NTP-specific vulnerabilities that are currently limiting the potential growth of NTP pools.&lt;/p&gt;&#10;&lt;h2 id="ntp-amplification-attacks"&gt;NTP Amplification Attacks&lt;/h2&gt;&#10;&lt;p&gt;NTP runs is built on top of UDP, which is inherently stateless, so attempts to reply are best-effort without guarantees of delivery. When NTP servers get a request, it replies to whatever IP the packet says to use, and since it&amp;rsquo;s possible to spoof IP addresses it&amp;rsquo;s trivial for an attacker to use faked IP addresses to send an enormous volume of NTP packets to the victim&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. With a distributed pool of computers, this composes a simple and effective DDoS attack (against UDP targets, but that includes a lot of things).&lt;/p&gt;&#10;&lt;p&gt;Preventing these attacks isn&amp;rsquo;t something that can be done with NTP as-is; it is a fundamental weakness of NTP being based on UDP and being unencrypted. Some of this can be fixed at the network level by having networks implement &lt;a href="https://datatracker.ietf.org/doc/html/rfc2827.html"&gt;BCP38&lt;/a&gt;, which requires that networks drops spoofed packets at edge routers, but in order for it to be effective it must be implemented by every network on the Internet, which is obviously not viable in the short-term (and given the slow adoption of relatively easy-to-deploy and important technologies like IPv6, suggests that this could take much longer to implement than it should).&lt;/p&gt;&#10;&lt;p&gt;These weaknesses mean that even those running modern, secure implementations of NTP behind something like the global &lt;a href="https://www.ntppool.org/en/"&gt;NTP Pool&lt;/a&gt; can unwittingly become part of mass DDoS attacks or portscans of servers unless they are behind BCP38-protected networks (and only get traffic from such networks).&lt;/p&gt;&#10;&lt;p&gt;Don&amp;rsquo;t just take my word for it. This actually happened to one of my servers that was in the NTP pool, which forced me to remove it from the pool entirely:&lt;/p&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/hetzner-badnews_hu_32bf9c3c496c96d.webp" type="image/webp"&gt;&#10; &lt;img src="/images/hetzner-badnews.png"&#10; alt="Hetzner Abuse Report"&#10; width="1491"&#10; height="510"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;&lt;em&gt;Pictured: Aftermath of a NTP amplification attack (the worst news to wake up to)&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;The abuse log report also wasn&amp;rsquo;t helpful, since it was consistent of nothing but forged destination IP addresses, hiding the attacker&amp;rsquo;s true IP address from the logs:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;#############################################################################&#10;# Portscan detected from host 0.0.0.0 #&#10;#############################################################################&#10;&#10;TIME (UTC) SRC SRC-PORT -&amp;gt; DST DST-PORT SIZE PROT&#10;---------------------------------------------------------------------------&#10;2026-07-07 04:11:43 0.0.0.0.0 123 -&amp;gt; 1.1.1.1 49817 90 UDP&#10;2026-07-07 04:10:47 0.0.0.0.0 123 -&amp;gt; 1.1.1.1 50470 90 UDP&#10;2026-07-07 04:11:40 0.0.0.0.0 123 -&amp;gt; 1.1.1.1 55686 90 UDP&#10;2026-07-07 04:11:02 0.0.0.0.0 123 -&amp;gt; 1.1.1.1 62303 90 UDP&#10;2026-07-07 04:10:58 0.0.0.0.0 123 -&amp;gt; 1.1.1.1 63821 90 UDP&#10;2026-07-07 04:11:24 0.0.0.0.0 123 -&amp;gt; 2.2.2.2 4097 90 UDP&#10;2026-07-07 04:11:10 0.0.0.0.0 123 -&amp;gt; 3.3.3.3 54235 90 UDP&#10;2026-07-07 04:11:12 0.0.0.0.0 123 -&amp;gt; 4.4.4.4 43671 90 UDP&#10;2026-07-07 04:11:37 0.0.0.0.0 123 -&amp;gt; 5.5.5.5 38838 90 UDP&#10;2026-07-07 04:11:51 0.0.0.0.0 123 -&amp;gt; 6.6.6.6 48670 90 UDP&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;(Note that these IPs have been redacted for privacy.)&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, about another 100 requests followed after this before the automatic global rate-limit on the NTP port I had in my &lt;code&gt;nftables&lt;/code&gt; configuration kicked in. Had this attacker been more persistent or more intelligent, it could have turned out a lot worse.&lt;/p&gt;&#10;&lt;p&gt;Rate-limiting for security usually decreases your &amp;ldquo;pool score&amp;rdquo;, or the odds that the pool selects your server for answering requests. These fundamental protocol-level flaws mean that unless you&amp;rsquo;re only getting requests from servers on networks where BCP38 is implemented (which is, admittedly, an increasingly large fraction of the Internet, but not everyone), then you won&amp;rsquo;t be able to maximize sharing to the global pool without potentially becoming a victim to one of these fundamentally unpreventable attacks.&lt;/p&gt;&#10;&lt;h2 id="ntp-is-insecure"&gt;NTP Is Insecure&lt;/h2&gt;&#10;&lt;p&gt;NTP is fundamentally insecure as it lacks encryption. It&amp;rsquo;s one of the last big Internet protocols (like DNS) that is purely plaintext, meaning that adversaries over the wire can see your time synchronization requests.&lt;/p&gt;&#10;&lt;p&gt;While this isn&amp;rsquo;t a problem for the vast majority of people, those facing extreme threats from highly-motivated adversaries could have their connection broken by getting false time information from upstream. This is a &lt;em&gt;lot&lt;/em&gt; more attack surface than you might think, and it only takes a few minutes of clock skew to break many forms of web security:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;TOTP breaks (2FA with time-based codes)&lt;/li&gt;&#10;&lt;li&gt;TLS certificate timing can be exploited&lt;/li&gt;&#10;&lt;li&gt;HSTS expires (downgrade site visits to HTTP)&lt;/li&gt;&#10;&lt;li&gt;JWT expiration (login tokens fail)&lt;/li&gt;&#10;&lt;li&gt;CAA record expiration (break TLS certificates)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In short, even if we deployed BCP38 everywhere, unencrypted time is deeply dangerous as an attacker could use our system clock to trivially break many forms of security. Accurate time is an underlying assumption of modern computer security in far more ways than people realize!&lt;/p&gt;&#10;&lt;h2 id="lets-pool--use-nts"&gt;Let&amp;rsquo;s Pool &amp;amp; Use NTS!&lt;/h2&gt;&#10;&lt;p&gt;Solving these problems is easy: let&amp;rsquo;s all switch to NTS and make a big&#10;NTS pool! NTS solves basically all of these problems out of the box: you can&amp;rsquo;t have amplification attacks since TLS is stateful (so no forging addresses)&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;, you can&amp;rsquo;t have adversaries tamper with time, and it&amp;rsquo;s based on two proven technologies (it&amp;rsquo;s just NTP wrapped in TLS).&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, there are some big roadblocks to NTS pooling and mass-adoption of NTS over NTP at the moment, although most are getting better:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Older systems can&amp;rsquo;t learn to use NTS, and NTS is reliant on TLS to function, which not all systems may be able to handle. Modern time servers, like &lt;a href="https://github.com/pendulum-project/ntpd-rs"&gt;ntpd-rs&lt;/a&gt; and &lt;a href="https://chrony-project.org/"&gt;chronyd&lt;/a&gt;, fortunately have a dual-stack mode where both NTP and NTS can be served, so NTS can be used over the Internet with NTP on internal networks only.&lt;/li&gt;&#10;&lt;li&gt;There&amp;rsquo;s no way to use NTS for time synchronization on consumer OSes as of the moment; Linux is the best for this at the moment. macOS, Windows, Android, iOS, and even the BSDs lack native support as of the moment, although this is largely because NTS is still in the &lt;a href="https://datatracker.ietf.org/doc/rfc8915/"&gt;IETF&amp;rsquo;s &amp;ldquo;Proposed Standard&amp;rdquo; phase&lt;/a&gt;. Third-party implementations of NTS-capable daemons now exist for &lt;a href="https://nts.softros.com"&gt;Windows Server&lt;/a&gt;, and BSDs &amp;amp; macOS can use the Linux daemons, but more native versions need to be implemented for NTS to be widely adopted.&lt;/li&gt;&#10;&lt;li&gt;NTS pooling is extremely new, because only &lt;a href="https://trifectatech.org/blog/enabling-pools-in-nts/"&gt;Trifecta Tech Foundation&lt;/a&gt; is working on it. That said, they have gotten an &lt;a href="https://experimental.ntspooltest.org"&gt;experimental test pool&lt;/a&gt; up and running, along with the more stable &lt;a href="https://sectime.org"&gt;Sectime pool&lt;/a&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Many private NTS servers exist in the wild since the NTS standard was released in 2020, with &lt;code&gt;time.cloudflare.com&lt;/code&gt; being one of the largest providers to offer it.&lt;/p&gt;&#10;&lt;p&gt;We need a public NTS pool because time is the bedrock of computer security, and without NTS, there&amp;rsquo;s no truly safe way for servers and clients to share it. Hopefully, the NTS pool will grow so large that time can finally be done securely just about everywhere!&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;More information can be found on &lt;a href="https://www.cloudflare.com/learning/ddos/ntp-amplification-ddos-attack/"&gt;Cloudflare&amp;rsquo;s website&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;NTS drops to UDP for the actual time exchange, but you need to connect over TCP to exchange TLS handshakes to encrypt the UDP packets, so it&amp;rsquo;s effectively forge-free even on UDP, which is really cool. Best of both worlds!&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="essay"/></entry><entry><title>Senior Thesis: Part One</title><link href="https://nsf.name/blog/senior-thesis-part-one/"/><updated>2026-11-02T14:05:36Z</updated><summary>The first part of my senior thesis on melt-freeze timing with Arctic sea ice.</summary><content type="html">&lt;blockquote&gt;&#10;&lt;p&gt;This article discusses the first part of my senior thesis, namely the earliest of developments during my summer on-campus at Williams working on it. The second part of my thesis can be &lt;a href="/blog/senior-thesis-part-two/"&gt;found here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I&amp;rsquo;ve tried to write this as a mostly-plain language introduction to the problem that my senior thesis is trying to solve (both for myself to keep my eyes on the higher-level goals at hand and for those unfamiliar with this area of research). For a more technical explanation, stay tuned for the inevitable final paper, which you will find along with simulator code &lt;a href="https://github.com/nsf-name/senior-thesis"&gt;at this page&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="the-melt-freeze-problem"&gt;The Melt-Freeze Problem&lt;/h2&gt;&#10;&lt;p&gt;Warming global climate will lead to a warming Arctic, which will result in longer ice-free summers. This will have negative effects on the yearly sea ice cycle: higher summer ocean temperatures will result in delayed freeze-up, which will result in shorter winter ice growth, which leads to thinner sea ice in the spring, completing the loop. Existing work has found a strong correlation between the dates of melt-out to freeze-up, which suggests this cycle is correct, but the link between freeze-up dates to melt-out is not as well understood&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. The extent to which this feedback impacts future ice formation and the spatial patterns of drifting ice along this cycle will ultimately determine the impacts of climate change on Arctic sea ice loss.&lt;/p&gt;&#10;&lt;p&gt;Our lab&amp;rsquo;s previous work on this research investigated the specific timing in dates over general areas. I seek to extend this research in my thesis by looking at how sea ice moves, so we can look into the spatial trends relating freeze-up and melt-out dates to see how those are related. It would also be nice to have a general Lagrangian buoy simulator program for sea-ice related work; once that is done, we can track any number of variables with realistic movement (based off of existing sea ice reanalysis vector movement data).&lt;/p&gt;&#10;&lt;h2 id="current-work"&gt;Current Work&lt;/h2&gt;&#10;&lt;p&gt;I am currently building the aforementioned simulator from scratch, following some failed attempts to modify &lt;a href="https://github.com/CICE-Consortium/CICE"&gt;CICE&lt;/a&gt;&amp;rsquo;s motion logic to fit the task. So far, it has the following features:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;BuoyTrajectory&lt;/code&gt; (IABP data) is implemented&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;IceTrajectory&lt;/code&gt; (sea ice motion vectors) is implemented&lt;/li&gt;&#10;&lt;li&gt;Reasonably fast parallel simulator runner&lt;/li&gt;&#10;&lt;li&gt;Arbitrary simulation date range and tick length&lt;/li&gt;&#10;&lt;li&gt;Object-oriented design makes swapping parts easy&lt;/li&gt;&#10;&lt;li&gt;Export to CSV, JSON, and eventually GeoJSON&lt;/li&gt;&#10;&lt;li&gt;Quality running, logging, and debugging experience with a good CLI&lt;/li&gt;&#10;&lt;li&gt;Relatively low memory overhead per simulation&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;It is still missing the following features:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Re-implementation of the core loops into a faster language (Fortran or Rust)&lt;/li&gt;&#10;&lt;li&gt;Data collection of arbitrary climate variables (tracers)&lt;/li&gt;&#10;&lt;li&gt;End-to-end testing of scientifically important components for accuracy&lt;/li&gt;&#10;&lt;li&gt;Property-based testing of some components to ensure invariants hold&lt;/li&gt;&#10;&lt;li&gt;Better plotting system with Python-to-R FFI&lt;/li&gt;&#10;&lt;li&gt;MATLAB FFI interface (for MATLAB users)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The current goal of development is to create a simulator where it should be possible to examine the melt-freeze question in a Monte Carlo-esque way, by creating buoys in freeze locations and observing their final state at freeze-time. At present, I am still quite a ways off from this, but good progress is being made almost daily during the summer research period.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;I have yet to finalize my literature review, and likely will not do so for some time, so this statement may be somewhat inaccurate.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="python"/><category term="thesis"/></entry><entry><title>The Awesome Language Paradox</title><link href="https://nsf.name/blog/the-awesome-language-paradox/"/><updated>2026-08-20T13:12:18Z</updated><summary>An attempt to explain why some great languages become mainstream, and why successful languages are some of the most hated. Also a rebuttal to Paul Graham's Blub essay.</summary><content type="html">&lt;blockquote&gt;&#10;&lt;p&gt;Language designers want to design the perfect language. They want to be able to say, &amp;ldquo;My language is perfect. It can do everything.&amp;rdquo; But it&amp;rsquo;s just plain impossible to design a perfect language, because there are two ways to look at a language. One way is by looking at what can be done with that language. The other is by looking at how we feel using that language—how we feel while programming. &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#10;&lt;p&gt;&amp;ndash; Yukihiro Matsumoto&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Say for the sake of argument you&amp;rsquo;re a programming language designer. Some time ago, you thought about the programming language landscape and realized how bad &amp;amp; ugly the big languages are, and set out to make a new one. Then, after years of hard work, your new programming language is finally done and ready for real-world use!&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s a well designed language: expressive, powerful, pragmatic, tooling you&amp;rsquo;re happy with, and it has a fast reference implementation, so you name it &lt;code&gt;awesome-lang&lt;/code&gt; to reflect its awesomeness. Most importantly, you have a clear vision for where the project should go so you can prevent your language from being a bloated mess. You&amp;rsquo;re certain that as soon as the world learns of your language, surely everyone will embrace &lt;code&gt;awesome-lang&lt;/code&gt; for exactly what you designed it for (world conquest!).&lt;/p&gt;&#10;&lt;p&gt;You might be surprised to hear, then, that &lt;code&gt;awesome-lang&lt;/code&gt; will almost certainly never go on to conquer the world, that it is almost guaranteed to fail to usurp whatever language you were clamoring to take down, and that it will likely die in relative obscurity.&lt;/p&gt;&#10;&lt;p&gt;Why is this? It&amp;rsquo;s because in order for a programming language to be successful, it first must defeat the &lt;em&gt;Awesome Paradox&lt;/em&gt;.&lt;/p&gt;&#10;&lt;h2 id="formally-defined-awesome-paradox"&gt;Formally Defined Awesome Paradox&lt;/h2&gt;&#10;&lt;p&gt;The &lt;em&gt;Awesome Paradox&lt;/em&gt; is my attempt to define a set of properties that must be true about a new language in order to define it as &amp;ldquo;successful&amp;rdquo;. They are as follows:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Requirement 1&lt;/strong&gt;: You need people to learn your language:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;1A&lt;/strong&gt;: It should be reasonably easy to learn without any weird syntax or complex new theoretical topics, or it should pass &lt;strong&gt;1B&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;1B&lt;/strong&gt;: It should be forced upon people by a corporation/standards body, or it should overwhelmingly pass &lt;strong&gt;2B&lt;/strong&gt; so it&amp;rsquo;s the obvious choice for some problem&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Requirement 2&lt;/strong&gt;: Your language needs a community healthy enough to justify use:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;2A&lt;/strong&gt;: Build a critical mass of maintained, style-enforced, open-source libraries for others to use (meaning people coordinate together to build an ecosystem)&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2B&lt;/strong&gt;: At least &lt;em&gt;one&lt;/em&gt; library/framework/language feature should be a &amp;ldquo;killer feature&amp;rdquo; - something so good others will evangelize the feature and it will make people consider the language just to use it&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2C&lt;/strong&gt;: The community should exist outside of the environment(s) of the people who made the language&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;There&amp;rsquo;s potential for endless bikeshedding about what success means. Let&amp;rsquo;s define success as &amp;ldquo;a language being well-used within the domain it&amp;rsquo;s advertised to be useful in&amp;rdquo; so we can judge languages on their own merits. Even this is relatively vague, but it&amp;rsquo;s a good enough working definition for this essay, and a more nuanced discussion is out of scope here.&lt;/p&gt;&#10;&lt;p&gt;Importantly, note that language quality is completely unrelated to if it succeeds. Otherwise, how do you explain PHP and JavaScript?&lt;/p&gt;&#10;&lt;h2 id="awesome-paradox-failures"&gt;Awesome Paradox Failures&lt;/h2&gt;&#10;&lt;p&gt;In Paul Graham&amp;rsquo;s essay &lt;a href="https://paulgraham.com/avg.html"&gt;&amp;ldquo;Beating the Averages&amp;rdquo;&lt;/a&gt;&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;, Graham discusses the idea that languages can be arranged on a hierarchy from the most powerful (the Lisp family, according to Graham) to the least. Despite this, Lisp&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; has not conquered the world nearly half a century later, and the reason is simple: &lt;em&gt;with great reductions in power comes great increases in coordination, and vice versa&lt;/em&gt;. Lisp is so powerful that programmers have zero reason to coordinate on a similar style, which makes it difficult for a critical mass of libraries to emerge, and no top-down force ensuring coordination (unlike, say, Jane Street with OCaml: very flexible language with enforced style).&lt;/p&gt;&#10;&lt;p&gt;Even if the coordination problem were solved, there&amp;rsquo;s still the issue of actually teaching people to use these programming powers correctly. Consider Clojure, the answer to Lisp&amp;rsquo;s problems: with perfect Java FFI, it gets to piggyback on Java&amp;rsquo;s ecosystem, solving the coordination problem. However, many of Clojure&amp;rsquo;s features actually make it hard to pick up and write idiomatically for programmers unaccustomed to Lisps or functional programming (like macros, immutability, transactions, and especially multimethods), plus there is no compelling forcing factor, so it too fails the Awesome Paradox.&lt;/p&gt;&#10;&lt;p&gt;Perhaps the strongest case that power and clean design does not equal success is Haskell. It innovated features which appear in many places in the modern programming language space (typeclasses, monads, &lt;code&gt;Maybe&lt;/code&gt; and typed errors, lazy eval, purely functional). It failed for a variety of reasons (bad tooling, no community consensus because it&amp;rsquo;s powerful, no forcing function) but its most instructive failure is that other languages began strip-mining it for parts. Every time another language bolts on &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; or &lt;code&gt;lazy&lt;/code&gt; or more expressive type systems, the argument for switching to Haskell becomes a bit weaker. Smalltalk, ML, and F# are similar sad victims of the &amp;ldquo;bigger language steals all the good ideas and kills momentum in the originator&amp;rdquo; Awesome Paradox failure type.&lt;/p&gt;&#10;&lt;p&gt;Of course, failing the Paradox is not exclusive to languages which are powerful. Visual Basic (Classic and .NET), being blessed by Microsoft in the early 90s, was once one of the most popular languages of all time. As soon as Microsoft ended support for Classic Visual Basic in 2008, it began a slow decline into obscurity; a similar fate is in store for Visual Basic .NET, which was put in maintenance mode in 2023.&lt;/p&gt;&#10;&lt;p&gt;There is an even longer list of languages which failed to overcome the Awesome Paradox on any one of its criteria (like D, CoffeeScript, Vlang, etc), but those aren&amp;rsquo;t interesting to discuss and is technically always expanding.&lt;/p&gt;&#10;&lt;h2 id="awesome-paradox-successes"&gt;Awesome Paradox Successes&lt;/h2&gt;&#10;&lt;p&gt;What types of languages manage to escape the Awesome Paradox, and what does that imply for them? Successful languages usually go one of two ways: they can either focus in on dominating some niche where they become the de-facto choice, or they try to conquer the world, which can fundamentally never work out well.&lt;/p&gt;&#10;&lt;h3 id="niche-domination"&gt;Niche Domination&lt;/h3&gt;&#10;&lt;p&gt;Consider Fortran as an unusual case: it&amp;rsquo;s widely mocked by those who don&amp;rsquo;t use it, it&amp;rsquo;s full of weird syntax, and it&amp;rsquo;s got a somewhat arcane ecosystem. However, its specialty is something it&amp;rsquo;s so overwhelmingly good at that it&amp;rsquo;s ensured Fortran will still be written in 50 years: fast linear algebra. No other language, not even C, rivals Fortran&amp;rsquo;s speed in this niche, and it&amp;rsquo;s been optimizing for it exclusively for many decades now. Every language where fast math must be done links against BLAS and LAPACK, since nobody will seriously attempt a reimplementation. It beats the Awesome Paradox against all odds by choosing the niche path (although not intentionally, moreso a historical accident). Erlang/Elixir is a similar case, except for network programming instead.&lt;/p&gt;&#10;&lt;p&gt;There are some other types of niche success story worth mentioning before discussing more ambitious languages. Some successes come from the language being heavily embraced by a corporate benefactor, giving the language a clear use case (their platform) to solve the Paradox: examples include Java (historically), Kotlin (Android and the JVM), C# (.NET), and Swift (iOS/macOS). Sometimes a framework is the essential piece, like with Ruby (Rails) and Dart (Flutter). Possibly the rarest niche of all is when a language becomes significant because the language itself &lt;em&gt;is&lt;/em&gt; the killer feature. This elusive niche includes languages like OCaml (for building compilers and extremely reliable systems), Lua (small, easy to embed, beloved by gamedevs), and arguably Fortran (its restrictions make it fast).&lt;/p&gt;&#10;&lt;h3 id="conquer-the-world"&gt;Conquer The World&lt;/h3&gt;&#10;&lt;p&gt;Let&amp;rsquo;s consider Rust, the most recent world-conquering modern example. Rust checks many of the boxes despite being relatively young: it was forced by Mozilla onto its employees (in the early days), it quickly built numerous useful libraries, and its core feature - GC-less memory safety - is indeed very compelling. Rust has successfully defeated the Awesome Paradox and is used across many domains, which is excellent news for it in the short term but almost certainly bad news for its long-term future.&lt;/p&gt;&#10;&lt;p&gt;Why is that necessarily so? When communities grow, they inevitably bring in people who want to use the language for things it wasn&amp;rsquo;t being used for before. This results in an inevitable crisis, where these new people want something that the language doesn&amp;rsquo;t fundamentally have a good design answer to yet, possibly because the problem is unsolved broadly or is just difficult to add to the language. No standards body is perfect; Rust&amp;rsquo;s designers will make mistakes (they already have, in fact), even though they did avoid many historical ones by making good decisions (Editions, small &lt;code&gt;std&lt;/code&gt;, standardizing the tooling and style with &lt;code&gt;cargo&lt;/code&gt;).&lt;/p&gt;&#10;&lt;p&gt;C++ has been mocked for being huge and bloated, but this will likely also be true of Rust in the future. Rust is nowhere near complete, and there are several areas of the language which probably won&amp;rsquo;t become stable in a clean way. Async especially is a mess: executors are often very different (hard to port code between them), learning why you have to write &lt;code&gt;Pin&amp;lt;Box&amp;lt;dyn Future&amp;lt;T&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; is deeply unintuitive, and understanding how &lt;code&gt;async&lt;/code&gt; desugars is weird (at least we finally have async closures and traits, but way too late, Tokio is now &lt;em&gt;de facto&lt;/em&gt; &lt;code&gt;std&lt;/code&gt; because of how long it took!). It&amp;rsquo;s frustrating that Rust suffers from &lt;a href="https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/"&gt;function coloring&lt;/a&gt; all the way down to the &lt;em&gt;types&lt;/em&gt; (although it is understandable given the tradeoffs they had to make). Error handling in Rust also isn&amp;rsquo;t aging well: there are so many different error solutions (&lt;code&gt;thiserror&lt;/code&gt;, &lt;code&gt;anyhow&lt;/code&gt;, &lt;code&gt;snafu&lt;/code&gt;) and none of them really make the split between application-level and library-level errors clean.&lt;/p&gt;&#10;&lt;p&gt;Unlike C++, Rust will probably take longer to be bloated due to it learning from history, but it&amp;rsquo;s inevitably going to happen. When it does, new programming language research and historical wisdom will allow for some new, cleaner, simpler language to eat Rust&amp;rsquo;s breakfast. This pattern is not exclusive just to Rust: Go has had this growth creep too despite being initially very clean, most notably with the introduction of generics in a way somehow carefully crafted to be both weak and ugly at the same time, appeasing nobody. Everyone will be insulting these languages in 15-20 years like how people make fun of C++ now and made fun of COBOL back in the past.&lt;/p&gt;&#10;&lt;p&gt;Perhaps the only way to avoid such a fate is to allow a BDFL to run the language&amp;rsquo;s design, but denying changes for new use cases make it harder to grow. This is going well for Zig&amp;rsquo;s integrity but not for its success: Andrew consistently makes great choices for the language (&lt;a href="https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html"&gt;which is why Bun dropped Zig&lt;/a&gt;) and it&amp;rsquo;s exactly the reason Zig will probably not conquer the world; he is the rare kind of person who would rather &lt;a href="https://andrewkelley.me/post/why-we-cant-have-nice-software.html"&gt;get it right the first time&lt;/a&gt;&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;. Guido was doing this for Python, before he left after many years of gradually burning out from constantly fighting &lt;a href="https://lwn.net/Articles/759654/"&gt;this exact problem&lt;/a&gt;. So a BDFL is a lose-lose that doesn&amp;rsquo;t solve the core issue here: you get all the bad choices of having a committee make the choices but at a slower pace, or you get no changes and watch the language become niche or die out.&lt;/p&gt;&#10;&lt;h2 id="implications-for-newer-languages"&gt;Implications For Newer Languages&lt;/h2&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;My aim was for C++ to become the second best language for many things.&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#10;&lt;p&gt;&amp;ndash; Bjarne Stroustrup&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This is probably the worst time in the last few decades to be a new programming language, for a few reasons:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The incumbent languages are all getting better (Python losing the GIL and getting better tooling with &lt;code&gt;uv&lt;/code&gt;, Ruby has a JIT, real improvements to C++, modern C and Fortran are good, even Java and PHP are much more pleasant these days)&lt;/li&gt;&#10;&lt;li&gt;There are some missing areas of programming language research, particularly with things like side-effect tracking (Monads are cool but hard to use), lifetimes (need to be more ergonomic), gradual typing (Luau is working on this one), easy formal verification (Ada/SPARK went down this road and it&amp;rsquo;s somewhere Rust will need to go, too)&lt;/li&gt;&#10;&lt;li&gt;As people become more dependent on AI tooling, new languages will be hard to use with AI tools due to a lack of high-quality training data, which entrenches existing languages&lt;/li&gt;&#10;&lt;li&gt;Many niches are &lt;em&gt;already&lt;/em&gt; filled well, or have a corporate favorite installed&lt;/li&gt;&#10;&lt;li&gt;Rising expectations have made some features a requirement for new languages. Among them are some type of static typing, package management, and fast to no compile times.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;So what should new language designers / young programming languages do?&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Prioritize having one niche where your language is simply better than all the incumbents, or offer something new nobody is doing in that space.&lt;/li&gt;&#10;&lt;li&gt;Have really good tooling, since that&amp;rsquo;s the most common barrier to adoption in practice&lt;/li&gt;&#10;&lt;li&gt;Make peace with the fact that your language will be a product of its time and eventually surpassed (if you seek to conquer the world), or accept that it will be beautiful, elegant, and plundered for ideas by other, bigger languages (if you seek to conquer a niche)&lt;/li&gt;&#10;&lt;li&gt;Ensure your language has good interop with C (or some other big language) so you can overcome the coordination problem with libraries; you can swap to native ones later&lt;/li&gt;&#10;&lt;li&gt;Corporate benefactors are, despite what many think, extremely important. Many languages that are successful today are not grassroots but actually achieved their success thanks to a corporate user, since they give the language itself and its ecosystem new technical challenges to rise to.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;If I&amp;rsquo;d put my money on any upstart language right now to potentially escape the Awesome Paradox, it would probably be &lt;a href="https://gleam.run"&gt;Gleam&lt;/a&gt;. It overcomes the dynamic typing weakness of existing BEAM languages, compiles to {Java,Type}Script, has good tooling for both execution environments (plus FFI to both), and it&amp;rsquo;s relatively minimal. In particular, Gleam&amp;rsquo;s real advantage over other languages is that it fundamentally can&amp;rsquo;t be &amp;ldquo;mined for parts&amp;rdquo; like other functional languages such as Haskell; BEAM and the browser being possible in the same language is a strength other languages can&amp;rsquo;t cleanly retrofit. It will likely be a niche success, but I think it could go on to outshine the other BEAM languages and bring Erlang&amp;rsquo;s strengths to more people, which would be a very good thing.&lt;/p&gt;&#10;&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;&#10;&lt;p&gt;People should continue to develop new languages, but ideally should be focused on trying to build languages that are targeted at dominating niches rather than trying to resolve the much harder problem of building big, general-purpose languages. As always with good language design, be careful to &lt;a href="https://www.stroustrup.com/P0977-remember-the-vasa.pdf"&gt;remember the Vasa&lt;/a&gt;!&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;Taken from &lt;a href="https://www.artima.com/articles/the-philosophy-of-ruby#part4"&gt;this interview&lt;/a&gt; with him in 2003.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;He cites Eric Raymond&amp;rsquo;s &lt;a href="https://www.catb.org/~esr/faqs/hacker-howto.html"&gt;&amp;ldquo;How to Become A Hacker&amp;rdquo;&lt;/a&gt; essay within his; Raymond is wrong to advocate for studying Lisp. There are indeed advantages to studying different &lt;em&gt;paradigms&lt;/em&gt; of programming, which may require studying new languages to fully comprehend the advantages of them, but Lisp specifically is not a requirement. For Graham to compare the utility of studying Lisp to Latin is an insult to the classics, but we all know Graham is largely &lt;a href="https://www.paulgraham.com/hp.html"&gt;incapable of understanding art&lt;/a&gt; anyways.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:3"&gt;&#10;&lt;p&gt;I&amp;rsquo;m referring to &lt;a href="https://lisp-lang.org"&gt;Common Lisp&lt;/a&gt; here, but these critiques apply to &lt;a href="https://www.scheme.org"&gt;Scheme&lt;/a&gt; as well, perhaps even moreso because Scheme&amp;rsquo;s specification is so thin that each implementation of Scheme is effectively its own language.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:4"&gt;&#10;&lt;p&gt;Well, it might go on to defeat the Awesome Paradox within its newfound niche of game development and embedded work, but Zig will probably never be dominant enough to usurp C or even get frequently used alongside it. It is a really nice language though, I wish I had an excuse to use it.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:5"&gt;&#10;&lt;p&gt;Taken straight from the &lt;a href="https://www.stroustrup.com/quotes.html"&gt;horse&amp;rsquo;s mouth&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="essay"/></entry><entry><title>Nix(OS) Considered Harmful</title><link href="https://nsf.name/blog/nixos-considered-harmful/"/><updated>2026-08-20T13:12:18Z</updated><summary>Some issues with Nix and NixOS, and some ideas about how to fix them.</summary><content type="html">&lt;p&gt;I really want to like Nix and NixOS. There are many genuinely amazing and intelligent ideas within the project, but every time I stop and consider recommending it to someone, I feel like I can&amp;rsquo;t give a positive endorsement of the &lt;em&gt;project&lt;/em&gt;, even though the &lt;em&gt;technology&lt;/em&gt; of Nix(OS) is incredible, and I hope someone better builds upon it someday.&lt;/p&gt;&#10;&lt;h2 id="what-is-nixos"&gt;What is Nix(OS)?&lt;/h2&gt;&#10;&lt;p&gt;Many have never heard about this project, so a bit of explanation might not be remiss. Nix&amp;rsquo;s one sentence definition, as described by the main website&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;a tool that takes a unique approach to package management and system configuration.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;but I don&amp;rsquo;t like this definition and it&amp;rsquo;s not really comprehensive. I&amp;rsquo;d suggest that when people refer to Nix and/or NixOS, what they really mean is:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;A purely functional package manager that lets you declaratively manage system state and dependencies with the same configuration language.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;We are already off to a bad start, given that it&amp;rsquo;s taken nearly a paragraph to even define what this thing &lt;em&gt;is&lt;/em&gt; (more on this later). To clarify before I continue talking about it:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Nix is a functional, Haskell-flavored DSL that lets you express configurations, specifically system state and package build scripts. It&amp;rsquo;s also confusingly the same name as the build tool that consumes this language.&lt;/li&gt;&#10;&lt;li&gt;NixOS is a Linux distribution where Nix is the primary package manager. Nix scripts can configure nearly every part of the system in a declarative way; the system is built to the specification defined in the scripts.&lt;/li&gt;&#10;&lt;li&gt;Its selling point is &lt;em&gt;reproducible builds&lt;/em&gt;: any two Nix builds of the same Nix build script should result in byte-for-byte equivalent output with no changes&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;That last point cannot be understated. At the time of Nix&amp;rsquo;s release, nobody was doing this; it was a unique feature in the Linux world, and still kind of is today. Nothing achieves reproducible builds of both packages and systems at scale to the same extent Nix does, and a lot of its truly great ideas make it a one-of-a-kind piece of software.&lt;/p&gt;&#10;&lt;h2 id="lost-potential"&gt;Lost Potential&lt;/h2&gt;&#10;&lt;p&gt;Nix is what happens when you have many great ideas in the hands of the wrong people. It and NixOS were originally designed by Eelco Dolstra in the early 2000s&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;, who had a lot of good ideas for how to fix the main problems with reproducible builds and Linux package management, but didn&amp;rsquo;t get around to fully realizing them:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Builds should be content-addressable by the hash of their outputs, so that it&amp;rsquo;s obvious when they differ (ended up being based on hash of inputs due to rushed implementation)&lt;/li&gt;&#10;&lt;li&gt;Nix scripts should output &lt;code&gt;.drv&lt;/code&gt; files, which are serialized graphs of their dependencies, making it possible to figure out exactly what their inputs are (ended up as a weird proprietary fork of the ATerm binary format, never documented)&lt;/li&gt;&#10;&lt;li&gt;Nix as a language is Haskell-inspired and thus can&amp;rsquo;t handle side effects which are needed for builds, so should have some standard library of monad-IO to handle this (never came about; the standard library for Nix is split between &lt;code&gt;nixpkgs&lt;/code&gt; helper scripts, the NixOS module system, and the virtual package &lt;code&gt;pkgs.lib&lt;/code&gt; in &lt;code&gt;nixpkgs&lt;/code&gt;)&lt;/li&gt;&#10;&lt;li&gt;There should be a clean and obvious way to pin state so that reproducible builds are easy to achieve (Nix tried this with the &lt;code&gt;flake&lt;/code&gt; feature, but it never went anywhere, requires a compile-time flag to enable it)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The most painful part about Nix is that so often, the right idea was discovered, invented, and then died in committee because the community was unwilling or unable to adopt it. In particular, the community around Nix is one of the strangest I&amp;rsquo;ve seen in software development, because most who work on Nix &lt;em&gt;only&lt;/em&gt; work on Nix-related projects, which is very strange for software that is primarily useful for building more software.&lt;/p&gt;&#10;&lt;p&gt;Flakes are the classic example of why this project still hasn&amp;rsquo;t taken off; before flakes, the way that inputs were declaratively managed is through &lt;code&gt;NIX_CHANNEL&lt;/code&gt;, an environment variable listing GitHub URLs that Nix would checkout and then use as its package repo sources. Flakes allowed users to make a Nix file listing versions of package repositories and then generate a lockfile from them, so that specific versions of packages can be referenced and used in one&amp;rsquo;s builds. A great idea, but one that the Nix community continues to weirdly shutdown&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; and doesn&amp;rsquo;t seem to be ready nearly anytime soon despite many advertising it as a selling point of Nix(OS) (just Google &amp;ldquo;nix flake&amp;rdquo; and you&amp;rsquo;ll see what I mean).&lt;/p&gt;&#10;&lt;h2 id="problems-and-how-to-fix-them"&gt;Problems and How To Fix Them&lt;/h2&gt;&#10;&lt;p&gt;I&amp;rsquo;m not sure the current governance of the Nix project is the right direction. Eelco left a while ago and is seemingly doing his own thing now&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; rather than engaging with the wider community, which is a warning sign that it might be beyond reform. In particular, most of the pain points with Nix(OS) stem from the same few issues. I like lists, so I&amp;rsquo;ll present it as a list.&lt;/p&gt;&#10;&lt;h3 id="monorepo-problems"&gt;Monorepo Problems&lt;/h3&gt;&#10;&lt;p&gt;&lt;code&gt;Nixpkgs&lt;/code&gt;, the primary package repository for Nix(OS), is bloated and enormous. It&amp;rsquo;s too big and too complicated, and relies on too much tribal knowledge to navigate comfortably. Nix as a language lacks a standard library, but with the virtual &lt;code&gt;pkgs.lib&lt;/code&gt; package, they&amp;rsquo;ve created a bunch of scripts that act like them for the most annoying things to package. This is bad and makes the language much harder to learn &amp;amp; contribute to, increases maintainer burden, and ultimately makes it much harder to use.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Invest and stabilize Flakes, move more packages out of the core repository and into sub-repositories (Flakes would make this easy to do). Most distributions have a split between the core packages and the community/third-party ones (Fedora does this between its repos and RPMFusion, Ubuntu between &lt;code&gt;core&lt;/code&gt; and &lt;code&gt;galaxy&lt;/code&gt;, Arch has the AUR, etc); Nix(OS) should do similarly.&lt;/p&gt;&#10;&lt;h3 id="bad-documentation"&gt;Bad Documentation&lt;/h3&gt;&#10;&lt;p&gt;Nix is actively hostile to new contributors/users due to its famously awful documentation, its inconsistent and strange command line interface, and its famously cryptic error messages. It is also hard to learn how to write new packages and takes a lot of reading of &lt;code&gt;Nixpkgs&lt;/code&gt; to figure out how to do so, which is hard because of aforementioned problems.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Documentation needs to be a higher priority. There are at least &lt;em&gt;five&lt;/em&gt; different places for Nix(OS) documentation (&lt;a href="https://nixos.org/guides/nix-pills/"&gt;Nix Pills&lt;/a&gt;, &lt;a href="https://wiki.nixos.org/wiki/NixOS_Wiki"&gt;official NixOS Wiki&lt;/a&gt;, &lt;a href="https://nixos.wiki"&gt;unofficial NixOS Wiki&lt;/a&gt;, &lt;a href="https://nixos.org/learn/"&gt;Nix Manual&lt;/a&gt;, and &lt;a href="https://nix.dev"&gt;nix.dev&lt;/a&gt;), which is absurd. They should be consolidated, ideally on the official website, with better navigation, and should provide recipes for the most common types of Nix package expressions people would want to write. Nix itself actually has been getting better error messages but they&amp;rsquo;re locked behind enabling the Flakes feature, which is yet another reason it needs to be made the default.&lt;/p&gt;&#10;&lt;h3 id="nix-is-a-horrible-language"&gt;Nix is a Horrible Language&lt;/h3&gt;&#10;&lt;p&gt;Of all the programming languages out there, Nix might be &lt;em&gt;the&lt;/em&gt; least intuitive I&amp;rsquo;ve ever used. I&amp;rsquo;ve written Haskell before (completed the Learn You A Haskell for Great Good! book), which might be only reason I managed to figure Nix out. Nix&amp;rsquo;s lazyness and its weird blend of functional programming and terse bash build scripts make it very hard to debug when it just works. It is mostly a historical accident that Nix turned out this way, and it&amp;rsquo;s definitely too late to fix now, because too many people are used to it for the community to ever want to change it.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Need to start over with this one. There&amp;rsquo;s attempts at typed Nix and a rewrite into &lt;a href="https://guix.gnu.org/"&gt;GNU Guile Scheme&lt;/a&gt; exists, but I wouldn&amp;rsquo;t recommend using it, it&amp;rsquo;s actually worse in a lot of ways. I suggest something more imperative, more like Lua, and with strong typing, and a lot less like Haskell, since it&amp;rsquo;s almost impossible to recommend Nix to non-functional-programmers.&lt;/p&gt;&#10;&lt;h3 id="community--governance"&gt;Community &amp;amp; Governance&lt;/h3&gt;&#10;&lt;p&gt;Like I said before, Nix is mostly run by non-programmers. Most Nix contributors are the Linux-desktop types who mostly run Linux because they have a commitment to doing things in the most obtuse way possible, and see Nix as a step up in &amp;ldquo;difficulty&amp;rdquo; compared to a distribution like Arch or Gentoo. People who want to actually use Nix in production are a minority within the community. I think Linux on the desktop is mostly a waste of time; Linux is for everything &lt;em&gt;but&lt;/em&gt; the desktop&lt;sup id="fnref:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Again, start over. If Nix were governed by someone like Linus Torvalds, who&amp;rsquo;s willing to put his foot down and govern with taste and a strong set of opinions when needed, we would see a more coherent community and wider deployment today. Democracy is great, and works out for some larger projects (Linux), but Nix(OS) has been pulled in too many disparate directions and needs stronger focus, along with being mired in controversy&lt;sup id="fnref:7"&gt;&lt;a href="#fn:7" class="footnote-ref" role="doc-noteref"&gt;7&lt;/a&gt;&lt;/sup&gt;. A quick glance at the &lt;a href="https://github.com/nix-community"&gt;nix-community&lt;/a&gt; repository shows just how split that focus is.&lt;/p&gt;&#10;&lt;h2 id="lamentation"&gt;Lamentation&lt;/h2&gt;&#10;&lt;p&gt;Nix&amp;rsquo;s reproducibility is truly magical and I wish there was a better alternative to it. For all of its flaws, being able to &lt;code&gt;git clone &amp;amp;&amp;amp; nix build&lt;/code&gt; and get &lt;em&gt;exactly&lt;/em&gt; the same binaries and even the same Linux systems is a superpower no other build tool is remotely close to right now for the same level of effort. I still use it for some systems, but I can&amp;rsquo;t recommend its use for new projects these days.&lt;/p&gt;&#10;&lt;p&gt;In particular, I think the Nix community is really missing out on some areas where it could be immensely valuable. High-Performance Computing is the niche I have in mind; most users on those machines are unable to get root to install more packages, and Nix&amp;rsquo;s reproducibility focus would make sharing code and building it a snap for complex projects like climate models. Someday, if nobody else builds upon these ideas, maybe I&amp;rsquo;ll try my hand at building a much simpler functional package manager for this niche, for these ideas feel far too good to just lie here and rot away under all of Nix(OS)&amp;rsquo;s cruft.&lt;/p&gt;&#10;&lt;p&gt;I think there is a way to get Nix&amp;rsquo;s magical features in a simpler way without all of the mistakes it made, and with a cleaner language. There are many attempts to fork Nix and take it in a new direction, and I&amp;rsquo;m sure there&amp;rsquo;ll be continued effort from the Nix Foundation to improve it, but they&amp;rsquo;ve ultimately doomed it to irrelevance. It is so hard to recommend despite how brilliant the ideas behind it are, and it&amp;rsquo;s a tragedy that it ended up in the way that it has.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;&lt;a href="https://nixos.org"&gt;https://nixos.org&lt;/a&gt;, taken right off the main page&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;This isn&amp;rsquo;t universally true, and there&amp;rsquo;s a lot of work to be done on truly reproducible builds, but Nix is very helpful with regards to this and makes it much easier to achieve.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:3"&gt;&#10;&lt;p&gt;&lt;a href="https://edolstra.github.io/pubs/nixos-jfp-final.pdf"&gt;https://edolstra.github.io/pubs/nixos-jfp-final.pdf&lt;/a&gt;&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:4"&gt;&#10;&lt;p&gt;Nearly a decade and still not done yet: &lt;a href="https://github.com/NixOS/nix/milestone/27"&gt;https://github.com/NixOS/nix/milestone/27&lt;/a&gt;&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:5"&gt;&#10;&lt;p&gt;&lt;a href="https://determinate.systems"&gt;https://determinate.systems&lt;/a&gt;&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:6"&gt;&#10;&lt;p&gt;The vast majority of people running Linux will never use it on their personal computers (no, Android doesn&amp;rsquo;t count), and to pretend otherwise is delusional. Desktop Linux is not to be taken seriously and is a very niche use case. For the vast majority of developers, macOS or WSL will be their development environment for decades to come.&amp;#160;&lt;a href="#fnref:6" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:7"&gt;&#10;&lt;p&gt;&lt;a href="https://determinate.systems/blog/on-community-in-nix/"&gt;https://determinate.systems/blog/on-community-in-nix/&lt;/a&gt;. This article is a very good example of how not to handle controversy with a community&amp;rsquo;s relationship to corporate sponsors.&amp;#160;&lt;a href="#fnref:7" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="essay"/></entry><entry><title>Lufsa: Sticky Note Images</title><link href="https://nsf.name/blog/lufsa-sticky-note-images/"/><updated>2026-08-20T13:12:18Z</updated><summary>Exploring the limits of SwiftUI by porting some ancient code.</summary><content type="html">&lt;p&gt;After previous projects with SwiftUI, I became curious as to what the limits of the framework are, and how different the development experience is between macOS and iOS apps. To push those limits, I aimed to recreate a somewhat weirder application: &lt;a href="https://itn-web.it.liu.se/~stegu76/xteddy/index.html"&gt;&lt;code&gt;xteddy&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="why-xteddy"&gt;Why &lt;code&gt;xteddy&lt;/code&gt;?&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;xteddy&lt;/code&gt; is a X11 application written by Professor Stefan Gustavson which originally did exactly one thing: draw a non-rectangular, floating window to the screen containing just the bundled &lt;code&gt;xteddy&lt;/code&gt; image, and implement some basic handlers to kill and open it appropriately. However, later versions released in 1997 onwards allow you to load any arbitrary &lt;code&gt;.xbm&lt;/code&gt; (X Bitmap), and in the Debian Linux port, &lt;code&gt;.png&lt;/code&gt; files. This effectively made it a simple sticky note application but for images.&lt;/p&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/xteddy-openbsd_hu_c08cd0f6f2d2c447.webp" type="image/webp"&gt;&#10; &lt;img src="/images/xteddy-openbsd.png"&#10; alt="xteddy on OpenBSD 7.9"&#10; width="958"&#10; height="816"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;&lt;em&gt;Pictured: xteddy running on OpenBSD 7.9&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;When I switched from using a Thinkpad running Linux to a Macbook, I missed this app quite a bit as I had some useful scripts that took advantage of &lt;code&gt;xteddy&lt;/code&gt;&amp;rsquo;s functionality. Unix&amp;rsquo;s X11 and macOS&amp;rsquo;s Quartz windowing system have very different designs and no backwards compatibility for X11 libraries, so a simple recompile wouldn&amp;rsquo;t do.&lt;/p&gt;&#10;&lt;p&gt;The pain point that convinced me to do the rewrite was when I kept wanting to have floating windows with certain reference images (band information for remote sensing data), but putting them into the Sticky Notes app that comes with macOS was not really working for me (hard to use). So I opted to give a rewrite a go!&lt;/p&gt;&#10;&lt;h2 id="fighting-with-swiftui"&gt;Fighting with SwiftUI&lt;/h2&gt;&#10;&lt;p&gt;I initially tried to see if something like this was even possible within SwiftUI. It&amp;rsquo;s been in development for a long time, presumably it should be nearly feature-complete for this sort of thing at this point? I thought it would be as simple as just writing:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#268bd2"&gt;struct&lt;/span&gt; &lt;span style="color:#268bd2"&gt;LufsaApp&lt;/span&gt;: App {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 2&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;var&lt;/span&gt; &lt;span style="color:#268bd2"&gt;body&lt;/span&gt;: some Scene {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 3&lt;/span&gt;&lt;span&gt; WindowGroup(&lt;span style="color:#719e07"&gt;for&lt;/span&gt;: ImageDocument.&lt;span style="color:#cb4b16"&gt;self&lt;/span&gt;) { $doc &lt;span style="color:#719e07"&gt;in&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 4&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;if&lt;/span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;doc&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 5&lt;/span&gt;&lt;span&gt; ImageStickyView(document: doc)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 6&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 7&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 8&lt;/span&gt;&lt;span&gt; .windowLevel(.floating)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 9&lt;/span&gt;&lt;span&gt; .windowBackgroundDragBehavior(.enabled)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;10&lt;/span&gt;&lt;span&gt; .commandsRemoved()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;11&lt;/span&gt;&lt;span&gt; .commands {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;12&lt;/span&gt;&lt;span&gt; CommandMenu(&lt;span style="color:#2aa198"&gt;&amp;#34;Images&amp;#34;&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;13&lt;/span&gt;&lt;span&gt; Button(&lt;span style="color:#2aa198"&gt;&amp;#34;Open Image...&amp;#34;&lt;/span&gt;, systemImage: &lt;span style="color:#2aa198"&gt;&amp;#34;photo&amp;#34;&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;14&lt;/span&gt;&lt;span&gt; manager.openImage(using: openWindow)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;15&lt;/span&gt;&lt;span&gt; }.keyboardShortcut(KeyboardShortcut(&lt;span style="color:#2aa198"&gt;&amp;#34;o&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;16&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;17&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;18&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;19&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This wasn&amp;rsquo;t sufficient. The main issue was that focus on the windows themselves were deallocating randomly after creation. Ominous, and definitely not foreshadowing of greater technical problems to come with this approach. This required a bit more work:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;@MainActor&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;&lt;span style="color:#268bd2"&gt;class&lt;/span&gt; &lt;span style="color:#268bd2"&gt;WindowManager&lt;/span&gt;: Observable {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;var&lt;/span&gt; &lt;span style="color:#268bd2"&gt;documents&lt;/span&gt;: [ImageDocument] = []&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;4&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#586e75"&gt;// methods went here&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;5&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Again, some newfound problems with windows. Changing state on them required developing a complex set of methods to be implemented on the actual View directly.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 1&lt;/span&gt;&lt;span&gt;.onChange(of: document.properties.isBorderless) { &lt;span style="color:#cb4b16"&gt;_&lt;/span&gt;, isBorderless &lt;span style="color:#719e07"&gt;in&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 2&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#719e07"&gt;if&lt;/span&gt; isBorderless {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 3&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.styleMask = [.borderless, .fullSizeContentView]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 4&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.titlebarAppearsTransparent = &lt;span style="color:#cb4b16"&gt;true&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 5&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.titleVisibility = .hidden&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 6&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.backgroundColor = .clear&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 7&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.isOpaque = &lt;span style="color:#cb4b16"&gt;false&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 8&lt;/span&gt;&lt;span&gt;&#9;} &lt;span style="color:#719e07"&gt;else&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 9&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.styleMask = [.titled, .closable, .miniaturizable, .resizable]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;10&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.titlebarAppearsTransparent = &lt;span style="color:#cb4b16"&gt;false&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;11&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.titleVisibility = .visible&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;12&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.backgroundColor = .windowBackgroundColor&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;13&lt;/span&gt;&lt;span&gt;&#9;&#9;window?.isOpaque = &lt;span style="color:#cb4b16"&gt;true&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;14&lt;/span&gt;&lt;span&gt;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;15&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since SwiftUI still doesn&amp;rsquo;t allow us to select what window we&amp;rsquo;re working on in a way that works reliably (&lt;code&gt;.appearsActive&lt;/code&gt; exists, but fails on some style masks), we have to handle that:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#268bd2"&gt;struct&lt;/span&gt; &lt;span style="color:#268bd2"&gt;WindowAccessor&lt;/span&gt;: NSViewRepresentable {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 2&lt;/span&gt;&lt;span&gt; @Binding &lt;span style="color:#268bd2"&gt;var&lt;/span&gt; &lt;span style="color:#268bd2"&gt;window&lt;/span&gt;: NSWindow?&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 3&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;func&lt;/span&gt; &lt;span style="color:#268bd2"&gt;makeNSView&lt;/span&gt;(context: Context) -&amp;gt; NSView {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 4&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;view&lt;/span&gt; = NSView()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 5&lt;/span&gt;&lt;span&gt; DispatchQueue.main.async {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 6&lt;/span&gt;&lt;span&gt; &lt;span style="color:#cb4b16"&gt;self&lt;/span&gt;.window = view.window&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 7&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 8&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;return&lt;/span&gt; view&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 9&lt;/span&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;10&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;func&lt;/span&gt; &lt;span style="color:#268bd2"&gt;updateNSView&lt;/span&gt;(&lt;span style="color:#cb4b16"&gt;_&lt;/span&gt; nsView: NSView, context: Context) {}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;11&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It was around this point that I started to give up on any reasonable hope of getting this done quickly, and realized I&amp;rsquo;d need to rethink my approach, as I&amp;rsquo;d been forced to reinvent:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Window management and window memory allocation&lt;/li&gt;&#10;&lt;li&gt;Window tracking and state management per-window (since SwiftUI doesn&amp;rsquo;t really know what a &amp;ldquo;window&amp;rdquo; is; it thinks in terms of pure &lt;code&gt;Views&lt;/code&gt; and &lt;code&gt;Scenes&lt;/code&gt;)&lt;/li&gt;&#10;&lt;li&gt;The &lt;code&gt;Image&lt;/code&gt; view itself (I &lt;code&gt;.background()&lt;/code&gt;ed it with an &lt;code&gt;NSViewRepresentable&lt;/code&gt; to change click behavior because SwiftUI is picky about what clicks are &amp;ldquo;gestures&amp;rdquo; and thus qualify for &lt;code&gt;.onTapGesture()&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Even with all these hacks, behavior was still breaking because the SwiftUI runtime kept changing behavior like the &lt;code&gt;View&lt;/code&gt; overlays and the very &lt;code&gt;NSWindow&lt;/code&gt; properties I was trying to write to, and I simply couldn&amp;rsquo;t beat SwiftUI at its own game!&lt;/p&gt;&#10;&lt;p&gt;Clearly, I needed a framework that made it quick and easy to operate on what my entire project was actually about, which is raw pixels and direct window draws. After consulting the documentation once again, I found it in the code I&amp;rsquo;d already been repeatedly subclassing aggressively anyways: AppKit.&lt;/p&gt;&#10;&lt;h2 id="appkit-is-still-great-on-macos"&gt;AppKit is Still Great (On macOS)&lt;/h2&gt;&#10;&lt;p&gt;It&amp;rsquo;s clear that for any macOS app that needs very close system ties or nonstandard behavior that&amp;rsquo;s allowed within macOS, you have no choice but to drop to AppKit. Fortunately, it&amp;rsquo;s mostly great in Swift as long as you are aware of with the footguns of this entire API, which is that you&amp;rsquo;re actually secretly in imperative-ish Objective-C the whole time and nobody&amp;rsquo;s telling you because the FFI is great here, so be very careful with some things you&amp;rsquo;d normally do without caution in SwiftUI. For instance:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#268bd2"&gt;@objc&lt;/span&gt; &lt;span style="color:#268bd2"&gt;func&lt;/span&gt; &lt;span style="color:#268bd2"&gt;openFile&lt;/span&gt;(&lt;span style="color:#cb4b16"&gt;_&lt;/span&gt; url: URL) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 2&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;image&lt;/span&gt; = NSImage(byReferencing: url)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 3&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;canvas&lt;/span&gt; = ImageCanvas(image: image)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 4&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;delegate&lt;/span&gt; = AspectScaleDelegate(baseSize: image.size)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 5&lt;/span&gt;&lt;span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 6&lt;/span&gt;&lt;span&gt; &lt;span style="color:#268bd2"&gt;let&lt;/span&gt; &lt;span style="color:#268bd2"&gt;window&lt;/span&gt; = LufsaWindow(&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 7&lt;/span&gt;&lt;span&gt; contentRect: NSRect(x: &lt;span style="color:#2aa198"&gt;0&lt;/span&gt;, y: &lt;span style="color:#2aa198"&gt;0&lt;/span&gt;, width: &lt;span style="color:#b58900"&gt;Int&lt;/span&gt;(image.size.width) &lt;span style="color:#719e07"&gt;as&lt;/span&gt; &lt;span style="color:#b58900"&gt;Int&lt;/span&gt;, height: &lt;span style="color:#b58900"&gt;Int&lt;/span&gt;(image.size.height)),&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 8&lt;/span&gt;&lt;span&gt; styleMask: [.titled, .closable, .resizable, .miniaturizable],&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt; 9&lt;/span&gt;&lt;span&gt; backing: .buffered,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;10&lt;/span&gt;&lt;span&gt; &lt;span style="color:#719e07"&gt;defer&lt;/span&gt;: &lt;span style="color:#cb4b16"&gt;false&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;11&lt;/span&gt;&lt;span&gt; )&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;12&lt;/span&gt;&lt;span&gt;&#9;&#9;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;13&lt;/span&gt;&lt;span&gt;&#9;&#9;&lt;span style="color:#586e75"&gt;// time passes...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;14&lt;/span&gt;&lt;span&gt;&#9;&#9;window.delegate = delegate&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;15&lt;/span&gt;&lt;span&gt;&#9; &lt;span style="color:#586e75"&gt;// uh oh, my delegate just got deallocated&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;16&lt;/span&gt;&lt;span&gt;&#9;&#9;&lt;span style="color:#cb4b16"&gt;self&lt;/span&gt;.windows.append(window)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;17&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What is wrong with this code? It surely stumped me for some time. The reason this will fail is that the delegate is a &lt;em&gt;weak&lt;/em&gt; reference. Normally, Swift would handle copying memory around and juggling the reference with automatic reference counting, so even though the &lt;code&gt;NSWindow&lt;/code&gt; will escape this scope it won&amp;rsquo;t deallocate objects it&amp;rsquo;s referencing. However, &lt;code&gt;NSWindow&lt;/code&gt; is actually an Objective-C object, so its runtime will deallocate the delegate inside of the &lt;code&gt;NSWindow&lt;/code&gt; during garbage collection. To inform it that you really do want the delegate to stay:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#586e75"&gt;// this is Dark Arts to create a strong reference.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;&lt;span style="color:#586e75"&gt;// *ptr to heap of main actor, which holds it.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;objc_setAssociatedObject(window, &amp;amp;&lt;span style="color:#cb4b16"&gt;Self&lt;/span&gt;.delegateKey, delegate, .OBJC_ASSOCIATION_RETAIN)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;4&lt;/span&gt;&lt;span&gt;&lt;span style="color:#586e75"&gt;// and our delegate doesn&amp;#39;t deallocate!&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is really good for overriding class behavior, but it&amp;rsquo;s definitely confusing at first, not very Swift-like to read, and similar twists came up repeatedly as I worked with AppKit. Despite being in Swift, I ended up thinking and reading more about Objective-C&amp;rsquo;s behavior more than I&amp;rsquo;d ever have expected to in 2026.&lt;/p&gt;&#10;&lt;p&gt;Another annoying side effect of this choice is the strange mysterious behavior that remains undocumented in the macOS windowing system:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#719e07"&gt;if&lt;/span&gt; window.styleMask.&lt;span style="color:#268bd2"&gt;contains&lt;/span&gt;(.titled) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;2&lt;/span&gt;&lt;span&gt;&#9;savedStyleMasks[window] = window.styleMask&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;3&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#586e75"&gt;// technically, we could allow resizes here,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;4&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#586e75"&gt;// but they&amp;#39;re buggy so I&amp;#39;m not going to allow it.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;5&lt;/span&gt;&lt;span&gt;&#9;window.styleMask = .borderless&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;6&lt;/span&gt;&lt;span&gt;&#9;window.backgroundColor = .clear&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;7&lt;/span&gt;&lt;span&gt;&#9;&lt;span style="color:#586e75"&gt;// borderless windows don&amp;#39;t get focus by default&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;8&lt;/span&gt;&lt;span&gt;&#9;window.makeKeyAndOrderFront(&lt;span style="color:#cb4b16"&gt;nil&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#495050"&gt;9&lt;/span&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Why exactly macOS is so weirdly restrictive about resizing borderless windows is unclear. It also crashes Finder to spawn non-rectangular windows, which is a genuine regression in Quartz. There&amp;rsquo;s a good chance I&amp;rsquo;m probably doing it wrong, or that a framework that wraps Quartz like SDL figured out how to do it, but if it is possible it&amp;rsquo;s definitely not easy to do.&lt;/p&gt;&#10;&lt;h2 id="finished-product"&gt;Finished Product&lt;/h2&gt;&#10;&lt;p&gt;I decided ultimately to name this thing Lufsa after &lt;a href="https://linuxgazette.net/122/TWDT.html#nottag.2"&gt;the name of the bear in the original program&lt;/a&gt;. Just like the classic one, Lufsa supports a debordered mode, where window chrome isn&amp;rsquo;t rendered. Due to limitations in macOS this is secretly rectangular, but it&amp;rsquo;s an invisible rectangle cropped to content, so it should be very close to non-rectangular in practice. A slight regression over the 30 years that have passed, but otherwise modern windowing APIs are just as capable as X11 was without X11&amp;rsquo;s massive architectural problems.&lt;/p&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/lufsa-catjump_hu_39efc630960da639.webp" type="image/webp"&gt;&#10; &lt;img src="/images/lufsa-catjump.png"&#10; alt="Lufsa pixel-perfect &amp;amp; debordered"&#10; width="1278"&#10; height="628"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;&lt;em&gt;Pictured: Lufsa&amp;rsquo;s pixel-perfect and debordered modes&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;Windows also scale relative to their aspect ratio, so even the above 100x100px &lt;code&gt;catJump.gif&lt;/code&gt; looks great when it&amp;rsquo;s 20 times its size. Lufsa also supports far more filetypes (anything Previews supports since it&amp;rsquo;s the same API) and even animated image files too!&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s gone a bit beyond the goals of perfectly emulating &lt;code&gt;xteddy&lt;/code&gt;, but I bundled all the Debian Linux port images with the application bundle. Under File -&amp;gt; Open, you can find and open any of them if you&amp;rsquo;d like. Make sure to turn on Pixel-Perfect for the canonical &amp;rsquo;90s experience.&lt;/p&gt;&#10;&lt;p&gt;For my purposes the project is basically complete. If you want to give it a go yourself, you can try it &lt;a href="https://github.com/nsf-name/lufsa"&gt;by clicking here&lt;/a&gt; and then downloading the latest release. Because of AppKit, it&amp;rsquo;s super backwards compatible (any macOS install since High Sierra should be compatible, so it&amp;rsquo;ll run fine on any Mac from the last decade).&lt;/p&gt;&#10;&lt;p&gt;If you happen to be a new Swift developer&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;: on macOS, AppKit is still fantastic and shouldn&amp;rsquo;t be shunned just because it&amp;rsquo;s not SwiftUI (and thus, not shiny &amp;amp; new). If anything, when your application is more &amp;ldquo;windows and pixels&amp;rdquo; rather than &amp;ldquo;views and layouts&amp;rdquo; consider reaching for it first until Apple finally finds a way to SwiftUI-ify window management in a clean, cross-platform way. One can hope that with visionOS and iPadOS encouraging more window-based inputs, we might see that day come sooner rather than later&amp;hellip;&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;You might have also been sent here because I linked to this blog post as part of the &amp;ldquo;Free University&amp;rdquo; student Winter Study course on macOS/iOS development at Williams. If that is you: welcome, and hopefully this article cleared up what I was talking about!&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="swift"/></entry><entry><title>Rustlings &amp; Project Ideas</title><link href="https://nsf.name/blog/rustlings-project-ideas/"/><updated>2026-08-03T21:14:03Z</updated><summary>Learning Rust with Rustlings and considering some future ways I might use it for code projects.</summary><content type="html">&lt;p&gt;Recently I finished taking &lt;a href="https://catalog.williams.edu/csci/detail/?strm=0&amp;amp;cn=237&amp;amp;crsid=010805&amp;amp;req_year=0"&gt;CS237&lt;/a&gt;, a class all about writing in C and x86 assembly, so I thought it would be a natural try to work on Rustlings at the same time to see if the hype around Rust really lived up to what everyone else was saying about it. After finishing Rustlings, I can confidently say that Rust is an extremely useful language that I&amp;rsquo;m glad I spent the time to learn and working on it has given me the confidence to approach some ideas I probably wouldn&amp;rsquo;t have ever considered otherwise.&lt;/p&gt;&#10;&lt;h3 id="strengths-of-rust"&gt;Strengths of Rust&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I like strong types, sum types, and how you can get type-level safety on a lot of things for free (they go away at compile time). In particular, learning about &lt;a href="https://doc.rust-lang.org/nomicon/phantom-data.html"&gt;&lt;code&gt;PhantomData&lt;/code&gt;&lt;/a&gt; really got me thinking&amp;hellip;&lt;/li&gt;&#10;&lt;li&gt;Lifetimes and the only-one-&lt;code&gt;mut&lt;/code&gt;-pointer rule are a very cool double-edged sword that helps just as often as it hurts. I am very grateful that &lt;code&gt;std&lt;/code&gt; ships most of the data structures I need, because &lt;a href="https://rust-unofficial.github.io/too-many-lists/"&gt;implementing them myself&lt;/a&gt; sounds really painful.&lt;/li&gt;&#10;&lt;li&gt;It&amp;rsquo;s similar to other languages I already like (Swift). The presence &lt;code&gt;if let&lt;/code&gt;, compiler-enforced complete &lt;code&gt;match&lt;/code&gt;, the &lt;code&gt;_notused&lt;/code&gt; underscore, and &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; all made Rust a lot easier to pick up because what works in Swift usually works here, too.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;cargo&lt;/code&gt; is really great. One tool for pinned &amp;amp; reproducible builds, benchmarking, testing, and cross-compilation is fantastic. It&amp;rsquo;s really easy to build anyone else&amp;rsquo;s Rust crates &amp;amp; really easy to share ones you make. I wish every build tool was as good as &lt;code&gt;cargo&lt;/code&gt; is.&lt;/li&gt;&#10;&lt;li&gt;The high-level style, speed, and manual memory management is a wonderful combo that exists almost nowhere else, except maybe in Zig and C++.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;clippy&lt;/code&gt; is really helpful. I turned it on after finishing Rustlings and redid some of the harder exercises I&amp;rsquo;d forgotten by that point, and it&amp;rsquo;s incredible how it often just solves the problems for you. The compiler might make Rust easy to write, but this is what makes Rust fun and easy to write excellently.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="weaknesses-of-rust"&gt;Weaknesses of Rust&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The syntax can get really ugly (especially when you start involving lifetimes, smart pointers, too many generic types, and complex trait bounds)&lt;/li&gt;&#10;&lt;li&gt;I understand why Rust renamed things (types =&amp;gt; traits, packages =&amp;gt; crates, string =&amp;gt; &lt;code&gt;&amp;amp;str&lt;/code&gt; and &lt;code&gt;String&lt;/code&gt; depending on context, &lt;code&gt;Box&amp;lt;T&amp;gt;&lt;/code&gt; =&amp;gt; C++ style smart pointers) but it would have been helpful if The Book&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; had notes for programmers of other languages when they did this. It would have made it a bit faster to understand what a chapter was going to be about &amp;amp; find what I am looking for, even if they aren&amp;rsquo;t exactly the same.&lt;/li&gt;&#10;&lt;li&gt;Errors with the functional part of the language are often substantially less helpful than for every other part of the language, and the functional parts are hard to use right (especially when you start chaining them).&lt;/li&gt;&#10;&lt;li&gt;Dropping to &lt;code&gt;unsafe&lt;/code&gt; a lot is required in order to do FFI, which is both good (forces you to stop and think) and bad (because sometimes, figuring out how to say what you want in a safe abstraction with the smallest possible &lt;code&gt;unsafe&lt;/code&gt; surface is a very hard problem).&lt;/li&gt;&#10;&lt;li&gt;Async is abysmally messy compared with something threaded (like Python). I feel like there&amp;rsquo;s got to be a better solution than &lt;a href="https://fasterthanli.me/articles/pin-and-suffering"&gt;what Rust currently has&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Trying to build for some OSes/hardware outside of the big three (Linux, macOS, Windows on &lt;code&gt;x86_64&lt;/code&gt; and &lt;code&gt;aarch64&lt;/code&gt;) is a real pain, and often requires bootstrapping your own Tier 3 toolchain. This is a real shame because if you want to run Rust somewhere small (like, say, a router running OpenBSD, or &lt;code&gt;x86_32&lt;/code&gt; hardware) where bootstrapping is not an option, it makes the build process a lot more annoying.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="project-ideas"&gt;Project Ideas&lt;/h2&gt;&#10;&lt;p&gt;I really like Rust and will definitely be coming back to it in the future. It isn&amp;rsquo;t my favorite programming language but it&amp;rsquo;s better than many of the other languages I&amp;rsquo;ve had to use and it&amp;rsquo;s so much better than C. There are a few things I&amp;rsquo;ve been thinking about writing at some point:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Rust is not a great GPU kernel language (almost all languages aren&amp;rsquo;t) but Fortran is a really good GPU language when you compile it with GPU offloading. Someday (probably in the spring semester when I take computer graphics), I want to try having Rust drive Fortran programs: Rust lives on the CPU and calls out to Fortran on the GPU. I think this could make lots of low-level graphics issues in that class become much simpler. &lt;code&gt;PhantomData&lt;/code&gt; is cool for precisely this kind of workflow: lifetimes in APIs could make it much simpler for people to safely work with data over the FFI bridge!&lt;/li&gt;&#10;&lt;li&gt;On a similar note, it would be cool to have Rust driving HPC workloads since it&amp;rsquo;s reliable and much faster than Python. I may implement something like this for CICE later on in my thesis, if I discover that calling it from Python and &lt;code&gt;f2py&lt;/code&gt; is a massive source of overhead (it definitely could be, it&amp;rsquo;s happened to me before).&lt;/li&gt;&#10;&lt;li&gt;I&amp;rsquo;m sure I&amp;rsquo;ll probably want to write some small Unix tool here or there for my own needs. If I do, Rust is probably the language I&amp;rsquo;ll be reaching for going forward.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;&lt;a href="https://doc.rust-lang.org/stable/book/title-page.html"&gt;&amp;ldquo;The Rust Programming Language&amp;rdquo;&lt;/a&gt; is the book I&amp;rsquo;m talking about here.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="programming"/><category term="rust"/></entry><entry><title>Rewriting WSO Mobile in Swift</title><link href="https://nsf.name/blog/rewriting-wso-mobile-in-swift/"/><updated>2026-10-20T13:30:00Z</updated><summary>What happens when trying to replace a decade-old mobile app? You learn a lot about how to do things right from the start.</summary><content type="html">&lt;p&gt;At Williams College, most student technological services run through an organization called WSO&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, for common tasks like checking the course calendar, dining hall menus, rating professors, trading textbooks, and more. Since the college doesn&amp;rsquo;t provide its own app, that means our app is the standard app for the ~2,000 students who are active students.&lt;/p&gt;&#10;&lt;p&gt;Around December of 2025, I began to realize that we should aspire to do better than our current trainwreck of an app. The last time that WSO&amp;rsquo;s aging mobile app was rewritten before the rewrite that I am about to discuss here was all the way back in &lt;em&gt;2016&lt;/em&gt;, meaning the current mobile app was made of nearly &lt;em&gt;a decade&lt;/em&gt; of unmaintained trash. I can&amp;rsquo;t even begin to explain how bad this actually was&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;There was functionally no security: for cross-compatibility reasons, the app was written as a port of the old web client running in a full-screen web browser, so sensitive information like passwords was effectively a cookie in that in-app browser.&lt;/li&gt;&#10;&lt;li&gt;The app didn&amp;rsquo;t look good, it didn&amp;rsquo;t work in dark mode, and its UI was something straight out of early Android. Confusing layout of buttons, poor readability, and an interface that actively hid information that was visible on the desktop version were all common user gripes.&lt;/li&gt;&#10;&lt;li&gt;It was slow: starting up the app could take up to four seconds for absolutely no reason, and it was slow to do many expensive operations as well (like search the list of staff and faculty, or to even switch pages in the GUI).&lt;/li&gt;&#10;&lt;li&gt;It was bloated: over 12,000 lines of code and so many layers of abstraction that debugging became a serious hassle (and eventually killed off all development).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;We had postponed a rewrite, seeing no particular reason to bother with a new version if the website version worked fine, but I knew that I could do better and daily use of the old app actively irritated me. What got me finally interested in the project is when others spent several months trying to add a new feature and simply couldn&amp;rsquo;t even get the old mobile client to compile successfully, no matter what they did.&lt;/p&gt;&#10;&lt;p&gt;So one nice November afternoon, I sat down and started working on the new app, and about ~9,000 lines of Swift later, I learned an awful lot!&lt;/p&gt;&#10;&lt;h2 id="why-swift-instead-of-flutterkotlin"&gt;Why Swift instead of Flutter/Kotlin?&lt;/h2&gt;&#10;&lt;p&gt;I only own an iPhone, and Swift&amp;rsquo;s design is more befitting of the way that my mind works. Also, it lets you do a lot of fun type shenanigans (protocols), it&amp;rsquo;s very good at preventing data races which is essential for WSO&amp;rsquo;s needs (actors), I&amp;rsquo;d messed around with SwiftUI on macOS before, and I knew that it would be really performant without me needing to think much about it. It also was obvious that an iOS version would be massively popular because, based on statistics from our backend, about ~90% of Williams students use iPhones&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#10;&lt;h2 id="engineering-misadventures"&gt;Engineering Misadventures&lt;/h2&gt;&#10;&lt;p&gt;Once I got to work, I made some general choices that I somewhat regret now but I&amp;rsquo;ll fix in the next version. I tried to stick with a &lt;a href="https://en.wikipedia.org/wiki/Worse_is_better"&gt;&amp;ldquo;worse is better&amp;rdquo;&lt;/a&gt; approach, but that created some unexpected issues. Among them are:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I ended up having lots of repetitive code because I wasn&amp;rsquo;t sure what level of abstraction I would need. For instance, with my &lt;code&gt;View&lt;/code&gt;s, initially they only contained exactly what they needed to have drawn. This quickly ballooned as I realized that I needed to implement &lt;code&gt;.refreshable&lt;/code&gt;, error states, and starting &lt;code&gt;.task&lt;/code&gt;s for every single one. Now I need to go back and write &lt;code&gt;@ViewBuilder&lt;/code&gt; macros for my most common patterns.&lt;/li&gt;&#10;&lt;li&gt;My &lt;code&gt;WebRequest&lt;/code&gt; library, designed to handle the strange two-JWT-token system WSO uses to authenticate, had an API that worked great at first, but I didn&amp;rsquo;t realize was actually optimizing for the edge cases rather than the general case (turns out logins are not really reflective of how most WSO requests are made!). I&amp;rsquo;ll need to consider the best approach more carefully.&lt;/li&gt;&#10;&lt;li&gt;Many &lt;code&gt;ViewModel&lt;/code&gt;s are very similar to each other, but have slightly different semantics or data processing steps. I didn&amp;rsquo;t reach for generics early on because I wasn&amp;rsquo;t sure how similar they would end up being (turns out: very similar indeed).&lt;/li&gt;&#10;&lt;li&gt;I eventually got too tempted to add some features which were arguably out of scope (namely the news article reader and student radio station player), which resulted in me implementing some parsing on the frontend that definitely should have been server side. It&amp;rsquo;s not the worst thing in the world to rewrite the parsers in Go, it&amp;rsquo;s just that I didn&amp;rsquo;t want to delay the app&amp;rsquo;s release for them, but I&amp;rsquo;m working on that now.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;None of these ended up being so bad as to delay 1.0, so forge ahead I did, and I eventually released the app to all of campus in February.&lt;/p&gt;&#10;&lt;h2 id="user-centered-design"&gt;User-Centered Design&lt;/h2&gt;&#10;&lt;p&gt;What really surprised me is that the largest work to be done with WSO Mobile was mostly with the user experience rather than strictly technical improvements. I eventually brought my app to both a professor at Williams who studies HCI (&lt;a href="https://csci.williams.edu/iris-howley/"&gt;Professor Iris Howley&lt;/a&gt;) and to the general Williams student public (via surveys I distributed asking for feedback in-app) and got similar responses from both sampled populations:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&amp;ldquo;There&amp;rsquo;s too many deeply-nested lists that make it hard to navigate&amp;rdquo;&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;It&amp;rsquo;s too slow to unlock / FaceID auth is annoying&amp;rdquo;&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;The menus are not laid out in the way that I think about it&amp;rdquo;&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;The app needs to more closely match the WSO website&amp;rdquo;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Upon reflection, I realized that I had been too closely thinking about things from an engineering perspective. I laid out the buttons in a way that mirrored the order that I implemented them, I had designed the menus to make it easy to test out things that I had repeatedly run into bugs with during testing, and I had the app auto-open to user profiles because the WSO user struct is very long, optionals-ridden, and parsing it correctly took me many attempts to get right.&lt;/p&gt;&#10;&lt;p&gt;This project taught me a lot about putting &lt;em&gt;the user experience&lt;/em&gt; first and foremost in my design process: what seems logical to me as someone writing the code is rarely how the end-user will think about it, and the only real way to ensure is just to get constant feedback. Going forward, I plan on making it the standard that WSO does more extensive user testing and collecting of feedback to make sure we get it right, because my initial mistakes did cost a small number of users who were not won back until I fixed their particular issue(s) with the app. In a real software development environment, that would be much more costly than it is here&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;, so I am appreciative to have learned this now.&lt;/p&gt;&#10;&lt;h2 id="looking-forward"&gt;Looking Forward&lt;/h2&gt;&#10;&lt;p&gt;I have already started work on several of the biggest user suggestions:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I flattened the structure of many menus so it&amp;rsquo;s easy to find what you are looking for, since Professor Iris suggested that people find scrolling-based menus substantially easier than deeply-nested ones (which makes a lot of sense in a world with so much infinite scrolling content).&lt;/li&gt;&#10;&lt;li&gt;It&amp;rsquo;s now substantially easier to locate and share content with your friends (I added buttons to most menus that use the iOS share sheet, and added quick swipe menus for copy-pasting).&lt;/li&gt;&#10;&lt;li&gt;I refactored a bit of the code but it&amp;rsquo;s quite a lot, so more work needs to be done (many things that were hardcoded are being converted into data structures combined with mapping/reducing, or into generics).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;That said, the biggest thing I&amp;rsquo;m happy about with the new WSO Mobile is that someone who isn&amp;rsquo;t me will probably be able to pick it up in 10 years and actually be able to understand what&amp;rsquo;s going on in there. Nearly 1 of every 8 lines is a comment describing the code in extensive detail. Hopefully, that combined with all the explanations I left here will be enough for whoever needs to do the next rewrite to have a less painful time than I did.&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;&lt;a href="https://wso.williams.edu"&gt;Williams Students Online&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:2"&gt;&#10;&lt;p&gt;Admittedly this was one of the less badly designed things in WSO&amp;rsquo;s stack, which is really saying something.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:3"&gt;&#10;&lt;p&gt;It makes sense that Williams students would own more iPhones (since they&amp;rsquo;re luxury goods), but it doesn&amp;rsquo;t explain why it&amp;rsquo;s so dominant, even amongst international students, who only have slightly more Android usage. This should be investigated at other colleges with similar demographics; I&amp;rsquo;m genuinely curious, since there&amp;rsquo;s not an obviously good reason for this.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:4"&gt;&#10;&lt;p&gt;It&amp;rsquo;s also much harder to get feedback in the real world: at Williams it&amp;rsquo;s small enough that I can email people directly for feedback, but I should probably learn more about telemetry, inferring from user behavior, and A/B testing if I hope to get similarly precise feedback in a much more impersonal environment.&amp;#160;&lt;a href="#fnref:4" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li id="fn:5"&gt;&#10;&lt;p&gt;If this describes you, please send me an email!&amp;#160;&lt;a href="#fnref:5" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="wso"/><category term="programming"/><category term="swift"/></entry><entry><title>Williams Record: WSO Mobile</title><link href="https://nsf.name/blog/williams-record-wso-mobile/"/><updated>2026-10-20T13:30:00Z</updated><summary>An archived version of the Williams Record article published on new WSO Mobile.</summary><content type="html">&lt;p&gt;In the February 11th, 2026 issue of the Williams Record&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, there was an article about the new version of WSO Mobile, which had &lt;a href="/blog/rewriting-wso-mobile-in-swift"&gt;an interesting development cycle&lt;/a&gt;. The Williams Record interviewed me about this and published an article about it; I am archiving it here verbatim for historical purposes (in case the original site goes down).&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/wso-app-graphic_hu_954904ffbccd03c8.webp" type="image/webp"&gt;&#10; &lt;img src="/images/wso-app-graphic.png"&#10; alt="Melania Espinal&amp;#39;s drawing of the WSO Mobile app"&#10; width="1108"&#10; height="1200"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;Melania Espinal/&lt;em&gt;The Williams Record&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;A new version of the Williams Students Online (WSO) mobile app was released for all iOS devices on Jan. 26. According to an email from President of WSO Nathaniel Flores ’27, the release marked the first time the app has been updated in six years.&lt;/p&gt;&#10;&lt;p&gt;WSO is a Registered Student Organization that maintains the website and mobile versions of WSO. Flores said in an interview with the Record that the changes were necessary because the old app could no longer be updated. “The software had gotten so radically out of date it wasn’t possible. The people who worked on it have long since graduated.”&lt;/p&gt;&#10;&lt;p&gt;The new WSO app has features that were not included in the previous version, like seeing future menus. According to Flores, a bug in the dining software lets students read menus before they are officially published. “You can actually see menus in the future,” he said.&lt;/p&gt;&#10;&lt;p&gt;Flores added some hidden features to the app, which, as the app’s developer, he can see if people are using. “Only like 20 people have actually found all the easter eggs,” he said. “There’s a whole hidden game no one’s found yet.”&lt;/p&gt;&#10;&lt;p&gt;The new app also contains other lesser-known features. Flores said that students should go to the “Important Links” section in their “more” tab to find links to important events and information submitted by RSOs. He said he made the links easy to submit, in the same tab, so that clubs can get more publicity for their events.&lt;/p&gt;&#10;&lt;p&gt;According to Flores, because the previous version of the app worked for both iOS and Android devices, the code was much more complicated. Nathan Vosburg ’27, the previous President of WSO who is currently studying abroad, initially tried to make improvements to the app by editing the previous iteration of WSO mobile, according to Flores. However, the original code had been written in multiple coding languages, proving a complex challenge for making adjustments. “The old app was actually a full-screen webpage,” Flores said. “It does a bunch of tricks to make it look like a normal app… So there’s a website running in the old app too. That’s messy.”&lt;/p&gt;&#10;&lt;p&gt;The decision to design a new app only compatible with iOS was a necessary one, according to Flores. Based on data collected about the app’s users, WSO leadership had discovered that most users accessed the platform from their phones, rather than the website. “We realized that the mobile experience should be better,” he said.&lt;/p&gt;&#10;&lt;p&gt;The new mobile app is written in Swift, which is Apple’s programming language. Chris Pohlmann ’27, a member of WSO, said that this made the app better to update. “It’s going to make it much easier to do more with the app,” he said.&lt;/p&gt;&#10;&lt;p&gt;WSO is also working to make an Android-compatible version of the app using the programming language Kotlin, Vosburg wrote in an email to the Record.&lt;/p&gt;&#10;&lt;p&gt;Flores said he also had personal motivation to re-create the app. “I knew it was bad, and that offended me,” he said. “I knew I could do better if I just tried.”&lt;/p&gt;&#10;&lt;p&gt;Flores and Pohlmann beta-tested the app in December in order to fix its initial bugs, inviting 73 students to download and try the new interface.&lt;/p&gt;&#10;&lt;p&gt;One of WSO’s most dedicated beta testers, Addison Kiewert ’28, tested the app 244 times, meaning they accessed 244 distinct versions of the app, each with updated code. “I thought it was really fun to just try and break the app,” they said. “My process there was like ‘Oh, I’m going to first do whatever Nathaniel says he fixed, and then tap buttons until something breaks.”&lt;/p&gt;&#10;&lt;p&gt;Kiewert recalled specific bugs that took Flores longer to fix, such as the login system. The WSO app can be downloaded by anyone, regardless of their affiliation with the College, but a unix is required to access some services like Facebook, where students can search for the names of other currently enrolled Ephs.&lt;/p&gt;&#10;&lt;p&gt;Kiewert said they consistently struggled to open the app with their unix. “The most ongoing problem was probably the login bug,” they recalled.&lt;/p&gt;&#10;&lt;p&gt;Pohlmann emphasized that the login had been a consistent bug in different versions of the beta, partially because of the separate iOS verification. “Since the app is iOS only, the entire authentication process has to go through iPhone’s Face ID feature, and that’s a pretty challenging thing to get working correctly,” he said.&lt;/p&gt;&#10;&lt;p&gt;Flores also hopes to make additions to the new app in the future “We’re going to revive Dormtrak,” he said, referring to the feature of the old WSO app where students reviewed their dorm rooms, so that other students could make educated decisions about their housing for the upcoming year.&lt;/p&gt;&#10;&lt;p&gt;Pohlmann said that Dormtrak had been offline since last year because of recent administrative decisions. “It’s not currently running because the school reassessed its policies around FERPA,” he said, referring to the Family Educational Rights and Privacy Act. The act, passed in 1974, outlines what information about students’ schools can share with third parties. Pohlmann said that these FERPA changes are also the reason why underclassmen cannot currently display their hometowns on their WSO profile.&lt;/p&gt;&#10;&lt;p&gt;Flores and Pohlmann plan to release a new version of Dormtrak in the next month. The new version will have a similar structure to the old one.&lt;/p&gt;&#10;&lt;p&gt;According to Pohlmann, Dormtrak might provide answers to questions such as “How loud is this dorm?” and “Do the pipes make noise in the winter?” he said. “It’s not something you’re going to find from the school. We’re hoping to kind of crowd-source that information.”&lt;/p&gt;&#10;&lt;p&gt;Students can also anticipate a revitalized version of Ephmatch. “I’ve been experimenting with a Tinder swipe-like interface,” Flores said.&lt;/p&gt;&#10;&lt;p&gt;This addition, however, is still in the works. “I have to think about the social consequences,” he said.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;&lt;a href="https://williamsrecord.com/"&gt;The Williams Record&lt;/a&gt;, a student-run newspaper at Williams College.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="wso"/><category term="williams-record"/></entry><entry><title>Williams Record: WSO Interview</title><link href="https://nsf.name/blog/williams-record-wso-interview/"/><updated>2026-10-20T13:30:00Z</updated><summary>An archived version of the Williams Record interview published on WSO site changes.</summary><content type="html">&lt;p&gt;In the September 17th, 2025 issue of the Williams Record&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, there was an article about the changes that had been going on to WSO, as at the time that I had joined the board officially it was somewhat in a state of disrepair and in need of some fixes. I was interviewed and I want to preserve what the Williams Record published about it; I am archiving this interview here verbatim for historical purposes (in case the original site goes down).&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;figure class="inline-image"&gt;&lt;picture&gt;&#10; &lt;source srcset="/images/wso-menu-downtime_hu_44d0c38da661d7d4.webp" type="image/webp"&gt;&#10; &lt;img src="/images/wso-menu-downtime.png"&#10; alt="Felix Barman&amp;#39;s artistic depiction of WSO downtime"&#10; width="1528"&#10; height="862"&#10; loading="lazy"&gt;&#10; &lt;/picture&gt;&lt;figcaption&gt;Felix Barman/&lt;em&gt;The Williams Record&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;From stalking classmates to rating professors to finding love, Williams Students Online (WSO) is integral to the student experience at the College. Though WSO’s analytics report more than 300,000 visits to its website since January, it is maintained and upgraded by a board of just three students. The Record spoke with WSO President Nathan Vosburg ’27 and Vice President Nathaniel Flores ’27 — the third member, Charlie Tharas ’27, is studying away — for a closer look at how the site operates and how it has changed this year.&lt;/p&gt;&#10;&lt;h3 id="what-happened-to-the-dining-menus"&gt;What happened to the dining menus?&lt;/h3&gt;&#10;&lt;p&gt;Those who remember checking WSO for dining hall menus and hours in years past may have been disappointed to find that information missing from the site and app this year. Flores said that the service broke on Sept. 7 when Dining Services launched a new menu site.&lt;/p&gt;&#10;&lt;p&gt;“[Dining] had a service for us called NetNutrition … it had an API [Application Programming Interface] which we could use to get dining data from them: hours, what’s on the menu, allergens for those specific items,” he said. “When they moved to the new website, they didn’t take down NetNutrition, they just deleted our access to see the API.”&lt;/p&gt;&#10;&lt;p&gt;Flores said that the WSO board has made attempts to get dining information back on the app but has been unsuccessful. He emphasized that he has found it difficult to communicate with dining management. “You can go talk to the dining employees you see at the dining hall, but they don’t control what’s going on in the upper echelons of dining,” he said.&lt;/p&gt;&#10;&lt;h3 id="whats-happening-on-thursday"&gt;What’s happening on Thursday?&lt;/h3&gt;&#10;&lt;p&gt;The board plans to take WSO offline on Thursday to upgrade their server. “The hardware is super old,” Flores said. “It’s from 2013-ish and it’s super outdated… Sometimes the server will have really long latency times because there are too many requests at the same time.”&lt;/p&gt;&#10;&lt;p&gt;To address this, Flores said that WSO is replacing the current hardware with a new server that will function in the same way. “[Latency is] something that can just be fixed by literally throwing more money at the problem,” he added. “So that’s exactly what we did.”&lt;/p&gt;&#10;&lt;p&gt;“That move is something I want to be really delicate about, because if we make any mistakes, it’s going to fry everyone’s Listserv,” he continued. “I don’t want to break it without telling people in advance.”&lt;/p&gt;&#10;&lt;p&gt;Flores said that WSO isn’t responsible for paying for the upgrades. “We just asked OIT [Office for Information Technology] nicely,” he said. “OIT’s amazing,” Vosburg added.&lt;/p&gt;&#10;&lt;p&gt;During the server migration, WSO will also fix security vulnerabilities in its Listserv service, Flores said.&lt;/p&gt;&#10;&lt;h3 id="can-wso-see-who-im-looking-up"&gt;Can WSO see who I’m looking up?&lt;/h3&gt;&#10;&lt;p&gt;Flores and Vosburg said they can’t, but since January, they’ve been collecting limited analytics on user activity.&lt;/p&gt;&#10;&lt;p&gt;“Whenever anyone clicks on any page on the site, it ticks up a counter by one,” Flores said. Each page on WSO’s Facebook has its own counter. “A user is unique if the IP address and the device and the login haven’t changed,” he said. “So basically, refreshing the page 1,000 times does not change your rank, but logging in from a new device with the same user and clicking on the page again works.”&lt;/p&gt;&#10;&lt;p&gt;This means that while WSO board members can’t tell who’s been looking you up, they can see roughly how many people have viewed your profile. WSO shared some of this data with the Record.&lt;/p&gt;&#10;&lt;p&gt;Between the beginning of last Winter Study and last week, the most-visited profile was viewed 399 times. However, the median profile, including faculty and staff, was viewed six times. Many of the top ten most-viewed profiles were frequent posters on the site’s boards.&lt;/p&gt;&#10;&lt;p&gt;In addition to page views, WSO collects data on the site’s busiest times. “In general, the busiest times for WSO are when big events happen on campus,” Flores said. “But also Saturday mornings between, like, 12 to 2 a.m.”&lt;/p&gt;&#10;&lt;p&gt;“My theory, I have no data to back this up … but I think people are going to parties — they meet people in a drunken haze, and then they kind of sober up around 12 to 2, and they’re like, ‘I gotta go look up who that person was,’” Flores added.&lt;/p&gt;&#10;&lt;div class="footnotes" role="doc-endnotes"&gt;&#10;&lt;hr&gt;&#10;&lt;ol&gt;&#10;&lt;li id="fn:1"&gt;&#10;&lt;p&gt;&lt;a href="https://williamsrecord.com/"&gt;The Williams Record&lt;/a&gt;, a student-run newspaper at Williams College.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;</content><category term="wso"/><category term="williams-record"/></entry></feed>