Go is not a general-purpose language. It's a Google language designed to solve Google's problems. If you aren't Google, you probably have different problems, which Go isn't intended to solve. EDIT: Currently at -4 downvotes. Would downvoters care to discuss their votes?
Why Discord is switching from Go to Rust
201–210 of 670 posts
Re: Why Discord is switching from Go to Rust
#202It's always good to see a case-study/anecdote, but nothing in here is surprising. It also doesn't really invalidate Go in any way. Rust is faster than Go. People use Go, like any other technology, when the tradeoffs between developer iteration/throughput/latency/etc. make sense. When those cease to make sense, a hot path gets converted down to something more efficient. This is the natural way of things.
Re: Why Discord is switching from Go to Rust
#203Earlier quoted context omitted.
Why do you think it is? Go has a really great gc which mostly runs in parallel to your program with gc stops only in the doman of less than milliseconds. Discord ran into a corner case where they did not create enough garbage to trigger gc cycles, but had a performance impact due to scheduled gc cycles for returning memory to the OS (which they wouldn't need to do either).
Because many services eventually become performance bottlenecked either via accumulation of users or accumulation of features. In either case eventually performance becomes very critical.
Re: Why Discord is switching from Go to Rust
#204Write their code in a functional style. Get the benefits of the Erlang BEAM platform.
Their system runs over the web, so time sensitivity isn’t as important, in comparison to video games, VR, or AR.
Anyone ever done a performance comparison breakdown between something like Elixir vs. Rust?
Re: Why Discord is switching from Go to Rust
#205Re: Why Discord is switching from Go to Rust
#206Earlier quoted context omitted.
You are able to disable GC with: GOGC=off As someone mentions below. More details here: https://golang.org/pkg/runtime/
How does Go allow you to manage memory manually? Malloc/free or something more sophisticated?
Re: Why Discord is switching from Go to Rust
#207Would it have been better if they went with Elixir? Write their code in a functional style. Get the benefits of the Erlang BEAM platform. Their system runs over the web, so time sensitivity isn’t as important, in comparison to video games, VR, or AR. Anyone ever done a performance comparison breakdown between something like Elixir vs. Rust?
Re: Why Discord is switching from Go to Rust
#208Earlier quoted context omitted.
This is in line with Go's philosophy, they try to keep the language as simple as possible. Sometimes it means an easy thing in most other languages is difficult or tiresome to do in Go. Sometimes it means hard-coded values/decisions you can't change (only tabs anyone?). But overall this makes for a language that's very easy to learn, where code from project to project and team to team is very similar and quick to und…
"Simple" when used in programming, doesn't mean anything. So let's be clear here: what we mean is that compilation occurs in a single pass and the artifact of compilation is a single binary. These are two things that make a lot of sense at Google if you read why they were done. But unless you're working at Google, I struggle to guess why you would care about either of these things. The first requires sacrificing anyt…
I like Go and I consider it a simple language because:
1. I can keep most of the language in my head and I don't hit productivity pauses where I have to look something up.
2. There is usually only one way to do things and I don't have to spend time deciding on the right way.
For me, these qualities make programming very enjoyable.
Re: Why Discord is switching from Go to Rust
#209When I see this kind of GC performance, I wonder why you wouldn't change the implementation to use some sort of pool allocator. I am guessing each Read State object is identical to one another (e.g. some kind of struct) so why not pre-allocate your memory budget of objects and just keep an unused list outside of your HasMap? In a way this is even closer to a ring where upon ejection you could write the object to disk…
I realize you're not advocating pervasive use of the technique, but if someone reading this is going to make pervasive use of manually managed object pools in a GC'd language, they should at least consider the possibility of moving to a language with both good language support for manually managed memory and a good ecosystem of tooling around manual memory management.
Manually managed object pools in a language designed around GC don't fully get rid of the costs of GC, and re-expose the program to most of the errors (primarily use-after-free, double-free, and leaks related to poorly reasoned ownership) that motivated so much effort in developing garbage collectors in the first place.
Re: Why Discord is switching from Go to Rust
#210Earlier quoted context omitted.
Why would you want to bring up the Actix author's drama? That doesn't seem like something that should reflect on a language one way or the other.
As an outsider to both the Go and Rust cultures, I read the Actix news and walked away with the impression that the Rust ecosystem is less mature.
That collaboration thing is why Actix exploded I think. While mostly an isolated incident it does show some clash between the author's values (and possibly the author's employer's (MSFT) values) and the values of the general Rust community. I would not say that reflects on the maturity of the langues or ecosystem.
In Go a lot of stuff is Google dictated. In Rust it's a true open governance innovation project (looking to become a non-profit). Since the Go is a very specific language --made for networked apps and only has one way to do concurrency-- and Rust very broad --a true general purpose prog lang-- it is easy to see how Go mature so quickly (not much to mature) and also why it got a bit old so quickly as well (ignores most innovations in computer science of the last decades).