The Go vs Rust in GIS

Posted on Dec 21, 2023

As a geospatially-minded professional, I couldn’t help but notice a gap in the ongoing debate between Go and Rust: what about GIS? So, let me share some brief reflections on developing geospatial applications in Go and Rust.

Go

Go is very easy to pick up, especially for those versed in C or C++. Python users may take a bit longer to grasp concepts like pointers, but Go’s overall simplicity facilitates easy team adoption. In the GIS domain, the standout choice is orb by Paul Mach (documentation), offering comprehensive geospatial primitives and robust support for OSM operations, including tile utilities. Notably, Protomaps uses it in their CLI tool go-pmtiles for mbtiles to pmtiles conversion.

Rust

Initially hesitant due to the ‘steep learning curve’ and ‘constant compiler fights,’ I recently experimented with Rust. Despite some struggles, I developed and published v0.1.1 of osm-waters. While a work in progress, creating a simple - yet powerful - CLI tool within weeks of using Rust speaks volumes. Yes, the compiler can be ‘complainy,’ but I became very productive after a few attempts. In GIS, Rust pleasantly surprised me with its rich ‘geo’ packages. For instance, the GeoRust contains many powerful GIS packages. Notably, the geo package (link) includes geospatial primitives and other useful utilities. To underscore how powerful the GeoRust ecosystem is, the well-regarded Martin tile server by MapLibre uses many of those libraries under the hood.

My hot take

To begin, both Go and Rust offer fantastic coding experiences with substantial performance gains over languages like Python or JavaScript. While there are various aspects like memory safety, error handling or concurrency, I’ll strictly focus the ‘GIS’.

While Go may lag behind Rust in raw performance, it excels in simplicity, enabling swift adoption and quick developer onboarding. Rust, on the other hand, boasts incredible performance but demands a steeper learning curve.

The decisive factor for me is the GIS ecosystem. While Go has mature libraries, Rust’s GIS wealth of packages outshines it. In reality, Go has only one decent library (with some lingering old PRs). In contrast, Rust’s ecosystem for GIS is outstanding. So here’s my hot take: if you need something quick and simple, Go is the clear winner. But if you need a very custom application that needs to be highly performant, undoubtedly use Rust.

Enjoy!