Back to blog

Moving forward with golang

2014-01-18 - Posted in Uncategorized Posted by:

by Rinat Abdullin
After a couple of iterations we settled for the go language as the primary language for rewrite of happy pancake from C#. Ideally we’ll converge on Haskell later (that’s something I would really like, due to the powerful type system and high suitability for capturing domain models). However, for the time being the primary language will be go. Reasons for that being:
  • Simplicity of the language and similarity to C#
  • Excellent ecosystem for the development of backend servers
  • Availability of go drivers for FoundationDB
  • Linux development stack (Ubuntu + Sublime/Vim) without large license fees
  • Language is expressive enough for our needs
  • Excellent resources and help tools
Why FoundationDB is so important to us – would be another blog post later (long-story short: it is like fast Redis with proper clustering support and only one data structure – sorted key-value ranges). There are a few downsides of golang that we are going to live with:
  • Concept of workspaces is somewhat messed up (imagine, that you have to work with two versions of a library). However, this is not nearly as bad as dll and nuget hell in .NET world
  • Absence of generics or type inference that would work as such
Getting started with golang was rather simple. We went with Tomas through: All of these resources are an easy read (mostly attributed to the simplicity of the language itself). While doing that I setup an Ubuntu (LTS) with Sublime Text 2 and GoSublime package. Given all that, it was relatively easy to start porting layer code for FoundationDB from python to golang. Screenshot 2014 01 18 12 13 48
I’m still running my dev environment as VM on my MacBookAir, although Ubuntu can live fine with 1GB of RAM, unlike Windows VM that had to ask for 2GB. Plus, since Parallels does not work well with Linux VMs, VMWare Fusion is used.
While working on layer code, I had also to encounter Python along with its REPL. Syntax was a bit odd in the beginning, but quite simple in the long run. No tutorials even needed. Screenshot 2014 01 18 12 10 43 For the next week I plan to finish porting queue and pub/sub layers for FoundationDB from python to golang. We’ll see how it goes from there.

2 Comments

Ahmed 5 years ago

Hi Rinat, i have some questions hopefully i will have your feedback, why you choose Go instead of other language that offer similar functionality like Scala and that have more community support (the advantage above c# was little bit clear but why going with Go not other alternatives ?) also why you chose Sublime instead of Webstorm that also offer Go plugin and costs less for the license ? any reasons ?

Reply

Rinat Abdullin 5 years ago

Hi Ahmed,

re golang ā€“ it is extremely simple, runs well on Linux, has great performance and amazing ecosystem which fits our needs. It is not as overloaded with legacy as Java is. Avoiding Java is a big win for us. Golang community is amazing. Also, FoundationDB has golang drivers šŸ™‚

Re sublime ā€“ it is extremely light-weight and is easy to extend. Iā€™m personally alternating between vim and sublime šŸ™‚ Price was not an issue.

Best regards,
Rinat

PS: used comments from Tomas to reply your question šŸ™‚

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *