rust

A collection of 33 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Dec 7, 2025 rust

Yet another Rust ownership tutorial

One of the most important concepts to master in Rust is ownership and borrowing. Tons and tons of articles are solely dedicated to this narrow subject. This one tries to explain the concept with examples. I hope it helps you. Ownership is a set of rules that govern how a Rust program manages memory. All programs have to manage the way they use a computer’s memory while running.

Nicolas Fränkel
Nov 23, 2025 rust

My first real Rust project

I have been learning Rust for a couple of years, and using it for pet projects and demos alike. Working for a JVM-heavy company, I thought it would be my fate forever. Last week, I had a nice surprise: I convinced my management that using Rust for a particular project was the right choice. It’s not a huge project, but I want to describe my experience using Rust in a 'real' project. The project Our main software platform has baked-in health sensors for monitoring.

Nicolas Fränkel
Sep 14, 2025 java rust dependency

Comparing transitive dependency version resolution in Rust and Java

You learn by comparing to what you already know. I was recently bitten by assuming Rust worked as Java regarding transitive dependency version resolution. In this post, I want to compare the two. Dependencies, transitivity, and version resolution Before diving into the specifics of each stack, let’s describe the domain and the problems that come with it. When developing any project above Hello World level, chances are you’ll face problems that others have faced before.

Nicolas Fränkel
Jul 20, 2025 java rust kotlin python scala

Pattern-matching across different languages

Pattern matching is a major feature in software development. While pattern matching applies in several locations, its current usage is limited to switch case blocks. I want to compare the power of pattern matching across a couple of programming languages I’m familiar with in this post. I assume that every reader is familiar with the switch case syntax inherited from C.

Nicolas Fränkel
Jun 1, 2025 rust lazy_static lazylock oncelock

Runtime-initialized variables in Rust

Rust offers different ways to initialize compile time-initialized variables. Recently, I had to create a runtime-initialized variable: existing approaches don’t work in this case. I want to describe multiple ways to achieve it in this post. Constants The Rust language allows you to create constants. Two keywords are available: const and static. Sometimes a certain value is used many times throughout a program, and it can become inconvenient to copy it over and over.

Nicolas Fränkel
Apr 13, 2025 rust

High-cardinality values for build flags in Rust

While working on my demo on WebAssembly and Kubernetes, I wanted to create three different binaries based on the same code: Native: compile the Rust code to regular native code as a baselineEmbed: compile to WebAssembly and use the WasmEdge runtime image as the base Docker imageRuntime: compile to WebAssembly, use a base scratch image as my base image, and set the runtime when running the code The code itself is an HTTP server that offers a single endpoint.

Nicolas Fränkel
Mar 30, 2025 mutation testing rust open source

Mutation Testing in Rust

I’ve been a big fan of Mutation Testing since I discovered PIT. As I dive deeper into Rust, I wanted to check the state of mutation testing in Rust. Starting with cargo-mutants I found two crates for mutation testing in Rust: cargo-mutantsand mutagen mutagen hasn’t been maintained for three years, while cargo-mutants is still under active development.

Nicolas Fränkel
May 26, 2024 rust environment variables configuration

Parsing structured environment variables in Rust

I’m in the process of adding more components to my OpenTelemetry demo (again!). The new design deploys several warehouse services behind the inventory service so the latter can query the former for data via their respective HTTP interface. I implemented each warehouse on top of a different technology stack. This way, I can show OpenTelemetry traces across several stacks.

Nicolas Fränkel
May 12, 2024 rust tauri gui

My opinion on the Tauri framework

I’ve always liked GUI, both desktop-based and browser-based before you needed five years of training on the latter. That’s the reason I loved, and still love Vaadin: you can develop web UIs without writing a single line of HTML, JavaScript, and CSS. I’m still interested in the subject; a couple of years ago, I analyzed the state of JVM desktop frameworks. I also like the Rust programming language a lot. Tauri is a Rust-based framework for building desktop applications.

Nicolas Fränkel
Apr 21, 2024 rust error management

The try block in Rust

I wrote previously about libs for error management in Rust. This week, I want to write about the try block, an experimental feature. The limit of the ? operator Please check the above article for a complete refresher on error management in general and the ? operator in particular. In short, ? allows to hook into a function call that returns a Result: If the Result contains a value, it continues normallyIf it contains an error, it short-circuits and returns the Result to the calling function.

Nicolas Fränkel
Mar 17, 2024 programming coding rust kotlin

The pitfall of implicit returns

Implicit returns are a feature in some languages. They have recently bitten me, so here’s my opinion. Statements, expressions, and returns Before diving into implicit returns, we must explain two programming concepts influencing them. A lot of literature is available on the subject, so I’ll paraphrase one of the existing definitions: An expression usually refers to a piece of code that can be evaluated to a value.

Nicolas Fränkel
Feb 11, 2024 rust error management

Error management in Rust, and libs that support it

As part of learning the Rust ecosystem, I dedicated the last few days to error management. Here are my findings. Error management 101 The Rust book describes the basics of error management. The language separates between recoverable errors and unrecoverable ones. Unrecoverable errors benefit from the panic!() macro. When Rust panics, it stops the program. Recoverable errors are much more enjoyable. Rust uses the Either monad, which stems from Functional Programming.

Nicolas Fränkel
Oct 29, 2023 rust python pyo3

Feedback from calling Rust from Python

I got plenty of feedback on my post about Calling Rust from Python: Hacker News/r/python/r/rust Many comments mentioned pyo3, and I should use it instead of cooking my own. Thanks to the authors, I checked: in this post, I explain what it is and how I migrated my code. What is pyo3? Rust bindings for Python, including tools for creating native Python extension modules. Running and interacting with Python code from a Rust binary is also supported.

Nicolas Fränkel
Oct 8, 2023 http ipc ffi rust python

Calling Rust from Python

I recently watched GOTO conferences' talk Calling Functions Across Languages by Richard Feldman. I’m afraid I have to disagree with using the term 'language' in this context. It’s a no-brainer to call Java from Kotlin or Scala or to call Java from Kotlin. Hence, in the rest, I’ll use 'stack'.

Nicolas Fränkel
Aug 20, 2023 rust library

Introduction to the Tower library

One of the components of my OpenTelemetry demo is a Rust application built with the Axum web framework. In its description, axum mentions: axum doesn’t have its own middleware system but instead uses tower::Service. This means axum gets timeouts, tracing, compression, authorization, and more, for free. It also enables you to share middleware with applications written using hyper or tonic.

Nicolas Fränkel
Apr 30, 2023 rust axum tokio dall.e

Server-side rendering in Rust - a Dall.E use-case

Last week, I decided to see the capabilities of OpenAI’s image generation. However, I noticed that one has to pay to use the web interface, while the API was free, even though rate-limited. Dall.E offers Node.js and Python samples, but I wanted to keep learning Rust. So far, I’ve created a REST API. In this post, I want to describe how you can create a webapp with server-side rendering.

Nicolas Fränkel
Jan 29, 2023 rust http api

Learning by doing: An HTTP API with Rust

When I started working on this post, I had another idea in mind: I wanted to compare the developer experience and performance of Spring Boot and GraalVM with Rust on a demo HTTP API application. Unfortunately, the M1 processor of my MacBook Pro had other ideas. I'm trying to compile a *very* simple #SpringBoot #Kotlin webapp with #GraalVM native image. I'm using Liberica NIK via Docker on a M1 Mac. Compilation seems to be stuck.

Nicolas Fränkel
Dec 11, 2022 twitter mastodon rust github actions

Preparing to move away from Twitter

I opened my Twitter account more than 13 years ago, in August 2009. For 12 years, I kept focusing on professional-related content: Java, the JVM, programming, etc. I built my audience, trying to promote good technical content, either my own or stuff that I enjoyed reading. Then, on February 24th, Russia invaded Ukraine. My first visit to Ukraine was in 2014, just after the Maidan revolution. During eight years, I returned there often and made plenty of friends.

Nicolas Fränkel
Oct 9, 2022 rust testing dependency injection

Different test scopes in Rust

I’m still working on learning Rust. Beyond syntax, learning a language requires familiarizing oneself with its idioms and ecosystem. I’m at a point where I want to explore testing in Rust. The initial problem We have used Dependency Injection a lot - for ages on the JVM. Even if you’re not using a framework, Dependency Injection helps decouple components. Here’s a basic example: class Car(private val engine: Engine) { fun start() { engine.

Nicolas Fränkel
Oct 2, 2022 rust webassembly api gateway apache apisix

Rewriting the Apache APISIX response-rewrite plugin in Rust

Last week, I described the basics on how to develop and deploy a Rust plugin for Apache APISIX. The plugin just logged a message when it received the request. Today, I want to leverage what we learned to create something more valuable: write part of the response-rewrite plugin with Rust. Adding a hard-coded header Let’s start small and add a hard-coded response header. Last week, we used the on_http_request_headers() function.

Nicolas Fränkel
Sep 25, 2022 rust webassembly api gateway apache apisix

Apache APISIX loves Rust! (and me too)

Apache APISIX is built upon the shoulders of two giants: NGINX, a widespread Open Source reverse-proxyOpenResty, a platform that allows scripting NGINX with the Lua programming language via LuaJIT This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don’t fit your requirements. In this case, you can write your own Lua plugin.

Nicolas Fränkel
Apr 10, 2022 rust system programming

Rust in Action

I’m pretty much a learning-by-doing kind of guy. However, I tend to get back to documentation after a certain level. Last year, I started to learn the Rust programming language on my own. Then, I felt the need to read some theories. I have known the 'In Action' Manning series for a long time. When I saw Rust in Action, I thought it would be a step in this direction. Facts 12 chapters, $33.59The book’s subtitle is 'Systems programming concepts and techniques'.

Nicolas Fränkel
Mar 20, 2022 language design error handling java rust go functional programming

Error handling across different languages

I’ve tried Go in the past, and the least I could say is that I was not enthusiastic about it. Chief among my griefs was how the language handled errors, or more precisely, what mechanism it provided developers with to manage them. In this post, I’d like to describe how a couple of popular languages cope with errors. A time before our time I could probably go back a long time, but I needed to choose a baseline at some point. In this post, the baseline is C.

Nicolas Fränkel
Feb 6, 2022 rust kata coding

The Gilded Rose Kata in Rust

This is the 10th post in the Start Rust focus series. The Gilded Rose Kata is a refactoring exercise. The full description is available on GitHub. Nowadays, the kata is much more widespread. It’s available in plenty of languages, even some that are not considered mainstream, e.g., XSLT or ABAP. In this post, I’d like to do it in Rust.

Nicolas Fränkel
Aug 8, 2021 rust basics collections

Rust's Vector

This is the 9th post in the Start Rust focus series. I’ll be honest: I initially wanted to describe all collections available in Rust as well as their related concepts. Then, I started to dig a bit into it, and I decided it would have been (much) too long. For that reason, I’ll restrict the scope to the Vec type.

Nicolas Fränkel
Jul 25, 2021 rust random

diceroller, a sample Rust project

This is the 8th post in the Start Rust focus series. For me, the best learning process is switching regularly between learning and doing, theory and practice. The last post was research, hence, this one will be coding. I’ve been a player of Role-Playing Games since I’m 11. Of course, I’ve played Dungeons & Dragons (mainly the so-called Advanced Edition) but after a few years, I’ve taken upon Champions and its HERO system.

Nicolas Fränkel
Jul 18, 2021 rust jvm integration ffi jni

Rust and the JVM

This is the 7th post in the Start Rust focus series. So far, we have learned the basics of Rust syntax, developed a custom Kubernetes controller, and integrated with the front-end with Wasm. I’ve been using the JVM for two decades now, mainly in Java. The JVM is an amazing piece of technology. IMHO, its biggest benefit is its ability to adapt the native code to the current workload; if the workload changes and the native code is not optimal, it will recompile the bytecode accordingly again.

Nicolas Fränkel
Jul 11, 2021 rust controller kubernetes

A Rust controller for Kubernetes

This is the 6th post in the Start Rust focus series. To teach myself Kubernetes in general and controllers in particular, I previously developed one in Java. This week, I decide to do the same in Rust by following the same steps I did. The guiding principle is the creation of a Kubernetes controller that watches pods' lifecycle and 'binds' a sidecar to them. When the main pod is scheduled, the controller schedules the sidecar; when it’s deleted, it deletes it as well.

Nicolas Fränkel
Jul 4, 2021 rust webassembly wasm front-end javascript integration

Rust on the front-end

This is the 5th post in the Start Rust focus series. Up until now, JavaScript has been the only ubiquitous language available in browsers. It has made JavaScript much more popular than its design (and its associated flaws) would have allowed. I don’t want to start a holy war about the merits of JavaScript, but IMHO, it only survived this far because of its role in browsers.

Nicolas Fränkel
Jun 27, 2021 rust exercises practice learning

The Rustlings exercises - part 2

This is the 4th post in the Start Rust focus series. Last week, I started the Rustlings series of exercises. Now is the time to finish it.

Nicolas Fränkel
Jun 13, 2021 rust exercises practice learning beginners

The Rustlings exercises - part 1

This is the 3rd post in the Start Rust focus series. To continue building my understanding of Rust, I searched for some simple Rust exercises. Hence, I dedicated my weekly personal work time to the Rustling exercises. There will be two posts dedicated to Rustlings. The reason for that is that it contains many (many!) exercises. Besides, I need to learn about the more advanced themes such as threading.

Nicolas Fränkel
Jun 6, 2021 rust learning

My second cup of Rust

This is the 2nd post in the Start Rust focus series. Last week, I drank my first cup of Rust. I learned concepts that are foreign in the languages I know: ownership, borrowing and lifetimes. This week I want to drink the second cup and see where it leads me.

Nicolas Fränkel
May 30, 2021 rust learning

My first cup of Rust

This is the 1st post in the Start Rust focus series. It all started with an informal chat with my friend Anthony. We were talking about languages, and I said that I preferred compiled ones. He then went on to mention Rust. We admitted that we were too afraid to learn it because of its perceived complexity. After the chat, I thought about it, and I wondered why I didn’t check by myself. I did. And I became interested.

Nicolas Fränkel
A Java geek © 2008-2026
v. bc04c88300c3ec997ce8470fbff5395dc9e518b1/13264050981
Latest Posts