It should come as no big surprise if you've been reading this blog that a big
passion in my life is programming. It has been a hobby of mine since sometime
in the nineties (probably 1994, 95 or somewhere around this - my oldest "proof"
of something I wrote is the small BBS intro flower.com
which is dated
September 1996) and my primary way to make my living since 1999, apart from a
few years in the 2000s when I was working as a Support Technician.
During the years since I started programming, I've produced a number of different projects on my spare time, of various size and grade of "seriosity". Here is a list of some of these projects. I'm hoping to add more links to this list over time, adding binaries and sometimes the source code (in the cases where it hasn't gotten lost over the years.) Many have been solo projects, others have been cooperative projects with my brother Johannes Ridderstedt, who has been an invaluable source of help and inspiration when learning about computer hardware, software and programming. This list wouldn't be what it is without him - thanks bro, I owe you a lot!
autochaos
, a build-tool for generating Makefile
s for building chaos.
autoconf & automake-replacement better suited for our needs. (Perl)2007: Imported the chaos code to CVS, did some minor hacking. The most
interesting part was that I actually got the ne2000
server working here to
the point of being able to ping the chaos host from another computer. :)
Full list of commits for the year is here.
2008: cocos, a simple operating system-like toy for x86-64. (C & x86 assembly)
2008: Spent some minor work on chaos, trying to get the system compilable with gcc-4.1, and making it possible to cross-compile from macOS. I eventually discarded this approach and set up a proper dev environment with Vagrant instead.
Full list of commits for the year is here.
2013: Billigaste Matkassen, a shopping price analyzing helper. Web app written using JavaScript & jQuery with backend in Ruby, using Redis as data store.
2013: Imported the chaos source code to
GitHub and started working on some
general cleanups, like removing GPL copyright file headers, changing from C to
C++ comment-style and working towards making the system buildable with
Rake, eventually replacing our own autochaos
build system. I think I also might have started making the system work on more
recent gcc
versions here or in 2015, since 2.95 was rather outdated at this
point...
Full list of commits for the year is here.
2014: Had a baby boy and a very hectic year at work, so not very much time for any hobby programming at all.
2015: Continued towards making more and more parts of chaos
working again,
along with general cleanups. Also experimented with adding support for writing
parts of the system in Rust.
Full list of commits for the year is here.
2016: changelog-rs, a little utility I wrote to get more acquainted with Rust, as well as to be a help with creating releases of various software packages at work.
2016: Had a nice "hacking weekend" with my brother, experimenting with a Raspberry Pi port of chaos.
2017:
2018: A year where I spent a lot of time job-hunting, preparing for interviews etc. I also ended up switching jobs in August after exactly 10 years with my previous employer.
notime
project; I needed to get some of our existing
time-tracking related data into CouchDB for usage in my new app. This was
also an interesting experiment with writing C# on macOS, using .NET Core.
I remember it was nice to get back to the world of compiled languages
after having worked mostly with Ruby; the speed increase when crunching
fairly large volumes of data was pleasant. It was also nice to get back to
statically typed languages as well. OTOH, .NET Core had its disadvantages
as a platform as well, especially at this early stage.notime
; I didn't get it very far but still. I think it was after
working on this that I wrote the "My first impressions of Node.js" blog
post.
It was my first real project using Node.js as a backend platform and not
just for wrestling with CLI stuff.2019: Went to two shorter online courses in Computer Science at Uppsala University. It was nice, but in the end it felt hard to find the proper time to both be working full-time, parenting four children and in addition to that also find time to study in the evenings, so I decided to take a break with my studies after the 2nd course.
chaos (42h). Decided to make a new attempt at fixing the soundblaster
server
(the previous attempt was the year before), with the end goal of making it
possible to play music with the .mod
player
again. Got it working , only to realize that the music started to
experience cutoffs/etc after a while. Turned out that our malloc
-based IPC
(one memory allocation for each IPC send) was a bad idea, so I refactored it
to use a circular queue instead - this was a nice experience where I even
managed to get my feet wet with unit testing of C code, which I haven't done
much before. It was really nice to be able to place breakpoints and run my
new circular queue implementation from inside VS Code, and make sure various
scenarios were properly handled by my implementation.
This led up to
the 0.3.0 release,
which included for the first time in years (or decades :-) a working .mod
player.
Full list of commits for the year is here.
EnvironmentCriminal (28h). This was an ASP.NET MVC/C# project I did for one of the university courses previously mentioned. The project used a local SQL Server DB and Entity Framework for accessing the DB. It was nice to get some up-to-date experience with these technologies, and I wouldn't mind using them again. I think the "classic" (non-SPA) based approach to writing web sites fits my mental model better than e.g. Ember, React and friends. If Blazor + WebAssembly changes things greatly I might reconsider accepting the SPA paradigm again. :-)
2is206_laborations (14h). This was a little Java project we did in the other university course, playing around with some (fairly simple) algorithms. Sorting and things like that. I think this was a good brain exercise for me. Even though I've been working as a professional programmer since the last century, there are still gaps in my knowledge, areas where I can improve. Getting stronger in algorithms is clearly one of these. Interestingly enough, it was after going this course that I then did the circular queue implementation in C for chaos (mentioned above).
perlun.eu.org (2h). The blog didn't get a whole lot of love during this year. I think I've almost spent at the time of writing (January the 5th) more time on this during 2020 already. :-) (given the work I've spent on updating these lists of projects etc)
perlang (1h). Perlang is a new programming language I am thinking about writing. This is yet on the drawing board; there is not a single line of code written on the compiler yet. As of yet, I have jot down a few examples of how the syntax could look and some aspects on how it would work. I also keep a page in my notebook at work, writing down various idas I get while working with my at-work project(s). :-) Who knows, maybe this will become a new killer language? Either way, I'm hoping to write more about it on this blog at some point.
chaosdev.io (1h). I spent a little time writing up a post with release notes for 0.3.0, as well as some other small fixes.
2020: No university courses this year, only a fair amount of spare-time & work-time hacking was performed.
Perlang (133h) + CSLox (10h) + jlox (4h): At last, I couldn't resist it. I was probably already thinking about doing this, and then saw Bob Nystrom's great guide Crafting Interpreters being posted at Hackers News. Unsure about the exact post that got me triggered (there are multiple ones), but this one coincides pretty well with the timing when I started hacking on this (January 2020).
Oh, and before I forget it: Bob, I owe you a big one. Please let me know if you ever happen to visit the area where I live and I'll happily buy you a pizza.
Here is a rough timeline of events (and yes, documenting this mostly for myself):
perlang.org
domain. I wrote in my diary this day that "it's not like there will be any code to put there within the next few years". I guess I still believed at this time that I would be able to refrain myself from starting the project.
jlox
... I came to the conclusion that I'd better follow the jlox
guide to get a basic understanding of how compilers & interpreters function.January 17th-19th: I spent a bit of time between the 7th and the 17th as well, but a significant "spike" took place during this particular weekend. During it, I went on a journey to attend a family ceremony in Sweden, which meant there was quite some travel time, during which I first worked on my jlox implementation, and later the cslox one.
My version of jlox
is pretty much a straightforward implementation of Bob's original (Java) interpreter as outlined in the book, with some minor changes (wrote a Ruby script for generating the AST classes instead of the original Java code). cslox
, on the other hand, is a rewrite of this code in C#. The reason I rewrote it in C# is obvious: since I intended to write Perlang in C#, it would be more useful for me to have the code for the Lox interpreter in C# than in Java.
I continued hacking on cslox
until about...
January 26th: The day when the initial commit was made in the Perlang repo. Very cool, at least to me! The original commit wasn't really something that would impress anybody (it was just .gitignore
and license file), but later the same day I added a commit that imported the cslox
code base, adjusted the namespaces etc. to make it a useful base to continue building on. The project was using .NET Core 3.1 at this point; .NET 5 was net yet released.
I will not go on with describing all the rest of the year at this level of detail, but I want to mention some key events before we move on to the next project (yes, there are other ones as well )
master
commit. The builds were originally published to Bintray, but was subsequently moved to https://builds.perlang.org
master
builds of) Perlang on your Linux/macOS/Windows machine quite easily.Base64.encode()
(declared on the Base64
class). The global methods previously added as base64_encode
and base64_decode
was also refactored to take advantage of this functionality, to provide better structure and avoiding polluting the global namespace.I'll readily admit: for now, the reason for doing this is largely as a fun hobby for myself. Some people collect postage stamps, or do woodworking, or bake really cool sourdough breads, or create their own keyboards based on DIY toolkits. I don't mean to degrade any of that. It's just not for me. I write integration tests for my compiler and add new functionality to my standard library instead...
halleluja.nu (20h): Slightly overshadowed by the above project, my https://www.halleluja.nu preaching/ministry web site did receive at least some attention during the year. As if the above (Perlang) project wasn't enough, I was also bitten by another bug this year, namely: the "do-your-own-static-site-generator" bug. I think the work on halleluja.nu
was mostly related to taking the new static-sitegen into usage, but I did write at least one sermon as well (in Swedish): Rättfärdighet, frid och glädje i den helige Ande
(There is some English-language material on the site as well, and I'm hoping to add more at some point. The support for multiple languages was merged right around the end of 2020, so it's still very new at the time of writing.)
sitegen (13h): This is the "engine" that now empowers the www.halleluja.nu web site. I was a bit tired of Jekyll, e.g. related to the performance (which isn't that great, given that it's Ruby-based) and poor multi-language support (which depended on a plugin which I fixed a bug in). I started hacking on this after testing a few other approaches:
How about just using Hugo? I tried this approach but it would mean some work, learning the details about how Hugo works and so on. To be honest, I'm pretty tired of software. I work with programming all day (it's my day job, after all), and sometimes I just don't have the energy to learn about how other people's software work. Will I even be happy about it after learning it, or will there be aspects that annoys me? If so, the effort of learning it might feel like I have wasted my time.
In practice, I am somewhat more interested in learning a new library or toolkit or similar, than learning how to use someone else's ready-made software. Something which probably affects my feelings here as well: Hugo is written in Go. This is great for performance; Go is typically much more performant than your average Ruby tool. Still, Go is not a language that I'm familiar with.
And even if I were, I would still be forced into someone else's design decisions. For some of you, maybe this is fine. I don't know, I'm perhaps just stubborn enough to not be as easily pleased as the average person.
How about rolling my own in JavaScript, using EJS templates? I did start playing around with this a bit. There's just one major problem with it: I'm not a very big fan of JavaScript, and even TypeScript suffers from the limitation that it's "just JavaScript" under the hood. There are definitely nice aspects about this, but to me, the disadvantages (like dynamic typing) are too compelling for me. It's also an ecosystem I don't normally "live" in and is not interested in living in. Even though the EJS library I started using would take me a bit towards the end goal (being able to publish a static site based on dynamic templates + Markdown documents), I would still need to write a bit of glue code here and there and I concluded that I wouldn't be interested in this.
How about zola, would it work? (Answer: probably, but it's not as widely used as e.g. Jekyll or Hugo. I looked a bit at it, and even submitted a minor PR towards it. It is written in Rust, so in some ways, better than JavaScript. Then again, Rust isn't a language I am working with everyday, and I'm not incredibly productive in it. Also, again it would mean I have to learn someone else's software, hoping that it would support my (fairly specialized) needs. It may be that it could have worked well, but I decided to try another approach... again. This would now be the fourth approach I tried.
How about rolling my own, in C#, with Handlebars.net templates? This is where it started to become really interesting. I found out about the nice little Handlebars.Net library which I could use to write my templates using the Handlebars syntax. This was a critical thing I wanted to achieve, if I would go the route of doing my own site generator: instead of a highly opinionated system with lots of "conventions" and other fancy stuff, I wanted something which was basically "PHP/Ember.js", but pre-rendered as a bunch of static HTML files. Instead of layouts determining how things should be rendered, I wanted an index.hbs
file that just {{include '_includes/header.hbs'}}
. In other words, going away from the "declarative approach" to the "imperative approach".
"Why on earth would anyone want a static site generator that works like that", you might ask yourself. Of course, the answer is: it depends. If all you're doing is something pretty plain, a single-language web site, you're probably much better off with just using something fairly opinionated, like Jekyll. Or Hugo if you want something faster (and perhaps it's less opinionated). You learn the conventions, and once they are interned, you are happy.
But: in my case, I am off for something more complex. I want it to support multiple languages, without having to resort to ugly hacks (like the Jekyll plugin that currently empowers the https://perlun.eu.org web site). I'd also preferably like to be able to make cross-linking between languages work (so that URLs like /sv/bibelstudier/1_mosebok/1
and /en/bible-study/genesis/1
can be logically connected). In other words: pretty custom logic in terms of how the site is structured. (I'm not even sure that particular use case with cross-linking of URLs between languages can be achieved without custom code in the actual C# engine, but anyway...)
All-in-all, this led to the creation of sitegen. It supports the following features:
The tool is currently in a pre-0.1.0 shape, but... it's working, I am using it for the www.halleluja.nu web site since a few weeks back in production. It's poorly documented, doesn't have any unit tests and so on, but if your needs are similar to mine, feel free to try it out (and submit bug reports if you find issues with it). The best way to understand how it works is probably to study the source code for the halleluja.nu web site here: https://github.com/perlun/halleluja.nu
dotfiles (9h): My personal dotfiles got a bit of love during the year. One of the things I am happiest about is that I was able to convert base64_decode and base64_encode to Perlang, since I added stdlib functions in Perlang for doing base64-decoding & encoding. These are literally the first Perlang programs in the world, eating my own dog food as I ought.
Apart from this, a few improvements here and there. This is stuff I use on all the machines I use regularly (work desktop, work laptop, sometimes my home desktop etc), so it tends to get a bit of attention.
perlun.eu.org (5h): Not too much work was done apart from the https://perlun.eu.org/en/2020/01/05/programming-projects-in-2019 page.
UsageLogger (3h): Implemented a simple Vue+jQuery (yeah, I know) web interface and an ASP.NET MVC REST API endpoint for retrieving some stats, based on data which was already logged by the Windows background application.
chaos4ever.github.io (3h): I did a little effort to make the https://chaosdev.io work better on mobile devices, using some simple resonsive breakpoints. I liked this. Frontend development can actually be fun sometimes. :)
armeria (2h): Armeria is a microservice framework, which we use at work. I submitted a pull request, adding some documentation; this is one of the nice changes I did in the sense that I could actually do it as part of my regular day job. I wouldn't mind to spend more professional time working on free software; it would be nice to work full-time on these kinds of projects. Who knows, maybe one day.
.bash_completion.d (2h): Tab-completion in bash
is something I find very valuable. Based on the the original fork by dysosmus and others, I added support for multiple inventory files and fixed a simple caching implementation of the completion data, to reduce the commandline latencies. (I hate high latencies.)
ArchUnit (2h): Again, this is a project we use at work. In this case, to enforce architectural constraints for a code base (things like: "only classes in package 'foo' can use the 'Bar' class", "only class 'Baz' can use classes in package 'zot'", etc. Run this in your unit tests and execute them in CI, and you make it more or less impossible to break these kind of architectural conventions by mistake). I added a new doNotBelongToAnyOf
static method to its DSL: https://github.com/TNG/ArchUnit/pull/422
chaos (1h): chaos
didn't receive a whole lot of love from me during 2020. I don't anticipate this to change at all during 2021. If I have time & energy for these kind of projects, I will focus on Perlang and halleluja.nu. Anything else will have to wait for some other time in my life; I consider it less important for the time being.
Some other minor changes were submitted to various projects. For more details about all my GitHub contributions during the year, follow this link.
2021
Perlang (97h): Continued towards the first 0.1.0
release. It's nice to not in any way be bound by any "external" timetable of any form for this project. Perlang is simply a sparetime interest of mine where I am free to decide when and how to release (or not release) the software. I really enjoy this, to be honest. Even though I have spent a fair amount of time on the project already, and it definitely is usable (at least for REPL/simple scenarios like calculating 2 ** 32
and so forth), there are still open bugs (3 at the time of writing) that I am aware of. I am currently planning to both fix these, and perhaps add some new functionality as well, before I call it a 0.1.0.
release.
Here are some of the achievements during the year (full list of commits here):
long
(#210), double
(#236) and bigint
(#238) types, fix integer expansions to bigint
(#234).dynamic
keyword (#225, #237)perlun.eu.org (16h): I wrote a few blog posts, where this one is one that I'd particularly like to highlight: Saying goodbye to an old friend: Decommissioning a Raspberry Pi web server. Writing this blog post was only part of the job; doing the actual work to planning the move, figuring out where to host things and so forth was also a bit of an effort. See the actual post for more details.
I also moved the CI which is used to publish the website to https://perlun.eu.org away from Travis, over to GitHub Actions: #28. There is little reason to not use the built-in GitHub Actions these days, at least for my kind of use cases. One of the best things about GitHub Action is that the delay before a job starts is really low (more or less "instant" once you push your code). This is nice; I don't like waiting on computers.
halleluja.nu (10h): Some new content was written and published:
sitegen (6h): Not much to mention here, except that I gave F# a brief try. F# is a functional programming language in the ML family which seems a bit interesting. A friend of mine (Tobias Lindqvist) is very interested in it and has been speaking positively about it to me. I tried it out and it was indeed quite nice, with a fairly elegant syntax. It was also nice to be able to create methods with "non-standard names" like creates a non-null TopLevelConfig.Config
: this is impossible in languages like C# but quite simple in F#.
I ended up rewriting the class in question in C# instead, because of the fact that F# lacked inner classes which I wanted to use for grouping my test methods. Nonetheless, it was interesting to try out a new programming language; it's not something you do every day.
darkerfx (5h): No web site is complete without a proper "dark theme"; perlang.org is no exception to this rule. The Perlang web site is built using DocFX, and there was already a dark theme for DocFX named darkfx. I made some changes to the theme and also converted the CSS to SASS. All in all, this was a fun endeavour and I do actually enjoy doing some frontend work from time to time. As long as I can stay away from the horrors of Javascript...
ansible-config (5h): While doing the work described in the blog post previously mentioned, I also extracted some Ansible roles from my existing "roles+config" repo, along with some new roles, and published them in a GitHub repo. It's not very fancy at all, but especially for those of you not yet familiar with Ansible it could perhaps be a bit useful as inspiration for your own roles.
dotfiles (4h): As usual, a bit of work here and there on this repo was made during the year. I want to highlight one particular commit: f03d340, in which I added dark_mode
and light_mode
shell aliases (well, in fact, shell functions). This was useful for me when doing "out-on-the-balcony" hacking in the summer time, where the sunlight simply made the usage of a dark theme impractical. Off to the terminal and type light_mode
, and there you go - switching both the Firefox, Cinnamon and GTK themes all in one go.
Unfortunately, I had some struggles with VS Code getting it to properly detect the theme being changed. It turns out that this is caused by an Electron/Chromium limitation. I guess this is one of the disadvantages of running GNU/Linux as your desktop OS; it's clearly less common than Windows and macOS.
protobuf (2h): This was an interesting experience. I created a pull request, based on an initial effort from another contributor that hadn't been merged. I don't regularly work with C++, so it was nice to be able to do something in that language for a change (I historically used C++ quite extensively, for example when writing the tanstaafl Fidonet client in the late '90s, but I haven't used it professionally for many, many years).
One thing that struck me was the compilation times: it took ages just to be able to build the project (which isn't that huge, I think). Compared to other languages I regularly use (Java and C#), the difference is significant. This is in one way expected since both of these languages compile to intermediate form instead of building "full" native binaries (like C and C+++ does), but still: it was an interesting thing to realize.
sudo-1.8.3p1-patched (1h): Finally, a few words about this one. Sometimes, life brings you to do rather odd things - this was clearly one of the more unexpected things this year. Because of CVE-2021-3156 and an old Ubuntu 12.04 machine that needed to be patched, I spent some time essentially "backporting" the Ubuntu Xenial (16.04) fix to the sudo
package in Ubuntu 12.04. In one way, this was a fun exercise since I don't tend to do that much C programming these days. In another way, it's obviously a bit sad to have to spend time patching a server running a 9-year old Linux distro which is well past the EOL time. But, what do you do...
2022
Perlang (116h): Continued towards the 0.2.0 release, which was eventually released on 2022-06-11:
The second public release of Perlang. Most notable changes are the added support for
uint
andulong
data types, as well as increased test coverage for binary operators (+
,-
,*
and so forth). As of this release, our test suite covers all supported (numeric) type combinations.
The full list of commits during the year can be found here.
Poc.Hemekonomi (8h): A simple tool for managing your personal finances. Written in .NET as a Blazor app with a console/CLI app to import CSV files from my bank into a Postgres database. The project is unfortunately not publicly available at the moment; I am hoping to make something similar like this released as free software sometime in the future (but not necessarily based on this exact code base).
perlun.eu.org (8h): I wrote a few blog posts during the year:
dotfiles (6h): A bunch of small changes here and there. I also got a new work laptop, which affected this a bit; I wanted to document even more details about my preferred setup.
jOOQ (2h): jOOQ is a DSL for writing SQL in Java which we use in my work. I made a few minor PRs, of which this one is the most substantial: Automatically enable table generation if indexes are enabled (#12993)
rebase-editor (1h, probably more in reality): I helped fix a bug in this nice little interactive editor for git rebase
. My changes weren't merged as-is, because they caused some issues with the tests but it still helped push the bug fix forward. (I believe I might still be using my patched version in fact, because it works better for me. )
(Unsurprisingly, this is my personal "wishlist" of books so I remember what to ask from others/buy for myself. :-)
Structure and Interpretation of Computer Programs. This book was recommended to me by a good friend named Andreas Finne. He praised it greatly, saying that "if you understand what is written in it, you will become a better programmer". I want to grow and learn more, so this is definitely one of the books I would like to read at some point.
The book is available for reading online here.
The Art of Multiprocessor Programming - Maurice Herlihy, Nir Shavit. Parallel programming is something I find fascinating, and even though I've been doing it a bit in the past, I know that there is a lot to learn, particularly in areas like lock-free concurrency and the general theory behind implementing traditional (locking-based) concurrency primitives. Since I've never studied CS, I feel there are a lot of areas here where I could improve.
(After writing the above, I have purchased the book and started looking into it but it's really not a very easy book to read; it's quite demanding on the reader. I anticipate it will take a year or two before I'm through this. It's definitely not something that's easy to just pick up and read during your lunch break or similar.)
Cyrille Artho: Finding faults in multi-threaded programs. Master's thesis, Swiss Federal Institute of Technology, March 15, 2001
Yes, this is sort of my personal collection of "bookmarks" that I intend to read some day. :)
And, finally: