• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

C++ vs Rust

Why not do both?

A big miss in C++ is support for asychronicity, events, signals, Actor model.

TBH, saying that Rust is great for memory management is not all that exciting.
 
Last edited:
Why not do both?

A big miss in C++ is support for asychronicity, events, signals, Actor model.

TBH, saying that Rust is great for memory management is not all that exciting.
Memory management seems to be one of the primary selling points that Rust advocates claim over C++.

As for why not both - I only know of one company that uses Rust and it’s a financial data as a service company called Databento. So there’s really no point of learning it if no one uses it.
 
Morgan Stanley uses Rust, but we still overwhelmingly use C++. There is also lots of legacy Java/Scala code haunting us that a lot of groups are porting to combinations of C++, Rust, and Python.

Make C++ better and better but also get good at Rust. Good to cover all your bases.
 
D
Morgan Stanley uses Rust, but we still overwhelmingly use C++. There is also lots of legacy Java/Scala code haunting us that a lot of groups are porting to combinations of C++, Rust, and Python.

Make C++ better and better but also get good at Rust. Good to cover all your bases.
Which groups favor Rust over C++ and why (if you can share)?
 
Memory management seems to be one of the primary selling points that Rust advocates claim over C++.

As for why not both - I only know of one company that uses Rust and it’s a financial data as a service company called Databento. So there’s really no point of learning it if no one uses it.
never say never.
Maybe it will take over in 10-20 years.
 
D

Which groups favor Rust over C++ and why (if you can share)?
Sorry about that sir I missed this! I can only speak for our team specifically about the why, although I imagine every team is always looking to do things in a way that is easier to maintain. Any team that has to process large amounts of data and/or has a somewhat complex schema for their data are looking into Rust. For right now it seems to be used mostly for infrastructure type dev work more so than calculations to risk or price derivatives. Code that is legacy in C/C++ or Java are prime candidates for this migration. While I am specifically in a fixed income derivatives team, I know it is being looked at by commodities, foreign exchange (FX), and equity teams as well with similar future concerns when it comes to their data.

For us we have lots of data that we need to slice through in json and xml formats from various external and internal sources that aren't from our own team for financial data. The current code that is in C or Java is extremely hard to maintain, if not outright just bad with memory leaks that require jobs to be restarted every other day type thing. While I would personally love to hire a couple skilled C guys to clean up these processes/jobs, the kids coming out of school just aren't trained to think like the C programmers of old. Even when I went to school in the early 2000s, we were taught Java and not C. The memory management and concurrency use cases they have in Rust with their ownership model make things substantially better once we get things to compile properly.

We also have the added excitement/pressure of needing a language that is interoperable with Python, as this is a language that is almost sure to come up somewhere in the development cycle for one of the layers. It is why we are eagerly awaiting Professor Duffy's book as well. :)

Happy to answer any specific questions if I can!
 
Our manuscript is in the copy/print edit phase. Contents are ready. We discusss Cython.
I Volume II (2025 hopefully) ==> more interop e.g. pybind11, Boost Python.
 
Sorry about that sir I missed this! I can only speak for our team specifically about the why, although I imagine every team is always looking to do things in a way that is easier to maintain. Any team that has to process large amounts of data and/or has a somewhat complex schema for their data are looking into Rust. For right now it seems to be used mostly for infrastructure type dev work more so than calculations to risk or price derivatives. Code that is legacy in C/C++ or Java are prime candidates for this migration. While I am specifically in a fixed income derivatives team, I know it is being looked at by commodities, foreign exchange (FX), and equity teams as well with similar future concerns when it comes to their data.

For us we have lots of data that we need to slice through in json and xml formats from various external and internal sources that aren't from our own team for financial data. The current code that is in C or Java is extremely hard to maintain, if not outright just bad with memory leaks that require jobs to be restarted every other day type thing. While I would personally love to hire a couple skilled C guys to clean up these processes/jobs, the kids coming out of school just aren't trained to think like the C programmers of old. Even when I went to school in the early 2000s, we were taught Java and not C. The memory management and concurrency use cases they have in Rust with their ownership model make things substantially better once we get things to compile properly.

We also have the added excitement/pressure of needing a language that is interoperable with Python, as this is a language that is almost sure to come up somewhere in the development cycle for one of the layers. It is why we are eagerly awaiting Professor Duffy's book as well. :)

Happy to answer any specific questions if I can!
Maybe this is why Databento uses it. Large amounts of data processing.

I am intrigued by some of its features, but will probably just keep studying C++. The puck may be moving towards Rust, but it’s a pretty slow moving puck.
 
How to install Rust on Windows?

@Paul Lopez

Not sure how I feel about my C++ hero asking me about Rust :LOL:

Their website is halfway decent, it recognizes which OS you are running and takes you through steps.


For our friends that like PyCharm, IntelliJ, or CLion Jetbrains based IDEs, they have a fairly new Rust specific IDE called RustRover that I absolutely recommend if you don't like Visual Studio: RustRover: Rust IDE by JetBrains
 
Maybe this is why Databento uses it. Large amounts of data processing.

I am intrigued by some of its features, but will probably just keep studying C++. The puck may be moving towards Rust, but it’s a pretty slow moving puck.
Absolutely. Blockchain/web3 firms like it too. The good news there is they love C++ devs because it's relatively easy for us to pick up Rust...at least compared to Java or Python only heavy folks. Solana is a prime example.
 
Absolutely. Blockchain/web3 firms like it too. The good news there is they love C++ devs because it's relatively easy for us to pick up Rust...at least compared to Java or Python only heavy folks. Solana is a prime example.
Do you think I could quickly pick up Rust? Interop is the key issue.
Can I use this thread if I am stuck?
PATH stuff?
 
Do you think I could quickly pick up Rust? Interop is the key issue.
Can I use this thread if I am stuck?
PATH stuff?
Easily I think! Happy to have any Prof Duffy Rust issues fixed here or in its own thread. 😎 Whatever is best for you.

I think you'll hate the compiler at first, then grow to love it after about 10-12 hours 👌🏻🥩🍷
 
Are you doing rust/python/C++ interop for your book? Make a third C++ course please 😆
Volume II is the interop book.
Am thinking about Rust/C++.
What are the uses cases?
1. Call C++ from Rust
2. Vice versa
3. Using Rust Actor frameworks?

no idea 🙃
 
Last edited:
Back
Top