Rust Rewrite

As I tend to do from time to time, I have recently rewritten this site in technologies that currently interest me. It is now written in Rust on the server side.

Why Rust?

I started learning Rust in 2020 as something to do. I intially wanted to use WebAssembly, so Rust was a natural choice. By 2021 I started to feel comfortable doing certain things. I was having a lot of fun with Rust and I started to think I wanted to rewrite my blog to use a Rust web framework. I compared as many frameworks as I could find, and ultimately chose Actix. Apart from middleware which is a little beyond my current understanding, Actix's API is really versatile and easy to learn. The best place to look for help has been their examples repo. They also have a Discord.

Cargo dependencies

Some of the more important Cargo dependencies that I am using, besides Actix:

Askama
Askama is for Jinja-like templating. The only downside to Askama for me is that changing a template means recompiling the project.
SWC
SWC is for compiling JavaScript. It is basically a Rust Babel. It does aim to be many other things as well, but I am just using it to compile some JavaScript.
Parcel CSS
And finally Parcel CSS is for compiling CSS. It is basically like Postcss in Rust. It was actually released when I had most of the server written already. Originally I was using a Sass implementation in Rust, but I had forgotten how sometimes Sass syntax conflicts with vanilla CSS, so I welcomed Parcel's arrival. It allows me to do nesting and forget about prefixes. The only downside here is its alpha, so it sometimes breaks. Committing my lock file has been a life saver.

More to come

Any how there is more I could write about this rewrite, and I will certainly be writing more about Rust in the future. Until then here it is.