Seven years of Go
So, i was a Go developer for ~4 years, then for the last 4 months or so i&#x27;ve been learning and using Rust. The pure joy of some things with Rust was astounding.<p>Now, i joined a new job and they&#x27;re in need of a new language for some backend tasks - the choice was mine. Rust or Go? The backend tasks were heavy API servers - nothing amazing, we don&#x27;t do groundbreaking work. Python was their existing language, but they weren&#x27;t too happy with it.<p>For weeks (literally) i mulled it over, i really really really wanted to use Rust. Rust gives me a peace of mind that Go never came close to. Unfortunately, Rust does not fit the development speed nor developer experience[1] that this shop has.. and i really felt Go would be the best choice for this place.<p>My point to this post isn&#x27;t to make a Rust vs Go comparison.. but rather, a wishlist for the hopefully eventual Go 2.0. I have no idea if&#x2F;when that will ever be made.. but i hope it will, and i hope they adopt some things from Rust.<p>1. Channels without panics. Channels are awesome, but Go&#x27;s design of them means that you have to learn special ways to design your <i>usage</i> of channels so that it does not crash your program. This is asinine to me. So much type safety exists in Go, and yet it&#x27;s so easy for a developer to trip over channels and crash their program.<p>2. Proper error handling. I love error checking - i love it in Rust especially. It&#x27;s very explicit, and most importantly, very easy to check the type of things. Recently i was reading an article about Go errors[2] and it made me realize how messy Go errors are. There are many (three in that article) ways to design your error usage, and worst of all your design doesn&#x27;t matter because you have to adapt to the errors returned by others. There is no sane standard in use that accounts for the common needs of error checking.<p>3. Package management. It&#x27;s a common complaint, i know. But Rust &amp; Cargo is so excellently crafted.. Go just got it wrong. Recently i&#x27;ve been using Glide, and while it&#x27;s a great tool, there is only so much it can do. It&#x27;s a tool built to try and put some sanity in a world where there is next to no standardization. We need a Go package manager.. hell, just copy Cargo.<p>4. Enums. My god, Enums. Such a simple feature, but so insanely welcome and useful in Rust.<p>You&#x27;ll note that i didn&#x27;t list Generics. I know that&#x27;s high on peoples list, but not mine. To each their own.. please don&#x27;t start a holy war. <i>(this is likely due to me using Go for ~4 years. I&#x27;m quite comfortable without Generics)</i><p>[1]: By experience, i mean what they desire&#x2F;expect. They&#x27;re a Python shop after all, i didn&#x27;t want to make a choice that would cause them to spend weeks&#x2F;months feeling unproductive.
[2]: <a href="http:&#x2F;&#x2F;dave.cheney.net&#x2F;2016&#x2F;04&#x2F;27&#x2F;dont-just-check-errors-handle-them-gracefully" rel="nofollow">http:&#x2F;&#x2F;dave.cheney.net&#x2F;2016&#x2F;04&#x2F;27&#x2F;dont-just-check-errors-han...</a><p><i>edit</i>: minor text fixes.