February 15, 2021

A Rust / WebAssembly setup

This is a very short walk-through to get a Wasm Rust project up and running. No intention is put on giving an in-depth overview or a thorough list of references. The best more detailed guide is the Rust and WebAssembly “book”, in particular the Game of Life tutorial. Helpful is also the wasm-bindgen documentation. I played around with various setup options and for the time being I liked this one as this integrates with webpack, provides a life reload workflow and makes JS / Rust interop easy. 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 2021