|\|370.info

Go as the scripting language and Rust as the freaking rabbit hole

I am a C worshiper and as such it's been long due for me to dive into Go and also resume my Rust practice alongside the usual C/C++ tinkering. Furthermore I also like to describe myself as a Bash junkie, such as if some task can be done with a shell script, I will take it that way. The problem with shell scripts though is that they are very tricky to write properly and are essentially incompatible with non-Unix environments. A natural solution to this problem tends to be making use of some scripting language like Python or JS (Node.js). As much as I like this idea, I reckon scripts written in those languages are just so portable as the ability of their users to use them across each different environment.

On the other hand Go is a language that has the syntax and ergonomics of those scripting languages but, once compiled, it is way simpler to port the result across different platforms. Rust programs can evidently also be compiled to different targets as easily as these programs written in Go, however they lack the simplicity that the Go syntax provide, specially in non-trivial situations. To me scripts must be easy to write, easy to use and easy to share. I don't die to see my scripts running as fast C programs or as fast and safe as those written in Rust.

All in all, for long term projects I'm still leaning more towards Rust which to me seems to be the most powerful modern language out there with which you can build pretty much everything you can build with alternatives. Rust has a steep learning curve to master though, just like Bash scripting, and for that reason it seems to me that Go is the best and more adequate tool for fast prototypes, dirty tools and quick experiments. Of course you can build very serious software using Go but to me personally, it really shines for its simplicity and ergonomics which helps me achieve my scripting goals sooner. I can write Go once and run it everywhere and I can do it faster then I could ever do with Rust.

For now all of this is just a hunch. Over the next months I'll be putting this hypothesis to test as it fits really well my short-term goal of using them professionally and not simply for myself. I will continue practicing with both of them and hopefully I can come back here shortly to write more about my experience.

Previous: It turns out I never had to send that message