←back to thread

348 points giuliomagnifico | 1 comments | | HN request time: 0.232s | source
Show context
anthk ◴[] No.46243905[source]
Why not Go? It's more portable.
replies(7): >>46243939 #>>46243943 #>>46243983 #>>46244203 #>>46244559 #>>46262087 #>>46262252 #
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 #
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 #
lynndotpy ◴[] No.46246654[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 #
1. johncolanduoni ◴[] No.46251536[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.