Lately I have been looking for some solid alternatives to Ruby, and I must admit up-front - Rails spoiled me, badly.

I was hungry for some performance boosts, and let’s face it - dynamically typed languages can get you until some point.

I played with few popular modern languages (manually dealing with memory management? No thank you sir) and tried to hook them into Rails application.

Crystal

So first, Crystal - it felt great (look at me, I’m writing compiled Ruby that is magnitude faster!), but the language itself is so immature at this point that basically each release breaks something (in a major way). There are some external libraries in active development, you can find some basic tools for postgres, redis, http lib etc. I really like shards - dependency manager, so you can plug in some goodies into your project - after all, it’s all about ecosystem of the language.

Overall I really like it, I hope the crystal team will manage to ship some stable version this year (the most recent news was kinda a turn off), but I would rather wait a little but more. So I ended my journey with Crystal pretty quick.

Rust

Started by Mozilla in around 2010. API at this point seems quite stable, and the language itself feels pretty great, mostly because zero-cost abstractions. I recommend this awesome full stack fest talk about writing Ruby extensions in Rust where Yehuda Katz goes into some details about language specifics. Rust have great official documentation, and pretty sweet dependency manager called cargo - something like Rubygems / npmjs, but for Rust.

I tried to write some more meaningful that Hello world web app in Rust, and at this point it felt a little bit awkward. I think mostly because tools are still in the works (check out are we web yet webpage). But the development activity in rust community is so active I wouldn’t be surprised that we will be web in next few months.

Go

Accounted in 2009 by Google, pretty damn stable as major version is released like twice a year. Pretty awkward dependency management (you have to choose something from this list yourself), very verbose error checking might seem like a big turn-off at first, but after giving it some time I kinda liked it.

Starting from zero you can relatively quickly build some tiny app that spits out JSON that can be consumed by your Rails app. If you have to crunch and aggregate some bigger amounts of data in-memory even badly written go code should run much faster than your carefully profiled ruby code (well, GC is sooo costly in Ruby) - even considering network latency between two applications.

I took some extra time to do some proof of concept in Go and extracted part of the Rails logic into separate go lang app, then just hooked them two together via JSON, here are my thoughts:

Next step: some sane production deployment pipeline (docker maybe?) and real-world benchmarks.