Live data from Hacker News

Tor in a safer language: Network team update from Amsterdam

lists.torproject.org

1–10 of 254 posts

Re: Tor in a safer language: Network team update from Amsterdam

#4

I am curious why they were advised not to use Go. Probably not a safety concern. Edit: cgo != Go. Thanks for the responses. I have done a bit of Go, but just pure Go.

They were advised against cgo. In my not so recent experience, it is a huge PITA.

Re: Tor in a safer language: Network team update from Amsterdam

#7

I am curious why they were advised not to use Go. Probably not a safety concern. Edit: cgo != Go. Thanks for the responses. I have done a bit of Go, but just pure Go.

Go needs a garbage collector that needs to be set up. Using Go code within C code is possible, but it creates additional hurdles.

Therefore a slow transition of rewriting parts of the code in a safer language and having the core still in C is much less feasible with Go. With Rust you can easier just compile some object files and link them into your application.

Re: Tor in a safer language: Network team update from Amsterdam

#9
post #5

I don't know much about Tor. But I hope I can route all of my home network traffic through it. That or route everything through VPN. I'll bet you can guess why I'm suddenly interested.

you can, but it's not really nice, because TOR is relatively slow, it only makes sense for heavily text based sites and not images/video etc.

Re: Tor in a safer language: Network team update from Amsterdam

#10

I am curious why they were advised not to use Go. Probably not a safety concern. Edit: cgo != Go. Thanks for the responses. I have done a bit of Go, but just pure Go.

They were not advised against Go but against cgo. Part of what they want is incremental conversion and cgo is at the same time not-go[0], costly[1] and complex[2], and then you still need to manage the Go runtime (GC & al) from within your C system. That makes integrating the two difficult, especially when you want to replace the existing system piecemeal.

A pure-Go rewrite might be an option (in fact Tor seems pretty firmly in Go's use cases), but that's not what the Tor team is trying to do.

[0] https://dave.cheney.net/2016/01/18/cgo-is-not-go

[1] a cgo->c call is ~100 times more expensive than a go->go call, and ~400 times more expensive than a c->c or rust->c call https://www.reddit.com/r/golang/comments/3oztwi/from_python_...

[2] https://www.cockroachlabs.com/blog/the-cost-and-complexity-o...

Post reply on HN