Planet of the Crabs
🦀 fearless rust


Artifact 2.0 Rust Full Stack Web And Cli Application

Posted on by Vitiral

After at least 6 months of effort (and interruptions… so many interruptions) I have finally completed the complete rewrite of artifact – including rewriting the Web UI to be in rust compiled into web assembly. 2.0 is complete and you can download it here (for linux only ATM)

This release spans a huge amount of effort. The TLDR version:

What I ended up with is the first (to my knowledge) full stack application in rust that is more than a toy. Artifact is a reasonably complex piece of software, and rust delivers its promises of speed and stability even at the cutting edge of the web.

Why Rewrite Everything?

The first question is probly why I decided a complete rewrite was necessary. There are two answers: for fun and because I initially wrote artifact when I was just learning rust for the first time and it showed.

I wanted to write artifact “the right way” – using standardized libraries and split into several reusable crates. However, the standardized those libraries didn’t really exist yet (or at least they weren’t cohesive) so I went about building ergo. It was my way of giving back to the fantastic rust community :)

The other reasons to rewrite were:

How was WASM / yew?

Rewriting the frontend in rust using yew (and compiling to webassembly) was truly fun and exciting. There was definitely a few areas that needed improvement; and being willing to contribute to fix your own issues was critical with the ecosystem where it is at now – but the responsiveness of the rust developers has never ceased to amaze me.

Probably the most amazing thing about writing your whole stack in a single langauge is code reuse. I have a single crate, artifact-ser with the serialization datatypes and logic that can be used anywhere in the stack. This allows me to implement code once and use it anywhere – a benefit that can seriously not be overstated!

Conclusion

I love rust, it is definitely my favorite language at the moment. Writing a full stack application in pure rust has been an amazing experience.

The highlights however are definitely my interactions with the community. After my Rust and the Great CLI Awakening blog post I was invited to be on the CLI Working Group. Unfortunately, that pulled too much of my time away from rewriting artifact so I had to drop out. However, my experience there and with the WASM folks has been nothing but positive. Its been said before and I’ll say it again: Rust has a great community!

There is still much work to be done for artifact. For one thing I need to figure out how to run cargo-web in CI for mac and windows so that I can distrubute artifact for those platforms. I also need to finish end to end testing (including using frontend testing using rust, more on that later!).

However, one of the primary distractions over the last several months has been interviewing at Google… and the distractions paid off! I will be starting as a Test Engineer at Google working on Android Auto. This is super exciting, but will not leave a lot of time for working on artifact. Therefore this blog post is basically also a notice that I will be on haitus for the next several months as I get up to speed on everything Googly.

If you find artifact valuable, please leave feedback. Help in maintaining it would also be much appreciated :).