News for hackers. Stuff that matters.
Re:Improving Interoperability Between Rust and C++ by wegfawefgawefg on Monday February 05, 2024 @01:04PM (#39264408)
Doing ffi from c to python is easy. From rust to python is annoying. Have to use unsafe, and weird parts of the rust stl. funky refs. Random crashes! oi vey.
Re:Improving Interoperability Between Rust and C++ by Shawnecy on Monday February 05, 2024 @01:08PM (#39264453)
Not my experience at all. At work we rewrote a small bit of hotspot python in Rust with no issues. This was what we primarily followed: https://ohadravid.github.io/posts/2023-03-rusty-python/
Re:Improving Interoperability Between Rust and C++ by gnatolf on Monday February 05, 2024 @02:07PM (#39265498)
Thank you for that great link!
Re:Improving Interoperability Between Rust and C++ by shadowgovt on Monday February 05, 2024 @01:07PM (#39264439)
The followup question is "Is it easy in C because it's actually easier or because the result is code that has a half-dozen hidden undefined-behavior mines that C does a poor job of detecting at compile time?"
Re:Improving Interoperability Between Rust and C++ by wegfawefgawefg on Tuesday February 06, 2024 @01:46AM (#39271502)
Rust isnt safe across the ffi barrier, so its not a fair criticism of c. go check it out.
Re:Improving Interoperability Between Rust and C++ by shadowgovt on Tuesday February 06, 2024 @10:20AM (#39275129)
It isn't safe, true.

Is it, on average, safer?

Re:Improving Interoperability Between Rust and C++ by wegfawefgawefg on Tuesday February 06, 2024 @11:17AM (#39276128)
If i remember correctly it can even be worse.