Go Language for Embedded ARM Linux Systems

In the quest for technologies that work well for embedded Linux systems, I recently gave Go another try. The last time I tried this was very early on and there were some floating point issues on ARM that appear to be fixed now. Having spent a few days porting an existing application to Go, there is a lot to like about Go.

Compiles very fast

Nice set of default libraries that are nice to use

Binaries are reasonable size

Memory usage is reasonable

Very simple to deploy (run time and libs are bundled with a single executable)

many 3rd party libraries available

Tooling is good (build, unit testing, etc)

As an example of running a Go app on an embedded Linux system, enter the following in hello.go:

I did notice the time to build for ARM is a bit longer than building for x86:

$ time go build hello.go
real 0m0.262s
user 0m0.337s
sys 0m0.030s

$ time GOARCH=arm GOARM=5 go build hello.go

real 0m2.533s
user 0m4.930s
sys 0m0.183s

But, still pretty reasonable considering what all it is doing. The simplicity of all this is very attractive. There is no runtime to cross compile and deploy. Just one executable and you’re good to Go.