Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

One upside of learning Rust first is that it will provide guidance on how to write C++ code afterwards, so that might be valuable.


Also, isn't it easy to make FFI calls to C/C++ libs from Rust when you need to interface with an already existent codebase?


Making FFI calls to C is pretty easy and writing the FFI interface definitions can be completely automated with tools like bindgen [0]. Making FFI calls to C++ is a lot harder to do by hand, although cxx[1] is supposed to make doing so a lot easier as long as you can control the C++ end as well to be able to make it compatible with Rust Strings/Vectors/etc.

[0] https://github.com/rust-lang/rust-bindgen

[1] https://github.com/dtolnay/cxx


The point for me to learn C or C++ over Rust is not to interface with an existing codebase, but gaining proficiency in reading & modifying it.

You certainly will also gain that proficiency simply by learning Rust to some degree, but I think it helps to have written both C and C++ to be more fluent.

If that is necessary greatly depends on your needs. I rarely had to modify or read the actual code of libraries I used, but when I had to, I am not sure how I could have solved the problem otherwise. For me it is sometimes quicker to read the code, than treating it like a black-box and trying to figure out what is supposed to happen by often outdated documentation and examples.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: