LLVM garbage collection statepoints demo

I’m looking at garbage collection with statepoints in LLVM, and with substantial difficulty I’ve got to a point where I have a working example, which I intend to fit the actual GC into later. This post is my attempt to help others get started on statepoints with less difficulty. It begins with a brief explanation… Continue reading LLVM garbage collection statepoints demo

The things you have to do for an interactive terminal interface

Programming language libraries usually expect terminal interaction to take place one print line or read line at a time, and don’t have much support for detecting keypresses or changing what’s already written on the screen. Still, POSIX and other generally followed standards allow more dynamic interaction techniques that are compatible across many systems, and this… Continue reading The things you have to do for an interactive terminal interface

Ten standard ways of representing binary numbers

If you’ve read the headline and think that ten sounds like an awful lot of different binary-number formats, perhaps you are guessing that it includes floating point, or ones’ complement and other archaic representations, but no, this is all about what’s in common current use, all integers, and all based on two’s complement. This post… Continue reading Ten standard ways of representing binary numbers

What is hidden in Aphex Twin’s WAV files?

WAV files (or WAVE as they would be called if the Quick and Dirty Operating System hadn’t had a three-character limit on file extensions), probably the most common kind of files for uncompressed PCM audio, follow a loosely defined format with ancient roots, where sections have four-character labels. Each file consists of a single “RIFF”… Continue reading What is hidden in Aphex Twin’s WAV files?

The size of silence (and other quirks in streaming FLAC to browsers)

Streaming music from the Klipspringer hub requires three components to interact asynchronously – the Java process that encodes and transmits the data, the web browser with the client-side code that receives and plays it, and the HTTP server that ties them together – so no wonder it’s been stuck in deadlock many times during development.… Continue reading The size of silence (and other quirks in streaming FLAC to browsers)

Never implement doHickey

I sometimes feel like an impostor when I talk about code design because I have absolutely no formal education in it, and I’ve been imprinted with the attitude that it’s the algorithms, their correctness and efficiency, that you’re supposed to worry about. Working on larger projects, in companies and on my own, I’ve come to… Continue reading Never implement doHickey

Optimization by doing the same thing and expecting different results

The point with a compiler is obviously that it lets us write code in language that’s easier to read than assembly code, and modern optimizing compilers can make it more readable still by saving us from obfuscating hand-optimization. For instance, in the 1980s, it may have been good for the performance of your C code to… Continue reading Optimization by doing the same thing and expecting different results

Pattern for an asynchronous resource

While I have been working on streaming capability for the Klipspringer hub (and refactored existing code in the process), a need for asynchronously providing a resource has repeatedly come up and confused me. It’s confusing because it doesn’t immediately fall in line with Javascript’s promise construct. This post describes the problem in a general way,… Continue reading Pattern for an asynchronous resource