Richard Bucker

Golang vs Rust

Posted at — Jan 18, 2020

Both Golang and Rust originated from a good place and for good reason. It has long been suggested that large corporations need to control their own destiny from a projects tools to it’s implementation. Many not so large corporations fill in the gap with DSLs or simple scripting.

Recently I read a post which compared Golang and Rust and it was a mess. Some of the points were valid. Some were a comparison of apples and elephants. And while they compared some common and reasonable topics there were some serious omissions.

The fact the Mozilla was able to create a complete and speedy browser with Rust and that Redox was able implement a unix-like OS in Rust is also interesting but requires a better undertanding of what that really means in detail.

In recent days I have been diving deep into all things security in docker, linux, MS Win, OpenBSD, Qubes and so on. The reality is that nothing is safe. Just as easily as I can argue for bare metal I can find qualities in chroot, containers or VMs. Same for networking, crypto and so on. Then there are microservices and monolithic apps. And remote vs local security challenges.

The thing is… Rust is supposed to be safe by default. However, as professional programmers we code with a purpose. Sometimes we take risks and other times we count every byte. I get twisted when these core responsibilities are deferred to a higher power or some intern. While golang is not ‘c’ in that respect I am considerably more productive allowing me to solve other challenges but it’s not too far that I do not understand the challenges.

I think the biggest weakness for golang is the packages. Not the included libs but all the 3rd party libs. In fact I try to stay away from as many as I can. Whatever is not available in the base I try to implement myself. If it’ll take too long or some specialized knowledge that I’ll import it. I’m reminded of that javascript ReadLine issue a few years ago.

In conclusion…. define a DSL. Implement that DSL in whatever language you want. And solve harder problems.