Re:How to not rewrite it in Rust
by zbentley on Wednesday October 23, 2019 @03:01PM
(#21337714)
Why not use ffi for this case? Many languages have robust support for linking to Rust code.
[ Parent
| on HN ]
Re:How to not rewrite it in Rust
by gameswithgo on Wednesday October 23, 2019 @03:38PM
(#21338095)
yeah sometimes that makes sense. if the lib in question in small enough it might be more valuable to port, so avoid having a multi language project, and avoid the effort of the ffi.
at least Rust -> C ffi is zero cost (usually)
Having everything available in Rust code also means you don't have to do lots of extra work for cross-compilation.
How does Rust help you if you have to cross-compile?
You can compile rust in one go. If you rely on native libraries, you need to be able to link them during cargo build and that's painful to set up. Not impossible... just really annoying to manage.