← All Articles
I was a young, hopeful Rust fanatic. On paper, Rust seemed like the programming languages designed by the gods.
Austin Starks
Austin Starks in DataDrivenInvestor
  ∙  
6 min read
  ∙  
View on Medium

NexusTrade - AI-Powered Algorithmic Trading Platform

By far the best algorithmic trading experience. Learn to conquer the markets by deploying algorithmic trading…

nexustrade.io
Preview image

I was a young, hopeful Rust fanatic. On paper, Rust seemed like the programming languages designed by the gods. Not only is it the fastest programming language out there, its also one of the safest.

I’m not alone in thinking Rust was this perfect language. If you read about the Rust programming language online, you’ll likely encounter overwhelmingly positive opinions. Every guide on Medium, every post on Reddit, every answer on Stack Overflow — everything is glowing.

GitHub post about Rust being the most admired language among developersGitHub post about Rust being the most admired language among developers

Given this, I decided to migrate away from TypeScript re-write my entire open-source algorithmic trading system in Rust.

GitHub - austin-starks/NextTrade: A system that performs algorithmic trading

A system that performs algorithmic trading. Contribute to austin-starks/NextTrade development by creating an account on…

github.com
Preview image

I gave Rust a neutral rating before. I take that back

I Built an Algorithmic Trading System in Rust. Here’s What I Regret.

If you read about the Rust programming language online, I guarantee that you’ll only read positive things.

medium.com
Post image

I wrote about my experience with Rust 4 months ago. In my last article, I concluded that while I really like the speed and some aspects of the language design (such as enums and strong typing), I didn’t really love the language. My article was met with harsh criticism on Reddit, including one highly upvoted comment that accused me of using ChatGPT to write my article.

Me having to defend myself against angry Rust fanatics on RedditMe having to defend myself against angry Rust fanatics on Reddit

After posting, I had thought that I didn’t give Rust a fair shot. Maybe I was just naive, or came in with misplaced expectations.

Now, after working with the language for a little while longer, I can confidently make one conclusion…

This language absolutely fucking sucks.

Anthropic Dominates OpenAI: A Side-by-Side Comparison of Claude 3.5 Sonnet and GPT-4o

Anthropic is beating OpenAI at their own game. Austin Starks ∙ 9 min read ∙ View on Medium Anthropic Dominates OpenAI…

nexustrade.io
Preview image

What I DESPISE About Rust

If you want to find an article about what’s right with Rust, look literally anywhere on the internet. You’ll be hard-pressed to find anything less than neutral about the language. This article will be a focused rant about what I despise about this crabby language.

The Rust Mascot is a Crab. Get it? Because its crappyThe Rust Mascot is a Crab. Get it? Because its crappy

Horrendous, verbose, unintuitive syntax and semantics

An example of a complex Rust functionAn example of a complex Rust function

Anybody who ever said that Rust doesn’t have atrocious semantics is lying to your face. There are certain things where, if you don’t have access to an extremely powerful Large Language Model, then writing the function becomes literally impossible. I don’t want to spend 90 minutes figuring out the where clause in my run_transaction function. I just want to write my damn function.

In the end, I had to abandon the idea of a helper function entirely, because I quite literally couldn’t get the code to compile. What people claim as Rust’s biggest strength (a strict compiler to eliminate errors) is one of Rust’s biggest flaws. Just give me a garbage collector, and let me do what I want to do!

In contrast, if I were writing this exact same function in Go, it would look something like this:

The Go implementation of the functionThe Go implementation of the function

While the core of the function remains relatively the same, you don’t have to do backflips to figure out how to make the dang code work. It just works!

Six Years Ago, this Redditor proposed "the Neckbeard Index". It's DEMOLISHING the Market

I was scrolling Reddit to get backtest ideas for my algorithmic trading platform. Long ago, I had heard of "the White…

nexustrade.io
Preview image

Horrendous Error Handling

Rust does do some very nice things with errors. As long as you avoid unsafe unwraps , you can be damn sure that the code will run and keep running. NilPointerExceptions and unhandled errors just don’t happen anymore. Yay! (right?)

Wrong. Because when your data is wrong or something unexpectedly happens, you will be FIGHTING to figure out what the hell happened. Maybe I’m just an idiot and can’t figure out how to enable stack traces. But when an error happens in my application, I have no idea why!

Where the hell is my stack trace???Where the hell is my stack trace???

In contrast, with a language like Python, you get these beautiful, art-like stack traces that tell you exactly what happened, down to the line number! Even in Go, you have errors.Wrap(...) , which enable you to look at the entire error stack in your application. Perhaps I’m a goddamn idiot, because when I encounter an error in Rust, I’m in Lala land tryna figure out what the hell happened. I need an eprintln!(...) littered throughout my application.

In fact, no, I’m not an idiot. This is a flawed language design.

If you can’t beat them… steal their idea. Creating a better algotrading system

My business started off as a passion project.

medium.datadriveninvestor.com
Post image

Crabby Community

Hot take: the Rust community isn’t as nice and cool as they pretend to be. They’re a bunch of narcissistic assholes that hate being told that their favorite language has flaws.

An example of a rustaceon providing “”helpful”” advice to my questionAn example of a rustaceon providing “”helpful”” advice to my question

For example, I asked a question on the Rust subreddit about how to improve error handling with the MongoDB Rust crate. My answers ranged from:

  • Switch to Postgres (yeah, like I’m going to re-design my entire database because of some crappy error messages)
  • Why am I using MongoDB at all? (I like it. Next question?)
  • MongoDB is bad in Go and Python too (Maybe it is, maybe it isn’t. It’s fine in TypeScript, and your whataboutism doesn’t answer my question)
  • (Rare) An actually helpful suggestion to improve the error messages

There is no other programming community that’s as cult-like as Rust. They ignore all of the giant glaring flaws with the language, like its crazy learning curve, verbosity, horrible error messages, crazy syntax and questionable language design choices; they’d rather say it’s a skill issue with the developer. That’s insane to me!

Final Words

With all of this being said, Rust has some pros. It’s fast and…. well, that’s mainly it.

I guess it’s also safe too. If we compare it to C++, it’s obviously the better language. But when compared with other languages (like Go), its “safety” to me is more of a detriment. I’d rather my application take a few dozen milliseconds longer to run if it means my development time is cut in half.

On the bright side, if I chose to write my app in Go, I’d also probably have some regret. “What if it could be faster?” I’d think to myself. “There’s yet another article about how Rust is the best thing since sliced bread. Oh geez. I made a mistake!”

At the very least, now that I know Rust, I feel like I can learn anything. Maybe I’ll pick up OCaml for the hell of it. It can’t be too much worse than Rust, can it?

···

Thank you for reading! If you’re interested in algorithmic trading and AI subscribe to Aurora’s Insights! Want to see how fast Rust really is? Create an account on NexusTrade today!

NexusTrade - AI-Powered Algorithmic Trading Platform

By far the best algorithmic trading experience. Learn to conquer the markets by deploying algorithmic trading…

nexustrade.io
Preview image

Discussion

Sign in or create a free account to join the discussion.

No comments yet.