To evaluate the impact of memory management in Rust, I implemented a short benchmark in Rust and Kotlin. You can find all the details here and here. Measurements showed that Rust is roughly a factor of 10 faster than Kotlin, most probably caused by better handling of memory garbage. Being a big fan of Haskell, I was curious to see how the grand old lady of functional programming would compete against these two. So, I implemented the benchmark, did some measurements, and was surprised.
Continue readingkotlin
Kotlin/JVM, Rust, and Randy Random
In this previous article I implemented a small, enterprisy benchmark to compare the concept of garbage collection used by Kotlin/JVM with the concept of Rust, which claims to not have any garbage collector at all. My conclusion was, that for a moderate increase in the complexity of the programming language the benchmark in Rust performed roughly 3 times faster than using Kotlin on the JVM. A colleague of mine, who uses Rust for some time now, looked at the code and gave me some hints for further speed improvements.
Continue readingYes, Rust has Garbage Collection, and a Fast One
Rust is getting more and more popular. Thus, a group of colleagues, including myself, evaluated it for half a day to build up our own opinion, if Rust is of strategic interest for us or not. We did some coding following the standard introduction book, looked at some frameworks, and watched the presentation “Considering Rust”. The general conclusion was more or less in the line of: yeah, a nice new programming language, but without a full-grown ecosystem and without any garbage collection, it will be too cumbersome and unproductive for us in our projects. My gut feeling did not agree with the assessment regarding garbage collection. Thus, I did some more digging and testing and came up with my current conclusion: Rust does indeed garbage collection, but in a very clever way.
Continue readingCo- and Contravariance in Kotlin From an Introductionary Domain Level Perspective
Covariance and contravariance are properties of type systems of programming languages. They can be pretty intimidating words for a software developer who just wants to implement user requirements. In this article I approach the meaning of these two properties in Kotlin from a domain level perspective. It was part of an internal small workshop on Kotlin.
Continue readingPart 1: GraphQL with Spring Boot, JPA and Kotlin
GraphQL is a query language for dynamic queries on linked data. In the GraphQL world, there are many tutorials and documentation that illustrate the concrete introduction to GraphQL. Since getting started requires a lot of explanation, regular tutorials usually have a simple setup, which does not reflect the real world complexity. If additional technologies are added or the complexity of the project increases, these “Hello World” examples are usually no longer so helpful.
This article introduces GraphQL on the technology Spring Boot with JPA and Kotlin. I also present some best practices which I have learned while I have worked with it. You can find the source code here: https://github.com/akquinet/kotlin-spring-graphql
Continue readingUnbounded Functional Loops in Kotlin

This article is a follow-up to this previous article about bounded loops. Bounded loops are cool because they always terminate and usually it is pretty easy to estimate the computational time. But as every computer scientist, who had to understand the halting problem, knows, there is a big class of algorithms which are harder. These are known as the class of μ-recursive functions. Here, unbounded loops exists which can run forever. I will introduce how IMHO unbounded loops can be implemented in Kotlin in a functional way. And, of course, I could not resist and did some measurements…
Continue readingJava Optional and Kotlin Nullable
We are using Kotlin and Spring Boot in one of our projects. This includes Spring Boot Jpa Repositories. We are using a CrudRepository that provides basic functionalities like save(), delete(), findById() etc. This library is written in Java, hence method signatures look like this:
Optional<T> findById(ID var1);
Using this API out of the box would force us to deal with cumbersome Java Optionals. Since we are implementing in Kotlin we would like to use Kotlin Nullables instead and as it turned out we can achieve this very easily.
Continue readingBounded Functional Loops in Kotlin

Loops are a basic paradigm in imperative programming languages. In functional languages you also need to loop, but you do it differently. Here, I present how I prefer to implement loops in a functional style using Kotlin. To check, if this is a good idea at all, I do some benchmarks against imperative variants and good old Haskell.
Continue readingOptionals in Kotlin
In No more Ifs I wrote a little bit about the new Optional class in Java 8. It enables the developer to work with optional values without a complex nested structure of if-then-else expressions. A colleague of mine, being a big fan of Kotlin, dropped a hint that using Kotlin, it would be much easier. He could even prove it. 🙂
Continue reading
You must be logged in to post a comment.