• 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

one more thing..

If Rust is the answer, what is the question, i.e. why all the hullabaloo?

Thinking out loud.

1. Better memory mgt than C++.

2. Better language features than C++ (at face value, can't imagine that).

3. Call C++ from Rust(*). 3A. vide versa.

4. Rust's channels look promising (asynch)

5. "Rust good, C++ bad" (not my words) ... the language wars continue, alas. Rust is not a "better C++".

6. Actor framework in Rust.

7. Rust programmers w/o C++ savvy can use option 3 (cf. Python calling numpy, scippy).


3, 4 and 6 look interesting.

(*) hopefully no ptr problems in the wrapped code.
 
Last edited:
one more thing..

If Rust is the answer, what is the question, i.e. why all the hullabaloo?

Thinking out loud.

1. Better memory mgt than C++.

2. Better language features than C++ (at face value, can't imagine that).

3. Call C++ from Rust(*). 3A. vide versa.

4. Rust's channels look promising (asych)

5. "Rust good, C++ bad" (not my words) ... the language wars continue, alas. Rust is not a "better C++".

6. Actor framework in Rust.

7. Rust programmers w/o C++ savvy can use option 3 (cf. Python calling numpy, scippy).


3, 4 and 6 look interesting.

(*) hopefully no ptr problems in the wrapped code.
1 and 3 are most interesting to me. But that’s probably because I feel less confident about memory than you do.
 
General Remark: wondering why developers have issues with pointers?

1. Are you using raw or smart pointers?
2. Incorrect use of raw pointers (code is a ball of mud with no centralised control).
3. Wrong design, no modular decomposition.
4. Developer does not fully understand pointers/using them incorrectly.
5. Write parts of code using stack memory.
6. Using template classes C<T> (no ptr needed), only in main() do stuff like C<Widget> w = new Widget(..)). Localise where you use pointers.
7. Smart pointers across the board. Problem solved?

These are possible symptoms. There may be more.
I am interested in your views.
 
Last edited:
General Remark: wondering why developers have issues with pointers?

1. Are you using raw or smart pointers?
2. Incorrect use of raw pointers (code is a ball of mud with no centralised control).
3. Wrong design, no modular decomposition.
4. Developer does not fully understand pointers/using them incorrectly.
5. Write parts of code using stack memory.
6. Using template classes C<T> (no ptr needed), only in main() do stuff like C<Widget> w = new Widget(..)). Localise where you use pointers.
7. Smart pointers across the board. Problem solved?

These are possible symptoms. There may be more.
I am interested in your views.
Smart pointers aren’t a one size fits all solution.

Many applications still use raw pointers. Some need to and some don’t. But they exist in either case and there are plenty of segfaults that result.
 
So, Rust is a silver bullet?

If you are getting segfaults with smart ptrs probably means you are doing something wrong.. At the least, this should be investigated.

But the core question remains: what is the root cause of this fiasco?
 
Last edited:
Smart pointers aren’t a one size fits all solution.

Many applications still use raw pointers. Some need to and some don’t. But they exist in either case and there are plenty of segfaults that result.
We still have a lot of C code and you imagine raw pointers rule the land there.
 
8. Rust to C use cases. Clearly a case of legacy (incorrect) code?
I also think once all the systems code or most of it migrates to Rust, you'll have tons of interop opportunities between C++ risk and pricing analytics and Rust, as well as Python interop with both Rust and C/C++. What a time to be alive 😎🫡🥩👌🏻
 
So, Rust is a silver bullet?

If you are getting segfaults with smart ptrs probably means you are doing something wrong.. At the least, this should be investigated.

But the core question remains: what is the root cause of this fiasco?
That’s my question….is Rust actually a silver bullet like all the rust advocates claim?

The segfaults are with raw pointers. Very rarely using smart pointers actually because they are too expensive.
 
I think pricing libraries will never be (re)written in Rust. No way. C++ is forever here.
Just like rewriting Fortran libraries in Java.
 
That’s my question….is Rust actually a silver bullet like all the rust advocates claim?

The segfaults are with raw pointers. Very rarely using smart pointers actually because they are too expensive.
Thus, C code is wrong, the root cause. Clear.
 
We should entertain all scenarios, one of which Rust is and will remain a niche product. It may have vocal cheerleaders. Due diligence and all that.
Of course, I still think Rust-C++ interop is important.
 
Last edited:
"To prevent the unexpected execution of batch files, you should consider moving the batch files to a directory that is not included in the PATH environment variable," Ryotak advised.

"In this case, the batch files won’t be executed unless the full path is specified, so the unexpected execution of batch files can be prevented."

In February, the White House Office of the National Cyber Director (ONCD) urged technology companies to adopt memory-safe programming languages like Rust. The end goal is to improve software security by minimizing the number of memory safety vulnerabilities.


ONCD has some homework to do?
Seems to me it would be on a 101 checklist?

//
Feels a bit like SQL injection??

 
Last edited:
Back
Top