<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: ludocode</title><link>https://news.ycombinator.com/user?id=ludocode</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 23 Apr 2026 01:23:29 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=ludocode" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by ludocode in "5x5 Pixel font for tiny screens"]]></title><description><![CDATA[
<p>The 5x5 is very nice, and the 3x5 isn't bad either. Unfortunately neither of them have all of ASCII. The size is also a bit misleading because you need to add spacing so really they need a 6x6 or 4x6 grid.<p>I'm quite fond of Spleen:<p><a href="https://github.com/fcambus/spleen" rel="nofollow">https://github.com/fcambus/spleen</a><p>It has a 5x8 font which has all of ASCII, but most glyphs are actually 4x8 and include horizontal spacing. I modified it to reduce the rest for a project I'm doing so all glyphs are 4x8. The result can be rendered on a 5x9 grid with a guaranteed line of horizontal and vertical spacing between all glyphs. It's very nice.</p>
]]></description><pubDate>Wed, 22 Apr 2026 19:15:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=47867985</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=47867985</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47867985</guid></item><item><title><![CDATA[New comment by ludocode in "C89cc.sh – standalone C89/ELF64 compiler in pure portable shell"]]></title><description><![CDATA[
<p>I'm the author of Onramp. Thanks for linking it!<p>One of the VMs I wrote for Onramp is in POSIX shell [1]. This was intended to make C bootstrappable on any POSIX system of any architecture with nothing besides the shell. Unfortunately it's about 100,000x too slow to be useful. It's also at least as complicated as a machine code VM. I've since mostly abandoned the POSIX shell idea.<p>Onramp does have a very simple C89 VM though, and its purpose is for bootstrapping modern C on systems that have only a basic C compiler [2]. So this c89cc.sh could in theory work. I tried it and unfortunately it doesn't quite compile yet (and doesn't give a comprehensible error message either.) Even if it worked, c89cc.sh only compiles to x86_64 ELF, and it's way more complicated than the x86_64 ELF machine code Onramp VM [3].<p>This has been a bit of a recurring theme with Onramp: anything I've tried to get away from the initial machine code stages ends up being more complicated than handwritten machine code. Still, it's nice to have a lot of different ways to bootstrap. I love seeing projects like this and I'm glad to see more people taking bootstrapping seriously.<p>[1]: <a href="https://github.com/ludocode/onramp/blob/develop/platform/vm/sh/vm.sh" rel="nofollow">https://github.com/ludocode/onramp/blob/develop/platform/vm/...</a><p>[2]: <a href="https://github.com/ludocode/onramp/blob/develop/platform/vm/c89/vm.c" rel="nofollow">https://github.com/ludocode/onramp/blob/develop/platform/vm/...</a><p>[3]: <a href="https://github.com/ludocode/onramp/blob/develop/platform/vm/x86_64-linux/vm.ohx" rel="nofollow">https://github.com/ludocode/onramp/blob/develop/platform/vm/...</a></p>
]]></description><pubDate>Fri, 03 Apr 2026 15:32:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=47627903</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=47627903</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47627903</guid></item><item><title><![CDATA[New comment by ludocode in "Stop Doom Scrolling, Start Doom Coding: Build via the terminal from your phone"]]></title><description><![CDATA[
<p>I just use ConnectBot to ssh to my house. It runs tmux and vim well, especially with a little pocket-size folding bluetooth keyboard to go with it.</p>
]]></description><pubDate>Tue, 06 Jan 2026 23:06:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=46520132</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=46520132</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46520132</guid></item><item><title><![CDATA[New comment by ludocode in "MD RAID or DRBD can be broken from userspace when using O_DIRECT"]]></title><description><![CDATA[
<p>These filesystems are not really alternatives because mdraid supports features those filesystems do not. For example, parity raid is still broken in btrfs (so it effectively does not support it), and last I checked zfs can't grow a parity raid array while mdraid can.<p>I run btrfs on top of mdraid in RAID6 so I can incrementally grow it while still having copy-on-write, checksums, snapshots, etc.<p>I hope that one day btrfs fixes its parity raid or bcachefs will become stable enough to fully replace mdraid. In the meantime I'll continue using mdraid with a copy-on-write filesystem on top.</p>
]]></description><pubDate>Sat, 18 Oct 2025 15:48:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=45628246</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=45628246</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45628246</guid></item><item><title><![CDATA[New comment by ludocode in "Self hosting 10TB in S3 on a framework laptop and disks"]]></title><description><![CDATA[
<p>Here's a link to the case on the Framework marketplace:<p><a href="https://frame.work/ca/en/products/cooler-master-mainboard-case" rel="nofollow">https://frame.work/ca/en/products/cooler-master-mainboard-ca...</a><p>I put my original mainboard in one of these when I upgraded. It's fantastic. I had it VESA-mounted to the back of a monitor for a while which made a great desktop PC. Now I use it as an HTPC.</p>
]]></description><pubDate>Sun, 05 Oct 2025 20:09:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=45484768</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=45484768</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45484768</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a C compiler in 500 lines of Python (2023)"]]></title><description><![CDATA[
<p>Indeed, a decent closed hash table is maybe 30 lines. An open hash table with linear probing is even less, especially if you don't need to remove entries. It's almost identical to a linear search through an array; you just change where you start iterating.<p>In my first stage Onramp linker [1], converting linear search to an open hash table adds a grand total of 24 bytecode instructions, including the FNV-1a hash function. There's no reason to ever linear search a symbol table.<p>[1]: <a href="https://github.com/ludocode/onramp/blob/develop/core/ld/0-global/ld.oe.ohx" rel="nofollow">https://github.com/ludocode/onramp/blob/develop/core/ld/0-gl...</a></p>
]]></description><pubDate>Wed, 03 Sep 2025 22:42:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=45121165</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=45121165</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45121165</guid></item><item><title><![CDATA[New comment by ludocode in "Show HN: Onramp Can Compile Doom"]]></title><description><![CDATA[
<p>Oh, amazing! I've heard of DuskOS before but I didn't realize its C compiler was written in Forth.<p>Looks like it makes quite a few changes to C so it can't really run unmodified C code. I wonder how much work it would take to convert a full C compiler into something DuskCC can compile.<p>One of my goals with Onramp is to compile as much unmodified POSIX-style C code as possible without having to implement a full POSIX system. For example Onramp will never support a real fork() because the VM doesn't have virtual memory, but I do want to implement vfork() and exec().</p>
]]></description><pubDate>Wed, 01 Jan 2025 00:13:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=42562875</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=42562875</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42562875</guid></item><item><title><![CDATA[New comment by ludocode in "Show HN: Onramp Can Compile Doom"]]></title><description><![CDATA[
<p>Indeed! An eventual goal of Onramp is to bootstrap in freestanding so we can boot directly into the VM without an OS. This eliminates all binaries except for the firmware of the machine. The stage0/live-bootstrap team has already accomplished this so we know it's possible. Eliminating firmware is platform-dependent and mostly outside the scope of Onramp but it's certainly something I'd like to do as a related bootstrap project.<p>A modern UEFI is probably a million lines of code so there's a huge firmware trust surface there. One way to eliminate this would be to bootstrap on much simpler hardware. A rosco_m68k [1] is an example, one that has requires no third party firmware at all aside from the non-programmable microcode of the processor. (A Motorola 68010 is thousands of times slower than a modern processor so the bootstrap would take days, but that's fine, I can wait!)<p>Of course there's still the issue of trusting that the data isn't modified getting into the machine. For example you have to trust the tools you're using to flash EEPROM chips, or if you're using an SD card reader you have to trust its firmware. You also have to trust that your chips are legit, that the Motorola 68010 isn't a modern fake that emulates it while compromising it somehow. If you had the resources you'd probably want to x-ray the whole board at a minimum to make sure the chips are real. As for trusting ROM, I have some crazy ideas on how to get data into the machine in a trustable way, but I'm not quite ready to embarrass myself by saying them out loud yet :)<p>[1]: <a href="https://rosco-m68k.com/" rel="nofollow">https://rosco-m68k.com/</a></p>
]]></description><pubDate>Tue, 31 Dec 2024 20:20:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=42561525</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=42561525</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42561525</guid></item><item><title><![CDATA[New comment by ludocode in "Show HN: Onramp Can Compile Doom"]]></title><description><![CDATA[
<p>Author here. I think my opinion would be about the same as the authors of the stage0 project [1]. They invested quite a bit of time trying to get Forth to work but ultimately abandoned it. Forth has been suggested often for bootstrapping a C compiler, and I hope someone does it someday, but so far no one has succeeded.<p>Programming for a stack machine is really hard, whereas programming for a register machine is comparatively easy. I designed the Onramp VM specifically to be easy to program in bytecode, while also being easy to implement in machine code. Onramp bootstraps through the same linker and assembly languages that are used in a traditional C compilation process so there are no detours into any other languages like Forth (or Scheme, which live-bootstrap does with mescc.)<p>tl;dr I'm not really convinced that Forth would simplify things, but I'd love to be proven wrong!<p>[1]: <a href="https://github.com/oriansj/stage0?tab=readme-ov-file#forth">https://github.com/oriansj/stage0?tab=readme-ov-file#forth</a></p>
]]></description><pubDate>Tue, 31 Dec 2024 19:48:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=42561285</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=42561285</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42561285</guid></item><item><title><![CDATA[Show HN: Onramp Can Compile Doom]]></title><description><![CDATA[
<p>Article URL: <a href="https://ludocode.com/blog/onramp-can-compile-doom">https://ludocode.com/blog/onramp-can-compile-doom</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=42547086">https://news.ycombinator.com/item?id=42547086</a></p>
<p>Points: 79</p>
<p># Comments: 24</p>
]]></description><pubDate>Mon, 30 Dec 2024 06:40:05 +0000</pubDate><link>https://ludocode.com/blog/onramp-can-compile-doom</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=42547086</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42547086</guid></item><item><title><![CDATA[New comment by ludocode in "C64 Basic Tutorial: Using String Manipulation to Write a Text Adventure"]]></title><description><![CDATA[
<p>That might be rather more difficult than you might expect. Advent of Code uses quite a lot of 64-bit numbers. A bit of googling tells me C64 BASIC only supports 16-bit integers and 32-bit floats. I imagine the other BASICs have similar limitations.<p>I did 2023 Advent of Code with my own compiler and this was the biggest challenge I ran into. I only had 32-bit integers at the time so I had to manually implement 64-bit math and number formatting within the language to be able to do the puzzles. You would probably have to do the same in BASIC.</p>
]]></description><pubDate>Thu, 05 Dec 2024 05:31:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=42325261</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=42325261</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42325261</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a Rust compiler in C"]]></title><description><![CDATA[
<p>The current version of rustc may compile itself quickly, but remember, this is after nearly ten years of compiler optimizations. Older versions were much slower.<p>I seem to recall complaints that old rustc would take many hours to compile itself. Even if it takes on average, say, two hours to compile itself, that's well over a week to bootstrap all the way from 0.7 to present. You're right that months is probably an exaggeration, but I suspect it might take a fair bit longer than a week. The truth is probably somewhere in the middle, though I suppose there's no way to know without trying it.</p>
]]></description><pubDate>Mon, 26 Aug 2024 20:54:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=41362041</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=41362041</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41362041</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a Rust compiler in C"]]></title><description><![CDATA[
<p>The minimum tool that bootstrapping projects tend to start with is a hex monitor. That is, a simple-as-possible tool that converts hexadecimal bytes of input into raw bytes in memory, and then jumps to it.<p>You need some way of getting this hex tool in memory of course. On traditional computers this could be done on front panel switches, but of course modern computers don't have those anymore. You could also imagine it hand-woven into core rope memory for example, which could then be connected directly to the CPU at its boot address. There are many options here; getting the hex tool running is very platform-specific.<p>Once you have a hex tool, you can then use that to input the next stage, which is written in commented hexadecimal source code. The next tool then adds a few features, and so does the tool after that, and so on, eventually working your way up to assembly and C.</p>
]]></description><pubDate>Mon, 26 Aug 2024 04:58:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=41354144</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=41354144</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41354144</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a Rust compiler in C"]]></title><description><![CDATA[
<p>The generated C code could contain a backdoor. Generated C is not really auditable so there would be no way to tell that the code is compromised.</p>
]]></description><pubDate>Mon, 26 Aug 2024 01:22:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=41353110</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=41353110</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41353110</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a Rust compiler in C"]]></title><description><![CDATA[
<p>It can be difficult to explain why bootstrapping is important. I put a "Why?" section in the README of my own bootstrapping compiler [0] for this reason.<p>Security is a big reason and it's one the bootstrappable team tend to focus on. In order to avoid the trusting trust problem and other attacks (like the recent xz backdoor), we need to be able to bootstrap everything from pure source code. They go as far as deleting all pre-generated files to ensure that they only rely on things that are hand-written and auditable. So bootstrapping Python for example is pretty complicated because the source contains code generated by Python scripts.<p>I'm much more interested in the cultural preservation aspect of it. We want to preserve contemporary media for future archaeologists, for example in the Arctic World Archive [1]. Unfortunately it's pointless if they have no way to decode it. So what do we do? We can preserve the specs, but we can't really expect them to implement x265 and everything else they would need from scratch. We can preserve binaries, but then they'd need to either get thousand-year-old hardware running or virtualize a thousand-year-old CPU. We can give them, say, a definition of a simple Lisp, and then give them code that runs on that, but then who's going to implement x265 in a basic Lisp? None of this is really practical.<p>That's why in my project I made a simple virtual machine, then bootstrapped C on top of it. It's trivially portable, not just to present-day architectures but to future and alien architectures as well. Any future archaeologist or alien civilization could implement the VM in a day, then run the C bootstrap on it, then compile ffmpeg or whatever and decode our media. There are no black boxes here: it's all debuggable, auditable, open, handwritten source code.<p>[0]: <a href="https://github.com/ludocode/onramp?tab=readme-ov-file#why-bootstrap">https://github.com/ludocode/onramp?tab=readme-ov-file#why-bo...</a><p>[1]: <a href="https://en.wikipedia.org/wiki/Arctic_World_Archive" rel="nofollow">https://en.wikipedia.org/wiki/Arctic_World_Archive</a></p>
]]></description><pubDate>Mon, 26 Aug 2024 00:54:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=41352938</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=41352938</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41352938</guid></item><item><title><![CDATA[New comment by ludocode in "Writing a Rust compiler in C"]]></title><description><![CDATA[
<p>While it is <i>technically</i> possible to bootstrap Rust from Guile and the 0.7 Rust compiler, you would need to recompile the Rust compiler about a hundred times. Each step takes hours, and you can't skip any steps because, like he said, 1.80 requires 1.79, 1.79 requires 1.78, and so on all the way back to 0.7. Even if fully automated, this bootstrap would take months.<p>Moreover, I believe the earlier versions of rustc only output LLVM, so you need to bootstrap a C++ compiler to compile LLVM anyway. If you have a C++ compiler, you might as well compile mrustc. Currently, mrustc only supports rustc 1.54, so you'd still have to compile through some 35 versions of it.<p>None of this is practical. The goal of Dozer (this project) is to be able to bootstrap a small C compiler, compile Dozer, and use it to directly compile the latest rustc. This gives you Rust right away without having to bootstrap C++ or anything else in between.</p>
]]></description><pubDate>Mon, 26 Aug 2024 00:33:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=41352796</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=41352796</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41352796</guid></item><item><title><![CDATA[New comment by ludocode in "The Ken Thompson Hack"]]></title><description><![CDATA[
<p>It is true that there are many layers of code below the OS level. UEFI for example is probably hundreds of thousands of lines of compiled code. Modern processors have Intel IME and equivalent with their own secret firmware. Almost all modern peripherals will have microcontrollers with their own compiled code.<p>These are all genuine attack vectors but they are not really solvable from the software side. At least for Onramp I consider these problems to be out of scope. It may be possible to solve these with open hardware but a solution will look very different from the kind of software bootstrapping we're doing.</p>
]]></description><pubDate>Sat, 30 Mar 2024 18:39:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=39877455</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=39877455</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39877455</guid></item><item><title><![CDATA[New comment by ludocode in "The Ken Thompson Hack"]]></title><description><![CDATA[
<p>The team at bootstrappable.org have been working very hard at creating compilers that can bootstrap from scratch to prevent this kind of attack (the "trusting trust" attack is another name for it.) They've gotten to the point where they can bootstrap in freestanding so they don't need to trust any OS binaries anymore (see builder-hex0.)<p>I've spent a lot of my spare time the past year or so working on my own attempt at a portable bootstrappable compiler. It's partly to prevent this attack, and also partly so that future archaeologists can easily bootstrap C even if their computer architectures can't run any binaries from the present day.<p><a href="https://github.com/ludocode/onramp">https://github.com/ludocode/onramp</a><p>It's nowhere near done but I'm starting a new job soon so I felt like I needed to publish what I have. It does at least bootstrap from handwritten x86_64 machine code up to a compiler for most of C89, and I'm working on the final stage that will hopefully be able to compile TinyCC and other similar C compilers soon.</p>
]]></description><pubDate>Sat, 30 Mar 2024 14:31:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=39875249</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=39875249</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39875249</guid></item><item><title><![CDATA[New comment by ludocode in "Dear Paul Graham, there is no cookie banner law"]]></title><description><![CDATA[
<p>> That’t not "doing sketchy shit with people's data"<p>Of course it is. If you add AdSense to your website you are letting Google track your users in exchange for a cut of the profits. Of course you should have to warn your users that they are being tracked at the very least.</p>
]]></description><pubDate>Mon, 18 Mar 2024 12:31:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=39743409</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=39743409</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39743409</guid></item><item><title><![CDATA[New comment by ludocode in "Compiling History: A brief tour of C compilers"]]></title><description><![CDATA[
<p>I was definitely hoping for a look at modern compilers. This article was written last month, yet its history ends with the release of LLVM. There's quite a lot of development in small C compilers lately!<p>- TinyCC, SCC (Simple C Compiler) and Kefir are all fairly serious projects in active development.<p>- QBE is a new optimizing backend much simpler than LLVM; cproc and cparser are two of the C compilers that target it, in addition to its own minic.<p>- There's the bootstrapping work of stage0, M2-Planet, and mescc.<p>- chibicc is an educational C compiler based on the author's earlier 8cc compiler. The author is writing a book about it.<p>- lacc is another simple compiler that works well, although development appears to have stalled.<p>I think a lot of these projects are inspired by the problem that GCC and Clang/LLVM are now gigantic C++ projects. A pure C system like OpenBSD or Linux/musl/BusyBox ought to be able to compile itself without relying on C++. We really need a production quality open source C compiler that is actually written in C. I'm hopeful one of these compilers can achieve that someday.</p>
]]></description><pubDate>Wed, 14 Feb 2024 07:47:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=39367523</link><dc:creator>ludocode</dc:creator><comments>https://news.ycombinator.com/item?id=39367523</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39367523</guid></item></channel></rss>