Posts
-
Why I Stopped Using Go (For Now)
PublishedDec 12, 2024 This year I had made a goal to learn Go. I've had many starts and stops with learning Go, but I wanted to at least make a full program in Go this year (that wasn't from a tutorial). … -
Fast CSV parsing in Zig
PublishedNov 7, 2024 Recently, I was using Zig and was trying to avoid memory allocations. My program was generating data based on user input, but I needed a way to format the data for use in other programs. I was also only keeping one record in memory at a time to limit memory usage. So, I wanted a data format that could write a single record at a time, and I wanted to write to a writer so I could write straight to a socket or disk as needed. I also wanted to avoid introducing memory allocations while serializing. The first thing I did was look at the Zig standard library, but I couldn't find anything that fit my needs. I also looked at some libraries, but didn't find anything there. So I wrote my own CSV encoder, which wasn't very hard. But, once I got a writer I thought "how hard is it to write a fast CSV parser?" That question turned into a much bigger project, so let's dive in! … -
TigerBeetle and NASA reliability
PublishedOct 31, 2024 Last time I posted I talked about Erlang and how it has built-in error recovery to maintain reliable systems. Erlang's error recovery is based on monitoring processes and automatically restarting subsystems to a known good state when a process fails. This happens at the cost of any data inside of the restarted processes. The built-in error recovery allows Erlang to keep functioning even in the face of errors, network partitions, and bugs. It's an interesting paradigm since it approaches the problem differently than more traditional "try/catch what you can and crash otherwise" mentality. … -
Venture into Erlang
PublishedJun 28, 2024 Recently I've been exploring Erlang and the OTP. As I've been trying things out, some aspects of the design Erlang and the OTP have finally started to click. I'm writing this blog post about my experiences with Erlang and the OTP so far. … -
A return to Clojure
PublishedJun 15, 2024 Recently I started using Clojure again. It's been a while since I've used it. I'm recording my thoughts and impressions as I get back to using it. The experience doesn't feel like it changed much over the past few years, which is both good and bad. This is more of a post of my thoughts rather than having a clear direction. … -
A journey across editors
PublishedFeb 17, 2024 Often I hear developer journeys through the programming languages they used or the companies they worked for. Sometimes it's told through frameworks learned or projects released or mistakes made. I'll probably tell my story a few times using some of those common methods. But today I thought I'd do something different. Instead of telling it in languages learned or frameworks worked with, I'm going to tell it in editors I used. … -
A site for my experiments
PublishedFeb 1, 2024 I recently created a website which holds a lot of my experiments. Some of these experiments either make it into my blog or they form the basis of some of my blog posts. Many of them don't make it into my blog posts. Instead of just letting them sit in the dark, I decided to put some of them on an experiments site. … -
C++ to JavaScript with Cheerp
PublishedJan 7, 2024 Lately I've been exploring different ways to make C and C++ code run in the web browser. I compiled one of my C/C++ libraries to WASM with Emscripten and Embind (details in Chapter ). I also made a maze program in C and SDL2 and got that working via Emscripten. Emscripten is great, but it only compiles to WASM. … -
Creating a WASM Library with Embind
PublishedDec 13, 2023 I've been working on my Test Jam project for a while. I had previously tried to do a WASM wrapper around my C/C++ build, but I ran into a memory leak which existed outside the C/C++ code. Instead of reading the manual, I rewrote the code in TypeScript. After the rewrite, I read the manual and learned what was the source of the leak. I then rebuilt my WASM wrapper and ended up with a TypeScript and WASM implementation. I then decided to start comparing the two implementations to see what the benefits and drawbacks are. I also wanted to test some well touted claims about WASM (e.g. performance, code reuse) in the context of a library. So I started poking and prodding, and then I created this post. … -
Overview of globally unique identifiers
PublishedDec 2, 2023 Recently I saw that CUID, a way to generate unique IDs, had been deprecated due to security concerns. That got me really curious. I haven't ever thought of IDs as being "secure." Instead, I've always treated them as untrusted, public-knowledge values. I've always built access controls around my IDs, even when they were randomly generated GUIDs. So I started looking at a lot of ID generators to see if this concept of "secure ids" really did exist, what meant, and what other properties IDs had. … -
Unsigned Integers in JavaScript
PublishedNov 30, 2023 Lately I've been experimenting with creating random data generators in TypeScript. I wanted to avoid using the global random number generator Math.random since I wanted my generators to be fully determinitic (i.e. if you give them the same input, they will always return the same output). I also wanted a seed to be passed in every time, which meant that I'd be creating a new generator every time. … -
Writing a Property test library
PublishedNov 28, 2023 In a previous post I talked about property testing (see ). In that post, I discussed the difference between property tests and more traditional example-based testing, how to write property tests, and the shortcomings of property tests. If you'd like to learn more about property testing, then go give that article a read. … -
What is property testing?
PublishedOct 23, 2023 Property testing is a developmental approach to writing tests (both unit tests and integration tests) which helps developers find the limitations of their software. It isn't an all-encompassing set of principles or practices which impacts the whole development lifecycle, unlike Test Driven Development. Instead, it's isolated to the testing process, and it focuses on procedurally generating test inputs and then checking the properties of the output, rather than relying on a predefined list of "Input X gives Output Y." … -
Error Handling Across Programming Languages
PublishedSep 10, 2023 One of the most frustrating yet fascinating facets of using a programming language is how it handles errors. Many of these error handling patterns include the traditional try/catch, error flags, unions, multiple return values, error paths, etc. These patterns are fascinating to investigate and see the various methodologies and practices languages and libraries have used to implement them. This is by no means an exhaustive list or investigation. Rather, it's a review of what I've personally experienced with error handling. … -
Stateless Logic
PublishedSep 9, 2023 State is some form of "global" or "shared" memory. It allows code to "remember" or "know" something without having to be retold that fact every time. For instance, let's consider a simple count method which tracks how many times the method was called. Below is an example using state: …