How to not rewrite it in Rust
adventures.michaelfbryan.com
How to not rewrite it in Rust
1–10 of 231 posts
Re: How to not rewrite it in Rust
#2Re: How to not rewrite it in Rust
#3> at best, the temptation to RiiR is unproductive (unnecessary duplication of effort)
For tiny, mature libraries, this might be true.
But a rewrite in Rust can also vastly improve maintainability. If a library is under heavy maintenance (and will continue to be), your investment in rewriting it is likely to pay dividends by saving developers -- especially ones who are new to the library -- a lot of time.
Re: How to not rewrite it in Rust
#4I think I must reject the premise a bit, unless I misunderstand how Rust works.
If you write a safe wrapper around unsafe code, is it not still the case, that if the unsafe code bombs out, it will take the safe Rust down with it, engulfed in shared flames?
(Unless you spawn unsafe code in its separate process or something elaborate like that.)
(Then again, from a practical standpoint the reasoning may be good. Maybe, even likely, the C library is very good and very battle tested. And very likely, my novice would be re-implementation in Rust would not be very good.)
Re: How to not rewrite it in Rust
#5Autoconf creates a portable shell script, right? No need to have it installed just to build the project.
Re: How to not rewrite it in Rust
#6Re: How to not rewrite it in Rust
#7> This may be problematic because it’ll require all users of our chmlib crate (and their users) to have Autotools installed. Autoconf creates a portable shell script, right? No need to have it installed just to build the project.
Re: How to not rewrite it in Rust
#8I still have issues with Rust string handling. Half of the time I have no idea how to get strings out of libraries. I don't understand the intentions of the language creators at all. Does anybody have a great intro to Rust for software engineers who come from Python or something similar where high level types are the norm?
Did you happen to read the book? We cover strings early because this is a common pain point.
Also, if you have something more detailed than "get strings out of libraries", I can give better advice. It's tough to tell what the actual issue is.
Re: How to not rewrite it in Rust
#9> This may be problematic because it’ll require all users of our chmlib crate (and their users) to have Autotools installed. Autoconf creates a portable shell script, right? No need to have it installed just to build the project.
Why they published it like this is beyond me, however. The whole point of autotools is not making your users install them (unlike CMake and virtually every other build system for C there is).
Re: How to not rewrite it in Rust
#10The title should be "how to not" rather than "how not to".