Hacker News new | ask | show | jobs
by mountainriver 1566 days ago
Eh a lot of people have, the issue is with Go’s memory model and how that maps to the C memory model. It requires what they call “trampolining” which caused a performance hit.

Interestingly, Rust originally used a similar memory model to Go, but then when they hit this problem decided to take another route.

This has the unfortunate side effect of making most machine learning also not practical in Go.

1 comments

On the other hand, it has had the fortunate side effect of minimizing the amount of code which depends on C, which makes building and packaging software (including cross compilation) super simple.

That said, I'd like to know more about the limitations regarding machine learning. Presumably most machine learning stuff isn't implemented in C?

The ML limitations are that all the low level vector and acceleration libraries are written in C or C++. The GPU libraries are the real kicker, there isn't any great way around this except to trampoline over to C, that trampolining takes time which chews into your acceleration. Ironically Python is much faster than Go for ML because of this.
PyTorch and TensorFlow are both primarily C++ codebases.