Most active commenters
  • anthk(4)
  • yjftsjthsd-h(4)
  • hu3(3)
  • lynndotpy(3)
  • pezezin(3)

←back to thread

348 points giuliomagnifico | 38 comments | | HN request time: 0.303s | source | bottom
1. anthk ◴[] No.46243905[source]
Why not Go? It's more portable.
replies(7): >>46243939 #>>46243943 #>>46243983 #>>46244203 #>>46244559 #>>46262087 #>>46262252 #
2. hu3 ◴[] No.46243939[source]
and easier to learn.

and better funded.

and easier to find devs.

replies(3): >>46244004 #>>46244128 #>>46245136 #
3. preisschild ◴[] No.46243943[source]
What do you mean? Rust supports far more platforms.

Also Rust has a lot more inherent safety features than go.

(I think Go is great and its my primary language)

replies(2): >>46243976 #>>46248385 #
4. superkuh ◴[] No.46243976[source]
In terms of compilation of programs Go is far, far easier than Rust. For Rust to compile a random Rust program on the internet one almost always has to have the absolutely latest out of repo compiler toolchain from curl rustup.whatever | sh. The normal 4 year release cycle is incompatible with rust development. For commercial use cases this doesn't matter. But for open source like the tor project it does.

That said, since they use Firefox this bridge has already been burned.

replies(1): >>46244012 #
5. lynndotpy ◴[] No.46243983[source]
Don't Rust and Go build to mostly-statically-compiled binaries? (With the exception of a link to libc.) (This isn't a rhetorical question, this is something I don't know a lot about

I'd imagine the biggest cultural reason is that many Rust developers were C developers who had a reason to find something better, but still scoff at garbage collection, large runtimes, etc. They probably have a lot more Rust expertise in their circle.

Another technical reason is that they were trying to replace their C code with Rust in bits and pieces before they went with a full rewrite. I don't know about Go, but this is something ergonomically doable in Rust.

replies(2): >>46244359 #>>46244948 #
6. ramon156 ◴[] No.46244004[source]
They both suck getting new devs for

Also, just because it's part of Google doesn't make go better funded. Theyd probably be fine killing go.

Definitely easier to learn though :P

replies(2): >>46244323 #>>46244506 #
7. norman784 ◴[] No.46244012{3}[source]
AFAIK if the project has a rust-toolchain.toml[0] file, cargo will download the correct compiler for the project.

[0] https://rust-lang.github.io/rustup/overrides.html#the-toolch...

8. agumonkey ◴[] No.46244128[source]
i have no dog in the fight, but based on tor release schedule it seems to me that the team is very very talented and rust complexity is not a challenge for them
9. pezezin ◴[] No.46244203[source]
Portable to what? Rust works fine on all of today's popular platforms.

I see people complaining about Rust's lack of portability, and it is always some obsolete platform that has been dead for 20 years. Let's be serious, nobody is gonna run Tor on an old SGI workstation or Itanium server.

replies(4): >>46244882 #>>46245302 #>>46247927 #>>46248342 #
10. FieryMechanic ◴[] No.46244323{3}[source]
Go been around for quite a while now. It isn't going anywhere.
replies(1): >>46244897 #
11. atq2119 ◴[] No.46244359[source]
Plus, Rust has a more expressive type system.

I like loose type systems for some quick scripting, but I started to adopt Rust for many of my personal projects because I find it's so much easier to get back into a project after a year when there are good type system guard rails.

12. hu3 ◴[] No.46244506{3}[source]
> They both suck getting new devs for

I'm willing to be Rust suck a ton more to hire devs. Since, as we both agree, Go is easy to learn. Any C#, PHP or Java dev can get going with Go in not time.

13. ◴[] No.46244559[source]
14. vablings ◴[] No.46244882[source]
It is still possible to build for targets such as Itanium. There is nothing stopping you from writing your own targets too in LLVM and its not obscenely difficult

https://github.com/llvm/llvm-project/tree/main/llvm/lib/Targ...

15. vablings ◴[] No.46244897{4}[source]
Rust has been around for over 10 years now. In the last five years the language hasn't changed much and has gotten better and better
replies(1): >>46248774 #
16. johncolanduoni ◴[] No.46244948[source]
Rust can create statically-compiled binaries on Linux by using musl instead of glibc, but it’s not the default like it is in Go and is as a result not quite as effortless. There are a lot of crates with native dependencies that require slight environment tweaks to work on a musl build. Go on the other hand goes to great lengths to not need to link to any C code at all, to the point of shipping its own default TLS library and cryptographic primitives.
replies(1): >>46246654 #
17. tjpnz ◴[] No.46245136[source]
Rust is going to feel more familiar to Tor contributors than Go. Based on the list of platinum members (which includes Google and Tor btw) there's some serious money going into the Rust Foundation, assuming it's managed properly I can't see funding as an issue.

https://rustfoundation.org/members/

replies(1): >>46245418 #
18. edm0nd ◴[] No.46245302[source]
>Let's be serious, nobody is gonna run Tor on an old SGI workstation or Itanium server.

dont temp me with a good time and awesome weekend project!

19. hu3 ◴[] No.46245418{3}[source]
I don't see any transparency with the funds. So it's hard to grasp how much is it.

But it's never going to surpass Go which is owned by a 4 trillion dollar conglomerate.

replies(1): >>46262029 #
20. lynndotpy ◴[] No.46246654{3}[source]
I thought the default for both Rust and Go were to statically compile everything except the dynamic link to libc? And that you could optionally statically include musl with a bit of extra work.

I've never had to do anything unusual with building, but I thought the "almost-ststically-compiled" thing was somewhere Go and Rust were almost identical.

replies(2): >>46246873 #>>46251536 #
21. steveklabnik ◴[] No.46246873{4}[source]
You and your parent are talking about slightly different things. You are both correct in different ways.

Your parent is saying that, while what you say is true for Rust and Go code themselves, in practice, it is less true for Rust, because Rust code tends to call into C code more than Go code does, and Rust doesn't always statically link to that C code by default.

replies(1): >>46247616 #
22. lynndotpy ◴[] No.46247616{5}[source]
Oh that makes more sense! That's a bit of a blindspot to me for the pretty bog-standards ways I'd been using Rust and Go.
23. yjftsjthsd-h ◴[] No.46247927[source]
That's a good point, really there's no reason to waste time on anything but popular platforms. Obviously, of course, this means dropping support for everything except Windows (x64 and maybe ARM) and macOS (ARM). (\s)

In all seriousness, I guess you can make this argument if you only care about Windows/macOS, but the moment you run anything else I have to ask why, say, Linux deserves support but not other less-common platforms.

replies(2): >>46250193 #>>46250348 #
24. anthk ◴[] No.46248342[source]
Not under OpenBSD i686.

Also, the more heterogeneous it's a CPU architecture support, the least exploitable a service will be.

replies(2): >>46248765 #>>46250174 #
25. anthk ◴[] No.46248385[source]
No Rust under OpenBSD i686. Rust on PowerMacs? Alpha?
26. krior ◴[] No.46248765{3}[source]
Please elaborate on your last point.
27. FieryMechanic ◴[] No.46248774{5}[source]
I didn't like Rust one bit and gave up learning it. Go on the other hand is quite nice.
28. pezezin ◴[] No.46250174{3}[source]
See? This is exactly my point. The last 32-bit only Intel CPUs were the original Intel Core series. Core 2 was already 64-bit, and it was released in 2006.

i686 should have died a long, long time ago.

replies(1): >>46261202 #
29. pezezin ◴[] No.46250193{3}[source]
Because:

1) Development resources are finite.

2) Linux runs all of the world supercomputers, most of the internet infrastructure (server, routers, etc), most of the cellphones (Android), and lots of other things. Its global marketshare is way bigger than macOS and all the BSD put together.

replies(2): >>46252912 #>>46261181 #
30. filleduchaos ◴[] No.46250348{3}[source]
Linux is not an ISA
replies(1): >>46261186 #
31. johncolanduoni ◴[] No.46251536{4}[source]
Golang doesn't dynamically link to libc by default on Linux either - it calls the Linux kernel ABI directly (since that ABI is stable). The main upshot of this is that you don't have to worry about the classic glibc version bingo by default, while with Rust you have to go through some extra steps to avoid that.
32. anthk ◴[] No.46252912{4}[source]
Try living without OpenSSH and the rest of *BSD contributions.
33. yjftsjthsd-h ◴[] No.46261181{4}[source]
To remain clear: This is largely devil's advocate. I believe that niche platforms generally should be supported, and that includes GNU/Linux on amd64, and NetBSD on literal VAX (yes, that is an officially supported platform in current NetBSD), and RedoxOS on ARM, and OpenBSD on MIPS, and [...]. I just think it's really weird to claim that GNU/Linux, with 3% of the desktop market, should be supported, but a platform that is similarly a small fraction of Linux is dead weight that should be dropped.

With that said, remainder of this comment continues with the position that GNU/Linux, which I am writing this comment on, is obviously not worth supporting for the same reasons as i.e. MIPS and RISC-V.

> 1) Development resources are finite.

That is an argument in favor of cutting niche platforms like GNU/Linux.

> 2) Linux runs all of the world supercomputers,

You can't defend a niche OS by pointing out that it's used in a tiny niche market. How many supercomputers exist on earth? I'd bet you there are more working MIPS installations than supercomputers.

> most of the internet infrastructure (server, routers, etc),

I'll grant you headless machines used by IT folks, but that's still a specific subset of the market and it has little bearing on whether, say, Tor should support it as a desktop OS.

> most of the cellphones (Android),

Android/Linux is quite different from GNU/Linux; effectively nobody developing for Android is targeting Linux in any meaningful sense.

> and lots of other things. Its global marketshare is way bigger than macOS and all the BSD put together.

Only if we include embedded systems and servers. If you intend to target servers, then yes obviously Linux matters. Otherwise, not so much.

34. yjftsjthsd-h ◴[] No.46261186{4}[source]
So? They're both part of the platform software has to target.
35. yjftsjthsd-h ◴[] No.46261202{4}[source]
No, the last 32-bit-only Intel CPUs were Atom models in ... I think we decided 2011 last time this came up.
36. anarki8 ◴[] No.46262029{4}[source]
https://killedbygoogle.com/
37. anarki8 ◴[] No.46262087[source]
Probably because:

- better data race handling;

- no garbage collection, more predictable performance;

- stricter type system that can enforce constraints better;

- closer to metal and better FFI support.

Which seems to matter more for Tor project than support for some barely used platform.

38. timeon ◴[] No.46262252[source]
This is legit question, especially for Tor binaries.

Advantage of Rust (or original C implementation) is for users that do not have runtime and want to import Tor libraries (like arti-client) in their code. Go could work but those unmanaged languages are better here. So in the end Rust (or C, C++ etc.) can serve more user-cases.