My understanding is that for crypto specifically it constant-time algorithms matter due to security implications, and those are only available when you use specific branchless assembly instructions, so it's not just performance
nu11ptr · 55m ago
That is my understanding. It lets you bypass CGo overhead, but I'd be lying if I said I fully understood it.
cyberax · 16m ago
Remember that Go actually compiles the code to machine code directly, so it needs to have an assembler for its compiler. And if you have it, then why not make it available?
pjmlp · 54m ago
Not really, having an Assembler around has been quite common in compiled languages, before the rise of scripting languages in the 2000's.
For all my complaints about Go's design, that is certainly one that I appreciate.
https://go.dev/wiki/AssemblyPolicy
https://github.com/golang/go/tree/master/src/crypto/internal...
For all my complaints about Go's design, that is certainly one that I appreciate.