Rust provides many features that would benefit Tor like memory safety, etc. Writing C code that is safe is super hard (even for exeperienced Tor devs).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Not likely to happen except as an effort to refactor Tor into different modules and rewrite piece-by-piece. OTOH, there's nothing stopping somebody from doing a compatible implementation in whatever language they like. Rust enthusiasts: Prove the superiority of your language by writing a simpler, better, bug-free Tor today! ;)
I'm really interested in getting the ball moving for this. I'm going to look how the Mozilla devs integrated Rust into Firefox. Also, like nickm said in the previous comment, this should be done module by module. nickm gave me suggestions on IRC:
10:32 AM <nickm> frewsxcv: the workqueue.c code is a bit independent, is inherently threaded, and might be a good test of one's rust skills.10:32 AM <nickm> frewsxcv: di_ops.c might be an even deeper test of whether-rust-can-even-do-that10:32 AM <nickm> frewsxcv: rewriting as much as possible of routerparse.c could have concrete benefits10:33 AM <nickm> frewsxcv: oh, in that case, try tor-resolv.c10:33 AM <nickm> it depends on nothing10:33 AM <nickm> Yawning: i think a wholesale rewrite is a bad choice, but that a piecemeal rewrite might be clever.10:33 AM <nickm> frewsxcv: also, dircollate.c is mostly algorithmic10:34 AM <nickm> Yawning: yeah but you already rewrote it in go10:34 AM <nickm> as for things where rust is a good choice, though, our inner loops are most important, and not very isolated :/
Replacing torrc parsing in rust could be fun but we don't expect hostile input there.
buffers.c would be an interesting candidate, since it's low-level, performance-critical, and security-critical.
Nearly everything in src/tools is interesting but unlikely to be security-critical (in the sense that it doesn't need to handle tricky hostile inputs.)
I took a look at the 'configure.ac' file with the hopes of integrating rustc into the build system. Needless to say the contents of it intimidated me a bit, but I haven't worked with many large C projects before so this sort of config file might be pretty common practice (unfortunately?). If anyone has any suggestions on where to start with respect to incorporating rustc into the build process, let me know.
So in theory, the part that would need integration would be the various automake files (the various include.am files, plus Makefile.am).
Searching for "rust automake" gets a few hits, but I don't know if any are relevant.
One possibility is to better split Tor up into sublibraries, so that the C parts and the rust parts get built separately, but that would require a bit of rethinking, maybe.
I'm closing this ticket, since a rewrite in any language is so large as to extend across multiple releases and milestones. The granularity here is just too high for a single ticket.
That doesn't mean no progress has been made, though. Right now, Tor has exploratory support for building with some parts of it in rust. If this works out well, and we manage to get things working nicely on every platform we care about, we can start figuring out which areas are highest-priority for doing in a safe language, and start opening tickets for them.
Trac: Resolution: N/Ato invalid Status: new to closed Keywords: N/Adeleted, rust added