< Back to Blog

Why We’re Choosing Rust

By
|
February 22, 2021
Company News

Table of Contents

tl;dr: Bad code is everywhere. Rust makes bad code hard. Tangram Vision is embracing Rust wholeheartedly and wants to help you do the same.

Open Secret: something that is widely known to be true but which none of the people most intimately concerned are willing to categorically acknowledge in public.

Hi.

I’m Brandon Minor, the CEO and co-founder of Tangram Vision, a perception sensor software startup. If you look at my LinkedIn profile, you’ll see that title, plus a lot more things that might make you believe I’m pretty good with computers. And it’s true, I have more experience than most (hence the company founding). But I have an open secret that I need to share with you:

I am not a good programmer.

To be clear, I’m not… bad. I can pass a coding interview. I’ve handcrafted huge repositories spanning multiple languages and machines, and I’m pretty proud of them. But wow, have I also written some bad code. Things that I’ll see a year later, whisper “What idiot did this?”, and slowly realize, through the fog of git commits, that I was that idiot.

And not only have I written bad code. My friends have written bad code. My colleagues have written bad code. Our mentors have written bad code. The code that all of our code depends on was written by someone who wrote bad code. Bad code is everywhere. It’s an open secret that few acknowledge, but for Tangram Vision, it’s something we wanted to confront on day one.

When I was sketching out the roadmap for Tangram Vision, I knew that our platform would eventually act as the foundation of a myriad of multi-sensor systems. That foundation had to be demonstrably solid and sound. Yet I also knew that bad code happens, no matter how gifted your engineering team is. We needed a way to prevent self-sabotage, while also guaranteeing our users a great experience. That way was shown to us through Rust.

Rust makes bad code hard to write. I mean, it makes it really hard to write. When I was first trying out the language, I found it infinitely frustrating; the way I habitually wrote code for years was being torn apart by compiler messages and warnings. My ego had a hard time taking the hit. Once I started to pick apart the methodology, though, I understood just how powerful this language could be.

The Might and Magic of Rust

In my experience, bad code is the number one killer of embedded and sensor systems. Testing is hard, and memory management is harder. Yet Rust handles even the worst embedded issues through its very design. If code compiles, its safety is guaranteed. Breaking this rule of safety requires intent, which means more thought put into the code anyway. Testing, dependencies, and profiling are all handled effortlessly. And, best of all, whatever was compiled is probably pretty damn fast. These attributes made it the perfect language for Tangram Vision, and after a little bit more experimentation, we decided to adopt it at a company level right from the start.

This guarantee of safety has also provided a hidden perk to the Tangram Vision team: we’ve all become more adventurous. I mentioned how Rust had torn apart my coding habits; I had written code this way because I knew it would work with other programming languages. I had unknowingly fallen into a rut, adopting an attitude of “If it works, don’t fix it”. Rust made me realize that my code actually didn’t work — at least not how I thought it did. Not only that, but anything I wrote in Rust was now guaranteed to work, which meant that I was free to write without repercussion. This is something I hadn’t encountered earlier in my career as a coder, and I can safely say my team hadn’t, either. While we might have been arguing about pointers and segfaults in the past, now we argue about high-level concepts like sum types, data flow, and ownership. Rust has given us room to grow as engineers, and we couldn’t be more thankful for it.

Join Our Journey

Rust is relatively new, so there are still open questions to be answered. First, our core platform is closed-source, which hasn’t gotten much attention in the Rust community. Second, we’ll be integrating with other languages like C and C++, and operating systems like ROS and ROS2, which will involve some deep-dives and serious architecture decisions. Yet instead of being daunting, Rust has made these challenges exciting, obstacles we can conquer without fear.

We’re so excited, in fact, that we’ll be documenting our journey for you. In addition to all of our open-source work, we plan to publish a series on how we at Tangram Vision are adopting Rust with:

  • Best practices
  • Explorations into different architectures and designs
  • Integration challenges

We hope to take part in the community through our work and words, and we encourage you to contribute yourself to our repositories at Tangram Vision OSS.

Don’t write bad code. Write Rust! And even better, write Rust with Tangram Vision.

Share On:

You May Also Like:

DevOps For Perception

The Tangram Vision SDK is free for the first five instances and unlimited users.