登録: 2年前

最終更新: 5週前

#11331 new project

rewrite tor in rust-lang

報告者: cypherpunks 担当者:
優先度: Medium マイルストーン: Tor: very long term
コンポーネント: Core Tor/Tor バージョン:
重要度: Normal キーワード:
関係者: gk, erinn Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

詳細

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

Child Tickets

更新履歴 (8)

comment:1 更新者: nickm (2年前)

  • マイルストーン Tor: very long term に設定

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! ;)

comment:2 更新者: frewsxcv (10ヵ月前)

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-that
10:32 AM <nickm> frewsxcv: rewriting as much as possible of routerparse.c could have concrete benefits
10:33 AM <nickm> frewsxcv: oh, in that case, try tor-resolv.c
10:33 AM <nickm> it depends on nothing
10: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 algorithmic
10:34 AM <nickm> Yawning: yeah but you already rewrote it in go
10:34 AM <nickm> as for things where rust is a good choice, though, our inner loops are most important, and not very isolated :/

Also it looks like dhuseby has already written a config parser https://github.com/dhuseby/torrc-rs

comment:3 更新者: gk (10ヵ月前)

  • 関係者 gk を追加

comment:4 更新者: nickm (10ヵ月前)

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

comment:5 更新者: frewsxcv (10ヵ月前)

Here's a relevant metabug from Mozilla's Bugzilla regarding integrating Rust compilation support into the build system for Gecko:

https://bugzilla.mozilla.org/show_bug.cgi?id=1135640

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.

comment:6 更新者: nickm (10ヵ月前)

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.

comment:7 更新者: gk (6週前)

  • 重要度 Normal に設定

#18621 is a duplicate.

comment:8 更新者: erinn (5週前)

  • 関係者 erinn を追加
詳しい使い方は TracTickets を参照してください。