profile

Welcome!

🇬🇭
Akwaaba!

🇯🇵
ようこそ!

🇪🇸
Bienvenido!

🇨🇳
欢迎!

🇮🇪
Fáilte!

I’m Kojo, and this is a space where I share my thoughts on topics of personal interest.

Hopefully I’ve written something you can find insightful! 🙃

I’m always happy to talk on Discord → https://discord.gg/GEGbcRn

First-Class Pattern Matching

I was reading through the Tour of Scala , interested in Scala’s fusion of functional programming and Java-style object-oriented programming, when I came across the concept of extractor objects . Essentially, a Scala object is a singleton class, and it comes with two methods you can define that - weirdly enough - can be used used for custom pattern matching: object CustomerID: def apply(name: String) = s"$name--23098234908" def unapply(customerID: String): Option[String] = val stringArray: Array[String] = customerID.split("--") if stringArray.tail.nonEmpty then Some(stringArray.head) else None val customer1ID = CustomerID("Sukyoung") // Sukyoung--23098234908 customer1ID match case CustomerID(name) => println(name) // prints Sukyoung case _ => println("Could not extract a CustomerID") Run this code! This caught me by major surprise as I was not aware any language yet had a way to support first-class pattern matching to any extent. ...

2026-07-10 1278 words 6 min

First Date with Nim

Nim is a programming language I had been eager to try for a while, ever since I started looking more deeply into C++ alternatives (beyond Rust). I remember it immediately stuck out to me for having seemingly Python-like syntax while promising high performance as a systems language. I am constantly thinking about ways that programming languages can be made more ergonomic, so naturally, I get very excited when I come across a language that actually strays from typical C-like syntax. Right now, I’m very excited to see how Mojo develops! ...

2026-06-15 3501 words 17 min

Compile-Time Embedding with #include

Although executing code at compile-time is not a new idea by any means, the Zig programming language popularised the term comptime , and has brought a lot of eyes back on the topic by making it easier to use than in other languages. I personally haven’t taken the time to dabble in Zig yet - I’m already busy with Rust and OCaml - but curious as I am, I particularly wanted to know if files could be accessed at compile-time in the language I still know best: C++. ...

2026-03-21 1101 words 6 min

Perfectly Readable C++

C++ is full of weird features, quirks, and historical artefacts. This is in part due to its aim to have classic C code be valid under the C++ standard from day one. It is also due to the fact that C++ was first published in 1985 , and has naturally been filled with all sorts of features, good and bad, over the past 40+ years. As someone interested in programming language design, I’ve taken an interest in some of these features, eager to see just how hilariously difficult to read C++ code can be. ...

2026-03-02 4336 words 21 min