HNHacker News
TopNewBestAskShowJobs

kookiz

2 karma · joined October 17, 2023

submissionscomments
kookiz··on Fable wrote a .NET GC in C#, got within range of the stock GC in 2 days
My ".NET GC written in C#" project is coded by hand, bit by bit, as an educational project. But I couldn't resist the temptation of having Fable "speedrun" the project and show me a glimpse of what it could look like if I had more time.

So I let Fable work autonomously on it, with a few constraints: - Mark&Sweep GC, no compaction - Supports 64-bit applications only - Using only the GC API, can't fork the runtime (which means using the default write barrier, and not being able to use a read barrier) - And of course, in C#

Within those constraints, the model was free to make all the technical choices it wanted.

Two days later, it got within range of the .NET GC, beating it in GCPerfSim but behind on more realistic workloads (TechEmpower Fortunes benchmark).

Source code and description are available on the github repository: https://github.com/kevingosse/ManagedDotnetGC/tree/claude/ex...

kookiz··on Writing a .NET Garbage Collector in C# – Part 2
In the first part, we prepared the project and fixed an initialization issue caused by the NativeAOT toolchain. In this second part, we’re going to start the implementation of our GC. The target for now is to build the simplest possible GC that can run basic .NET applications. This GC will only allocate memory and never free it.
kookiz··on Crash in the Crash-Analyzer
When the tool you write to debug crashes crashes. A story of advanced printf-debugging.
kookiz··on Memory Alignment of Doubles in C#
Deep into how arrays of doubles are aligned in .NET. With juicy bits about the allocation context, fake objects, and C# code that definitely shouldn't be deployed in production.