top | item 11617917

Rewrite Tor in Rust

94 points| Jonhoo | 10 years ago |trac.torproject.org

27 comments

order
[+] kibwen|10 years ago|reply
The OP is likely nothing more than wishful thinking, but I can see why people are intrigued by the prospect. An important thing to note is that it's entirely possible to perform a slow, gradual integration of Rust code into a C/C++ codebase (such as Mozilla is doing with Firefox), but only if your codebase is sufficiently modular with well-defined interfaces for Rust-based libs to slot into. If all you've got is a big ball of mud, then your first step is to work on the modularization of your codebase (which, IMO, has a good chance of increasing your code quality regardless of whether you eventually decide to introduce any Rust).
[+] voiper1|10 years ago|reply
>If all you've got is a big ball of mud, then your first step is to work on the modularization of your codebase (which, IMO, has a good chance of increasing your code quality regardless of whether you eventually decide to introduce any Rust).

I wanted to up-vote that bit.

[+] MichaelGG|10 years ago|reply
Since Rust and C can agree on ABI and memory layout issues, you can move the code over function-by-function if you were so inclined, right? Declare the structs in the headers and auto-gen the Rust versions (is there a tool for the inverse?).
[+] alexnewman|10 years ago|reply
You end up having to toss a layer of c around your c++ last time I checked. Does c++ even have an abi yet?
[+] CoconutPilot|10 years ago|reply
Is there an anti-pattern for this kind of thing? Its a two line bug report suggesting years of development effort. There is a huge multiplication factor between the time invested by the bug reporter and the time required to do what he asks.
[+] alexnewman|10 years ago|reply
Only if your goal is to doom the existing tor project. Lots of great research projects start this way. Often times it influences the main project or merges.
[+] erlend_sh|10 years ago|reply
The discussion is 10 months old and never went anywhere. What makes this relevant now?
[+] roywiggins|10 years ago|reply
It would be a bit embarrassing to rewrite in Rust and then have the network penetrated because they screwed up the crypto during the rewrite...