Discover your dream Career
For Recruiters

Why do banks insist on using C++ when Rust is twice as efficient?

The programming language Rust has been on the verge of big breakthrough for years now and, in the world of big tech, that breakthrough might be just around the corner. Lars Bergstrom, a director of engineering at Google, said recently that, when rewriting C++ code, his team has seen a "decrease by more than 2x in the amount of effort required" to build and maintain it in Rust. Surely lots of companies would want to capitalize on those productivity gains... right? Well.

 

 

Click here to sign up to our technology newsletter 🔧

 

The world of financial services tends not to care. In hedge funds and banks, Rust engineers are few and far between. The exception is always crypto; Sam Tenzer, a senior recruiter at Selby Jennings says he has seen "a high demand for low-latency rust developers", and a recent market report from Calyptus revealed a "big increase in roles requiring Rust experience" working on smart contracts. 

Steve Taylor is one of the few working in banking, rewriting some low-latency C++ trading systems in Rust for a major bank. He spoke to eFinancialCareers about the benefits and challenges the language poses compared to the industry standard C++.

How Rust is better than C++

As you likely already know, Rust's key benefit over C++ is its safety. Taylor says "Rust, once written, turns a large percentage of very difficult to trace bugs into compile time bugs," meaning you won't be able to run the code properly until they're dealt with. The bugs it most effectively targets are ones where the code "can work 100 times" but incite "hell on earth" on the 101st. Using Rust will "eliminate an entire category of runtime issues." The compiler is (almost) "bulletproof," providing a certain level of comfort once its up and running.

C++ is meant to be the fast language, but Taylor says "well written Rust code is as fast, sometimes faster." This is because Rust enforces having only one mutable reference, allowing it to "optimize code in ways it can't do in C++." For example, this approach prevents data races, making your performance much more predictable, and thus, improvable.

Rust is not easy to get to grips with, but if you can handle it the rewards are exponential. Taylor says you "pay a hefty cost with the learning curve before you get the productivity benefit." Ultimately, Taylor says Rust "formalizes what you should be doing in C++ anyway."

How C++ is better than Rust

Rust's benefits have their inherent drawbacks; with its safety comes a great deal of frustration. Even when you "know for a fact the code will be fine," the potential for a 1 in a million bug can halt progress. Rust has a reputation for being nice to its coders but Taylor disagrees; he says that while "C++ takes you by the hand, Rust takes you by the throat."

The learning curve is perhaps the most significant barrier to widespread adoption. Taylor says "it's very hard to learn rust if you're not being paid to." His first exposure to the language came when he built a crypto trading platform, a job he initially thought he would be doing in C++. Its difficulty causes casual coders to give up early and disincentivizes larger companies from using it, as the process of training up its employees becomes more arduous and costly. If not costly for the company, it can be costly for the employee; the Calyptus report said that junior rust engineers are some of the lowest paid employees in the Web3 space.

Low paying Rust jobs are another reason the language hasn't taken off. Technologists in the prop trading space are beginning to experiment with Rust, but due to a lack of Rust jobs with elite pay (and a comparative abundance of C++ ones), it's hard to guarantee those experiments become anything more than just that.

He adds that C++ is "more graceful" while Rust is "verbose." C++ also has a more extensive set of libraries, meaning you might find yourself having to build a lot more from scratch using Rust, especially if you're a fan of lesser used techniques.

Will Rust jobs in finance ever become popular?

In finance, Taylor says there's "enthusiasm for Rust, and frustration at how few Rust programmers are available." Whe hiring for Rust jobs in the past, he said he would receive "three Rust CVs in three or four months... and about 50 C++ CVs." 

Taylor predicts Rust will become more common in the future. But unfortunately (and especially as people begin to suggest coding itself is going out of fashion) it may always remain on the fringe. 

Have a confidential story, tip, or comment you’d like to share? Contact: +44 7537 182250 (SMS, Whatsapp or voicemail). Telegram: @SarahButcher. Click here to fill in our anonymous form, or email editortips@efinancialcareers.com. Signal also available.

Bear with us if you leave a comment at the bottom of this article: all our comments are moderated by human beings. Sometimes these humans might be asleep, or away from their desks, so it may take a while for your comment to appear. Eventually it will – unless it’s offensive or libelous (in which case it won’t.)

author-card-avatar
AUTHORAlex McMurray Editor
  • vi
    vikingvista
    22 April 2024

    "The world of financial services tends not to care."


    The second half of you article contradicts this sentence. If it seems they don't care, it is because the person doing the seeming is overlooking some costs.

  • Hu
    Huh?
    21 April 2024

    This author doesn't know shit about what he is talking about.


    First he claims Rust has 2x more efficiency than C++ which is just completely wrong. He's also not even using the term "efficiency" correctly when discussing a programming language. He is considering "efficiency" as the time it takes to write a program in that language, and not the performance of that program actually running.

  • Pl
    PlotArmouedTitan
    19 April 2024

    2x performance at the cost of freedom is not worth it for me

  • SK
    SK11
    19 April 2024

    Probably because millions of lines of mission critical code that has been developed and tested is kinda difficult to replace and get right.


    Often, most production behaves as required, and make lack clear specs.


    Makes sense for new code.

  • Eh
    EhCanadian
    19 April 2024

    This article should be comparing Rust to Cobol or Ada, not C++.


    I can't speak on Cobol from personal experience, but I can speak on Ada. Ada supports almost all the safety features of Rust, and a few that Rust doesn't support, like arithmetic bounds checking. Furthermore, Ada produces very efficient code (in terms of memory usage and processing time) with predictable timing making it suitable for realtime systems like Avionics, something Rust cannot do!


    To me, Rust is unneccessarily re-inventing the wheel. Rust is simply the hip new language for Gen Z, while Cobol and Ada are seen as Boomer languages.


    As for Rust and C++, Rust is limited to the kinds of applications that used Cobol. It cannot do all that C++ can do, and will therefore never be as prolific.

Sign up to Morning Coffee!

Coffee mug

The essential daily roundup of news and analysis read by everyone from senior bankers and traders to new recruits.

Boost your career

Find thousands of job opportunities by signing up to eFinancialCareers today.
Recommended Articles
Recommended Jobs

Sign up to Morning Coffee!

Coffee mug

The essential daily roundup of news and analysis read by everyone from senior bankers and traders to new recruits.