262 points · by lagniappe · 2y ago · 101 comments
I experimented a few weeks ago with packaging a custom kernel and minimal Go init binary into a disk image bootable on GCE. No bootloader needed, just EFI loading the kernel directly.
For a low-powered device, would a Go usespace bring particular benefits? (Though, even the cheapest phones today aren't really "low-powered" anymore)
Edit: In order to preempt the argument others are having: Safer than C, anyways, while being much easier than rust.
https://www.withsecure.com/en/solutions/innovative-security-...
Look for TamaGo on the page.
It's basically the opposite of containers, which I like hehe.
https://github.com/cloudius-systems/osv
https://ops.city/ (also nanovms) - this is one that I actually got working to at least demo state
Or TinyGo, https://tinygo.org/docs/reference/microcontrollers/
How does Go fare on single core machines like older RPi0 models?
I love that they basically reimplemented libc to get more performance, but they also threw away decades of edge cases that it doesn't (yet) handle very well. I'm confident they'll get there, eventually, especially when people do things like this and report issues.
It works great! No memory pressure/GC issues at all. Its really not that hard to write go that can perform well in moderately constrained environments.
It’s entirely possible to run a server that will handle tens of thousands of req/sec on hardware with comparatively small amounts (by todays standards) of RAM e.g. 512MB
Go does not need me much memory, it's in the same ballpark as a C++ server, using way way less memory than Java / C#.
However, I don't like to have a Go compiler on the production machine for security reasons, as well as to reduce even more the system base.
I think instead that the compiler should be needed only to deploy binaries and should stay on the syadmin's machine. The Go toolchain is very good at cross-compiling, so there should not be a need for the compiler on the target machine.
gokrazy images are built whereever you like (typically your PC, or some more automated setup) and then deployed to the target device. There is no Go toolchain on the target device.