September 9, 2022

Speeding up incremental Rust compilation with dylibs

TL;DR Creating a dynamic version of a Rust library can improve incremental compilation speed during development quite substantially. cargo add-dynamic automates the setup process. One of Rust’s biggest downsides is that it tends to be rather slow when compiling programs. A lot of work has been put into improving the situation over the years with noticable impact. In addition, there are a number of good guides out there that explain the impact of various optimization options and tooling choices: Read more

August 4, 2022

Hot Reloading Rust — for Fun and Faster Feedback Cycles

TL;DR hot-lib-reloader allows to change Rust code on the fly without restarts. It works on Linux, macOS, and Windows. For why, how it works and, how to use it (as well as the limitations of this approach) read the post below. Hot-reloading a Bevy app Development with Rust can be a lot of fun and the rich type system in combination with good tooling such as rust-analyzer can provide helpful hints and guidance continuously while writing code. Read more

April 3, 2022

A Rust web server / frontend setup like it's 2022 (with axum and yew)

WebAssembly tooling for Rust has made big improvements and has matured tremendously over the previous two years. The build and packaging steps are now simpler thanks to tools like Trunk, as well as being able to write frontend code with various frameworks such as yew or dioxus. Also support for wasm is now supported in quite a few crates, basic ones such as chrono or higher level libraries such as plotters. Read more

February 7, 2021

Configuring Emacs for Rust development

Rust support in Emacs improved a lot during the past two years. This post will walk you through setting up Emacs to allow for: Navigating the source code (go to to implementation, list references, outline module structure) Code completion Code snippets Highlighting errors and warnings inline Apply code fixes and refactorings Automatically import definitions if necessary (such as for Traits) Code formatting with rustfmt Building & running other cargo commands This setup will be based on rust-analyzer, a LSP server that is under very active development and powers the Rust support in VS Code as well. Read more

February 3, 2021

Is Rust a Functional Programming Language?

Update: There was a delightful discussion about functional programming and the nature of Rust at lobste.rs. Some quotes... Functional languages take away mutability from the “mutability + aliasing = bugs” equation; Rust takes away the aliasing — or at least, the uncontrolled aliasing. To me, it then makes sense to feel comfortable using mutability (and the advantages it offers), safe in the knowledge that the compiler is helping you avoid bugs. Read more

February 1, 2021

Building and deploying Rust utilities

Over the past year I build a number of tools and utilities in Rust. Previously, I would mostly do this in node.js or shell scripts but Rust has some advantages: More reliable for long running and mostly unobserved applications (“once it runs is runs”), in particular no memory (leak) issues Needs less resources, upping the utility value of my various Raspberry Pis Setup and deployment are simple mostly due to the cargo package management and build tool The last point I’ll describe in more detail. Read more

© Robert Krahn 2009-2023