Go is a great scripting language
Last Update: 2025-05-11
TLDR: Go is a great scripting langauge if you require more than a shell language.
I recently had to write a Dockerfile generator for caching automatic testing runs and incrementally caching the build without an actual incremental build in CICD.
Previously this generator was written in bash and powershell.
Required features for the choosen language were:
- easy xml/general file parsing without external packages
- not slow
- fast startup
- can be easily run with minimal effort
The following languages/runtimes were in the running for this task:
- Deno (TypeScript/JavaScript runtime)
- Go
- Lua
- Nushell
- Python
Deno, Lua and Python require external packages for parsing xml files. Deno would be easier, because external dependencies can simply be imported with just an URL. Nushell has problems parsing certain xml files. Go on the other hand has xml parsing builtin.
Go is also simple to run with go run main.go
, doesn't require auxillary files (like packages.json
with npm), but can also be compiled and cached. Also, Go is trivally multi-threaded, which is a big problem in many interpreted languages.