Major mostly flawless milestone

For the past few weeks we've been working on an application related to a high assurance security device (think EAL7, for those of you who speak CC). I decided to use Rust for this project as a trial run. I have some Rust experience, but mostly hobbyist work.

The other person working on this has very little Rust experience (he has copied-and-pasted code to make a Rocket server, and put together a simple TCP-based echo server), but that's more or less his experience with Rust.

I'm more of a command-line person, I use vim [on mac and linux] without any bells'n'whistles apart from syntax highligting. The other developer like GUI's; he used Visual Studio Code with some plugin that makes it autocomplete and compile as he types.

Today we finally got to the point where we could do the first real test run of the application.

We set everything up, ran it, and it error'd out. A state wasn't reset in a state machine. This caused two problems, both trivial to fix; we did a quick fix for the one it hit and ran again. It got further but then hit the other problem, so we fixed that.

After that, it worked. No, I actually mean that it really worked. We looked at each other and said "wait, what happened?".

That feeling of things Just Working(tm) is such a bizarre and unfamiliar feeling. I've experienced it before with Rust, but never on this scale. I was 100% committed to spending the rest of the weekend debugging protocol parsers, protocol generators, fixing off-by-one errors, fixing a directory scanner, fixing a diff generator, etc. All the usual stuff.

That "If it compiles it works" is legitimately no joke. I mean, it's obviously not universally true, but I have worked with projects of this scope in other languages, and I have never had anything work even close to this well in the first run before.

The thing that really blew my mind was how the other developer got things working as well as he did, with so little experience. He said that the Visual Studio Code plugin was a huge part of that -- he mentioned that it even shows example code for suggested fixes for certain kind of errors(?!).

Rust is certainly here to stay.

Thank you to everyone who made Rust what it is today, and thank you to those working on whatever Rust plugin he's using in Visual Studio Code. :slight_smile: And thank you to all of you helpful people who help out in these forums, in Discord, Zulip and elsewhere.

This experience really made my weekend.

16 Likes

That is a really weird and spooky side effect of using Rust. Something I was not expecting and have not experienced since using Ada years ago.

I can spend a day or more getting anything to even compile in Rust. Getting very frustrated with the compiler and myself along the way. But when it compiles for the first time it mostly works!

It's not just the type system, as in Ada. There is something about that borrow checker that forces you stand back and have a good think about your data, where it is, where it going, and who can do what with it.

Seems that when you have thought that through hard enough, long enough, to make the compiler happy you are far more likely to have a working system.

That is not to say other logical errors don't creep in. Generally they are found soon enough with some simple testing.

It just seems magical.

4 Likes

The peace of mind I get from this makes up for any and all pain rust as a whole causes. This makes everything worth it imo.

2 Likes