Is Go fast enough for large computations?
Let's say I basically want to generate a series of random numbers billions of times.
Would Go be a good choice for this? I keep trying to learn Rust, but it's very difficult for me.
Would Go be a good choice for this? I keep trying to learn Rust, but it's very difficult for me.
20 comments
[ 0.18 ms ] story [ 60.9 ms ] thread// It was picked with a dice roll.
That's a bit vague, if you only need pseudo random numbers consider a xorshift based approach, e.g., https://pkg.go.dev/github.com/db47h/rand64/xorshift. Xorshift is fast and simple.
> Would Go be a good choice for this? I keep trying to learn Rust, but it's very difficult for me.
If you need fast but don't want to write Rust or C(++), Go is a good choice for this. It will likely also have a good amount of examples and existing code available for most common problems.
[1] https://github.com/gorgonia/agogo
Original solution was in Python, which is much slower.
What other languages did you consider?
Do you see a positive future for Golang devs?
Rust appears to of picked up a lot of its momentum. I vastly prefer Golang.
There was some early talks about going to Java instead, but Go had too much momentum and folks didn't want AbstractFactoryFactory over-abstraction and craved the more simple Go approach having just experienced the pain of Python Twisted (which was aptly named).
As for the future of Go, all signs point to continued increases in adoption. I think it hits the sweet spot for backend, networked services given the languages I've tried. It is easier to learn than Rust, has a better concurrency story than Python and Perl while out performing them by an order of magnitude, it is easy to navigate unlike Ruby, and is simpler than what standard Java devs push for and uses less memory. And the deployment story is great; just a single executable.
I built a small project in Go and I found it to be a very fun experience.
The syntax is very easy compared to Rust.
Any tips for finding a higher level (200k+) role with Go ?