Replies: 3 comments 5 replies
-
to be honest i would love to, but i think for now our priority is to reach 1.0 and cleanup. |
Beta Was this translation helpful? Give feedback.
-
My opinion is simple - I do write and love Rust but Rizin code is huge (more than 2M+ lines of code if you count all projects under rizinorg), rewriting it would be immense effort that with our limited resources could span for decades. If I write something like that from scratch, I would certainly use Rust. For creating Rust plugins providing the C API - sure, you can do it right now. Another thing about Rust - it's not as portable as C just yet - some of the targets where Rizin can work right now wouldn't be possible if we rewrite it, think, for example, MacOS PPC, or HPPA. Rizin is a special case due to being debugger as well, supporting old platforms like Debian Wheezy, which we even test on our CI. |
Beta Was this translation helpful? Give feedback.
-
Wasn't there one rust rewrite from scratch attempt before done by one of rizin or r2 devs? Can't remember who tried that and the name of repository. |
Beta Was this translation helpful? Give feedback.
-
Rizin has already made amazing progress towards it's goals of
Over the long term, however, rizin would be greatly benefitted by integrating a modern language that can provide safety guarantees and cost-free abstractions. In this regard, Rust has emerged as the clear successor to C/C++ for performance-critical projects. The advantages of Rust over its predecessors, which I'm sure the rizin devs are familiar with, have already caused projects as large as the Linux kernel to begin integrating Rust into their existing codebase.
Some benefits for rustified rizin would include:
rz_list_*
. Cleaner code with iter(), map(), fold(), etc.librz
could eventually be refactored into a cargo workspace, allowing people to import individual parts as cratesAs far as the practical bits -- there seem to be two ways to approach this. Since most of the rizin is in pure C, it may be possible to use a tool like c2rust to mostly-automatically translate the C codebase into unsafe Rust, which can be ported to safe and elegant Rust manually over time. Alternatively, rizin could support a mixed codebase, using bindgen to generate an interface between the C and Rust bits. I'm guessing the latter solution would be smoother, and would be made easier by the fact that meson supports Rust integration and cargo can integrate with most C build systems.
Depending on the approach taken, it could create a lot of work in the short term, but I'm sure that in a year or two everyone would be glad about the migration/integration. A successful migration would surely generate a lot of interest in rizin.
I acknowledge that this suggestion is a bit audacious -- but regardless of if the core team is interested in undertaking this effort, I'd be interested to hear their thoughts on it, including reasons this is a bad idea or infeasible.
Beta Was this translation helpful? Give feedback.
All reactions