
Rewrite Tor in Rust - Jonhoo
https://trac.torproject.org/projects/tor/ticket/11331
======
kibwen
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).

~~~
alexnewman
You end up having to toss a layer of c around your c++ last time I checked.
Does c++ even have an abi yet?

~~~
roblabla
well, not a standard one. That's what extern "C" is for : if you want a
standardized API, C always had one.

~~~
gpderetta
Neither C nor C++ have a standardized ABI, if by standardized you mean part of
their respective ISO standard. Nor they could, as the many of ABI properties
(names, calling conventions, layout, object and executable file format) are
intimately platform (as in OS and CPU) specific.

Most platform officially specify their C ABI, and many also specify their C++
ABI (usually in therm of the C one). Itanium C++ ABI (plus the platform
specific psABIs) has become the de facto C++ ABI for many unix and unix-like
platforms.

------
axman6
As a side note, Galois have written an implementation of Tor which happily
interacts with official tor, for use in HalVM based unikernels. So, if you
want ephemeral tor nodes, HalVM is a pretty great way to get it working.

Edit: Video about it [2]

[1] [https://github.com/GaloisInc/haskell-
tor](https://github.com/GaloisInc/haskell-tor) [2]
[https://www.youtube.com/watch?v=oHcHTFleNtg](https://www.youtube.com/watch?v=oHcHTFleNtg)

------
CoconutPilot
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
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.

~~~
ycombinatorMan
what good would come of this, to be honest?

------
erlend_sh
The discussion is 10 months old and never went anywhere. What makes this
relevant now?

------
roywiggins
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...

