Skip to main content

Java Scoped Values: Better ThreadLocals

·15 mins

Largely motivated by Virtual Threads, a new lightweight thread-local alternative has been introduced with the incubation JEP-429 called ScopedValues. ScopedValue is purpose-built to provide a lighter-weight alternative to ThreadLocal that works well with virtual threads and also solves multiple API shortcomings of the twenty-five year old counterpart. This article will dive in to how ScopedValue is different, and how it is made faster under the covers.

Repairing a Very Corrupt Nix Store

·4 mins

Recently I moved all of my personal setups to NixOS, from my Framework laptop, my gaming desktop, and my work MacOS setup. However, my laptop recently was no longer able to rebuild or re-apply, due to weird Nix errors.

Helpful Kotlin APIs for Java Developers

·11 mins

One of the major benefits of Kotlin as a JVM language is that you can use any and all Java libraries natively. However, sometimes, Kotlin has better (or at least more idiomatic) alternatives to the native Java libraries. Over the years, I’ve coached a lot of Java developers at various experience levels on how to effectively use Kotlin, and it’s a very common pattern for them to not know the standard Kotlin library and choose the “Java way” instead of the “Kotlin way”. This article will cover some of the more common cases where I see that happen.