What I learned from a Rust migration

by Carlos 2025/11/02
projects open-source blogging rust

A refresher on Scriba

In my last post I talked about Scriba, my blog engine that I wrote just for the sake of coding and building something I would use to publish my thoughts and projects.

Scriba was originally written in TypeScript with Deno and Fresh. But halfway in the process I started to feel the itch to write Rust again. After all, I am trying to learn it as my main language because I really enjoy it and I think it's my "spiritual language".

But I used TypeScript/Deno/Fresh combo for the blog engine because well...it's a web app, made perfect sense it was written with something "native" for web apps, right?

Why I originally chose Deno

Initially I thought of using React, which is what the cool kids use, and it's definitely what I have been using at my own 9-5 job for a few years now. Made perfect sense, I would use what I learned at my job, and if I learned new stuff I would use it back at my job.

Now, I'm not a frontend engineer at work, so I was trying to use it as a way to expand my frontend skills. Then I saw Deno 2.0, and I loved how easy it was to use, all the tools and utilities are part of Deno, no need to have separate linters, formatters, etc.

As a non-frontend engineer I felt Deno gave me the guardrails necessary to build an app without thinking too much of the how and what I would use. But the truth is that there's way more documentation for React apps than Fresh apps.

Why did I change my mind?

As I was writing the app, I was feeling the itch to go back to my Rust projects because I really like the language. I felt like I was taking a big detour just to build something to publish my other Rust projects.

But why did I need to do that detour? Could I just use Rust for everything? Get myself completely immersed in Rust. I'm not saying Rust is the answer to EVERYTHING, but if you want to learn something, you should definitely use it constantly to get better at it.

So I decided to pivot and rebuild Scriba using Rust. After all, my original Scriba app was just a SSR app which I could replicate with Axum and a templating engine like Askama.

What did I learn along the way?

This migration really helped me to get more attuned with Axum and Rust in general. But I did ask Claude questions on CSS (I'm a backend engineer after all). And since Axum is not a frontend framework, there were some extra steps I needed to do, like the build.rs script to compile my Tailwind and DaisyUI styles into the final CSS.

fn main() {
    install_npm_packages();
    build_tailwind_css();
}

But I definitely got more comfortable with Axum and the Rust std library, which will definitely come in handy with my other Rust projects.

One of the nice side effects of using Rust for this (which wasn't the objective), is that the memory footprint from using Deno to Axum went down by ~10%. This is the same server, a 1GB DigitalOcean droplet running the Scriba Docker container.

memory-diagram

Rust brings back the joy of programming...to me

Look, I'm not saying Rust is the answer to everything, but like I said before, I really like the language and I enjoy coding in it. To me, the fact that I could build a web app with my favorite language means a lot.

I didn't want to use Rust just because I believed it would have an edge on performance, or whatever would sell me on using Rust. I honestly just did it because I could and I wanted. What's better than doing your hobby project in whichever way you want?

Deno or any other "web" native language/framework could have been a better answer, but I didn't want to use any of them to be honest. I definitely wouldn't have used Rust if this was a project at my 9-5 job, or if it was a product I would sell, but hey...I just wanted to code some Rust, and I wanted to also build my own blog engine.

What's next?

So, now that I have my blog engine running in Rust, I can keep going with my other Rust projects that I have in my list of todos. But, I would definitely keep adding more features to it, I think there's still room for improvement. Is there anything you would like to see? Make sure to add an issue in the repo, or even send your own PR! After all, this is an OSS project.