4 ms·
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.
by wegfawefgawefg 3y ago
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.
- shadowgovt 3y agoThe 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?"
- wegfawefgawefg 3y agoRust isnt safe across the ffi barrier, so its not a fair criticism of c. go check it out.
- shadowgovt 3y agoIt isn't safe, true. Is it, on average, safer?
- wegfawefgawefg 3y agoIf i remember correctly it can even be worse.
- Shawnecy 3y agoNot 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/ https://ohadravid.github.io/posts/2023-03-rusty-python/
- gnatolf 3y agoThank you for that great link!