Roots Discourse

Curious... Go? (roots-cli)

I saw that the Roots CLI looks like it will be written in Go. Just curious if there was a reason to not use JS or some other language already in the Trellis stack to make it easier for people to contribute? I am in no way criticizing… if the answer is because someone wants to learn/write Go for fun, I totally understand. I am legitimately interested… is it easier to write a CLI in Go for some reason? Better libraries? Concurrency help in some way?

Looking forward to it!

There’s really only one main reason we’re using Go: it produces standalone binaries. So you don’t need another language installed + its package manager to use it.

Ahhh, got it. Thanks!

Like Scott said: standalone binaries are a huge huge benefit. We compile once for Windows, Mac, *Nix and people download the single binary as the entire installation process. No messing with npm versions, explaining how to install Node, etc.

I use Go in production and it has always been a pleasure. I use it especially for building little APIs that you just need to stick on heroku and forget about. I also use it at work for purpose-built little CLI tools to, for instance, go through a jillion transcript files, extract some data, and load it into a database. I have never really had any friction from people who didn’t know the language. Go couldn’t be a more “boring” programming language if it tried, it’s really standard stuff.

Go also has an extremely rich standard library for writing CLI apps right out of the box. And there is lots of “prior art” to draw from by looking at the hashicorp project codebases.


Appreciate the reply, I might have to give it a go. Pun intended.