Gemini Articles of Interest
A Gemini client* is needed for the following links.
-
Docker Compose to Kubernetes with Kompose
I really love using docker compose for local development. Whenever I start writing a service with any kind of external dependencies (databases, containerized APIs etc), I quickly setup a `docker-compose.yaml' for the project to allow me to try it out locally. I've heard murmurings that this is not what you should do anymore, instead you should use Kubernetes to do this. While I do like Kubernetes, I definitely prefer the simplicity of the docker-compose.yaml format. Writing a simple `docker-compose.yaml' file takes a few minutes, writing the correct Kubernetes manifests to achieve the same thing takes considerably longer.
-
Binary Coded Decimal
Like many others I'm trying to implement a GameBoy emulator. The development is sporadic to say the least and mostly occurs when I happen to have both some time and inspiration to spare. I'm still implementing the CPU instructions, and this week I came to the one called DAA (Decimal Adjust Accumulator according to the GameBoy Programming manual). I mostly wanted to summarize my findings to have something to refer back to later, but maybe this someone out there will find it useful as well.
The purpose of the DAA instruction is to correct a value which resulted from addition or subtraction of numbers in Binary Coded Decimal (BCD) representation. Since I had no idea what BCD was, I had to do some digging. Below are some notes to help me remember this for later.
-
Statically-Typed languages Are Just Not Good Engineering
Over the past 40 years I've used (and disliked) many languages. To provide some context, I've written a bunch of compilers and code-generating thingamajigs, and have not seen anything better than Common Lisp as high-level languages go.
And so I take an exception to including Common Lisp into the broad category of badly-engineered dynamic-typing languages, because I don't think that any part of that description fits.
Common Lisp has a pretty good type system, which you may choose to completely ignore. Modern CL compilers _infer_ type all by themselves, and if you care about types, you can provide declarations at a _per-scope level_, specifying with any degree of precision, the types you expect certain things to be, including combinations of types with a variety of logic operators.
-
Dynamic Typing is Fine
The upshot is that most of the studies have limitations that limit their general applicability, but if you wanted to take home a message from them, in aggregate, it's that if static typing provides stability/reliability/maintainability benefits to programs, the effect is very, very small. But also likewise, if dynamic typing provides a benefit to developer productivity, it is also very, very small.
There are a couple of studies that both come to about the same estimate of what percentage of errors in dynamically-typed languages are from type errors — about two (2) percent. It ought to follow that this is about the reliability benefit that you should expect to see from using static typing.
-
A base32 decoder
For reasons behind the scope of this entry, I had to decode some data encoded in base32. After an embarrassing moment where i used EVP_DecodeBlock from libcrypto because apparently I can’t read (it’s a base64, not 32, decoder), I discovered that libcrypto doesn’t provide a base32 decoder. Probably some other popular library provides it, but since I was hacking in a project that only uses libc and libcrypto as dependencies, I wrote one.
Decoding base32-encoded data is not difficult, the encoding scheme is very, very simple, so why bother writing a post about it? Well, before writing my own decoder I searched on the web if there was something I could stole and, hum, I didn’t like what I found, too over engineered. I haven’t looked too much, so apologize if I’ve missed your sexy decoder.
* Gemini links can be opened using Gemini software. It’s like the World Wide Web but a lot lighter.