Reflecting on my systems programming experience
This was completely written by me and no AI was used for the content below.
I have sort of a weird dichotomy of experience where I’ve flirted with systems programming at many points but I’ve been primarily frontend leaning at Palantir over the last 7 years, however upon reflection I have an interesting path when it comes to system programming. I often enjoy it, it scratches a different itch that I have in my brain that’s less user facing but sometimes it’s cool to see something go way faster than a sluggish web UI or a bloated JVM/Python program; something that truly utilizes the full power of your machine and goes brrr.
A tough start
I distinctly remember despairing my first data structures and algorithms class, it was all in C and I was a middling programmer at best. I had taken one intro to programming class at UNM. It was in Java, and the complexity of that language was a lot to dive into. The first day being “oh yeah this thing starts with public static void main(String[] args), we’ll explain that later…”. C on the other hand was extremely low level and I was struggling in the beginning, manually parsing all the command line arguments we had for each project was very different from what I was used to as was caring about the low level types and the sizes of numbers, etc.
My first project was about doing Monte Carlo simulations of poker hands to calculate the probability of each hand. This should be something I was good at/interested in! I regularly played poker with my friends. However, I kept getting results that made no sense and corrupted results and really no idea why. I can’t remember the exact debugging steps but the end cause was that either I had an array of cards and I was off by 1 with the size of the deck or I was not zero indexing and was going slightly out of bounds each time I’d access the ends of the deck, corrupting the memory of my program without segmentation fault, truly the worst outcome.
I do remember I fixed one constant and the whole program worked. It was the night before the project was due, crisis averted. I was seriously questioning my competence at this whole programming thing and wondering if business school & IT was more my speed.
Confidence gained
[Lisp] is the only computer language that is beautiful. - Neal Stephenson
I’d rather write programs to write programs than write programs. -D. Sites
What I cannot create I do not understand. - R. Feynman
Lance Williams at UNM and his CS 357: Declarative and functional programming (and his other courses I took with him) was incredibly inspiring to me throughout my college years. Going from something abstract, high level, and hard to wrap my head around beginning with Java and its leaky abstractions to low level C which I was starting to get more confident in because I could reasonably understand how it worked to something high level, mathematical, and in many ways philosophical like Lisp and Haskell was a paradigm shift to me in many ways.
“How is this related to systems programming?” you may be asking. At first it’s not obvious but it introduced the concept of writing programs that write programs and this concept really hooked me. Writing Lisp functions that are indistinguishable from the what’s built-in to the language is a paradigm shift coming from languages that have these concrete immutable concepts, you can’t change how classes work in Java, you can’t add in new primitive types, etc.
This extended into writing parsers and interpreters in Haskell. I took a types and programming languages course that was very abstract and theoretical but we ended up implementing a full lambda calculus language parsed and interpreted in Haskell and I’d go on to write a BASIC interpreter and a brainfuck interpreter during my course work.
Getting paid for systems programming
At Sandia Labs, one of the teams I was on was building software frameworks for an image processing pipeline. Here I got deep on C++ and learned a lot of the modern semantics with the smart pointer types (unique_ptr, shared_ptr, etc) and got experience with RAII (Resource Acquisition Is Initialization) for managing memory in a simpler way. We made both C++ and Java frameworks for making services for these traditionally “one box” image processing processes. It included supporting custom configuration file formats, code generation into C++, Java, Python from software architecture file formats, and cross process telemetry between services that were defined by the architects.
As an intern at Sandia Labs, I made a suite of compiler extension tools for a large satellite ground system codebase that would do static analysis and code generation. It would analyze different C++ classes and structs and generate code in a proprietary serialization format. I found this extremely interesting, but the code base was not set up to work with modern compilers well (it used a custom pearl script build system) so there were weird gaps for what would work with the LLVM tooling that needed to be fixed with a broader build system modernization project, however it worked in a number of cases due to how flexible Clang is.
Re-igniting my interest for systems programming
You can see I’ve experimented with other system programming languages over the years, I went to a few conferences and took classes on Go and Rust and played with them a bit go-snake, rust-exercises.
Recently I ported over the Go snake to Rust and my BASIC Haskell interpreter to Rust. Rust scratches that functional programming itch a bit and it seems quite good for building an interpreter. I also have investigated a bit how to have the rust-basic to have an LLVM (which powers clang) backend. I haven’t mastered the borrow checker yet.
I’m not sure where my re-ignited interest might lead, but it’s interesting to reflect on my history with it and recognize it as a tool that could be useful in the future depending on the opportunity. Writing programs that write programs will always be interesting to me and I hope I can apply it more in the future.
Now that frontier models are so good, I think they excel at writing code in strongly typed and strict languages such as TypeScript and Rust. As much fun as Python was to write, having a compiled strongly typed language gives me a lot more confidence that the end result will be correct and it helps the model help itself. My apps on this website are primarily in TypeScript with a number of the stricter compile options enabled and it catches a lot of issues before a human will see them.