Widely regarded as the language of the web, Ruby’s always been pretty damn hawt. But now it’s about to get even hotter. AltRubies have been pushing Ruby into realms we never thought possible. Is Ruby set to become the preferred language of the browser? Of mobile apps? Of hardware, even? Let’s take a look at some of these alternative Rubies and the exciting things they bring with them…
Ruby in the browser, thanks to Opal.
One of the biggest shifts I’ve seen in the last year or so is towards dynamic front ends – spearheaded by JS frameworks such as Angular and Ember. As nice as these might be, there’s one thing you just can’t escape when using them – Javascript! As a Rubyist, I am sure you’ll agree that JS (or even CS) doesn’t quite cut the mustard. It simply doesn’t possess the panache – that special something – that many of us feel Ruby does.
Opal lets you write Ruby that compiles to Javascript. Yep – this means you can now write Ruby that runs in the browser! Opal also has a number of gems that extend it, such as Opal-jQuery and Opal-Vienna (the latter being a front end, Backbone-style library). But this is just the beginning.
Opal is now paving the way for new Ruby frameworks that run on the front end, or even the front and back end, and I’m hearing a lot of buzz around how Opal is one of the hottest things in Ruby right now and is set to play a big part in its future. I agree, and we’re only just starting to see why…
Ruby on the back AND front end! Thanks to Volt!
Volt is an exciting new Ruby framework that runs on the front and back end, and even has plans to integrate with RubyMotion further down the line.
Volt is a reactive framework, meaning it creates a persistent connection between the client (the user’s browser) and the server, and when data is updated in one client, it propagates – if you want it to – to all other listening clients (with the option to update your database in the process). Welcome to the world of real time apps (RTAs).
When Volt did the rounds in the Ruby media recently, unsurprisingly it generated a heap of interest – before it was remotely ready for prime time! This, however, has turned into a blessing by allowing early feedback on many of its features – something the Volt team have been listening and reacting to. One such feature is adding a user and auth system into the core framework – a stellar move in my view.
I really like how Volt embraces cutting edge web technologies and methodologies: declarative HTML, web components, websockets and of course Ruby on the client side. They’re also adding RethinkDB support – a new database that is also rumoured to become big in Ruby.
Of course Volt isn’t just for RTAs, but I’m sure we’ll all be thinking of creative ways to add a little real-time sparkle to our sites! I’m excited to see what everyone is going to do with it. Oh, and if you’re worried about the initial lag often associated with sites running front end JS frameworks, don’t – Volt is concurrent, meaning it’ll render the first page a user hits on the server, making it lightning fast.
Ruby on your iOS, OS X and Android devices – thanks to RubyMotion.
If you are a Rubyist then you are probably already familiar with RubyMotion, so I won’t go into the details here – but if you’re facing the same RubyMotion vs Swift dilemma that I was, here’s why I’ll be learning RubyMotion:
- RubyMotion lets you create native iOS apps – so the code you end up with is just as optimal as the code had you used Objective C.
- RubyMotion lets you create OS X programs as well.
- RubyMotion now allows you to do the same with Android apps. This, I think, is killer, because it’s something you can’t do with RubyMotion’s most compelling alternative, Swift.
There are lots of other reasons too, but the main reason for me is our old friend Ruby. While you still need to learn the associated frameworks, Ruby is there for the rest of it… allowing you to write mobile apps in the language you know and love. And if you do ever decide to move to Swift, none of the time spent learning the Apple frameworks is wasted, because you take that knowledge with you.
Ruby in embedded systems, thanks to mruby.
This it Matz’s own little baby. Little being the operative word! It’s tiny, and that’s the whole point – to make it lightweight enough to use in embedded systems (hardware). Thanks to its C99 compliance it is extremely portable, yet manages full compatibility with Ruby 1.9.
Matz thinks it will create the same sort of buzz in embedded systems, as Ruby (and Rails) did for the web. I reckon he might be right.
Rails is ten years old!
I can’t not mention Rails in a post about Ruby being cool. Rails is the killer app that got Ruby off to such a great start, arguably, making it so cool to begin with. In fact it’s probably true to say that Rails was the original ‘Cool kid’ on the programming block.
With Rails 5 on the horizon, it will be interesting to see where DHH and the core team take it. I personally hope they ditch Coffeescript in favour of Opal, otherwise they might find Volt steals some of their thunder. But what do I know – perhaps they have something else up their sleeve. (As we saw with Turbolinks, they often do!)
Maybe, just maybe, they will set Rails on Fire…
Let’s turn up the heat.
So as we’ve seen from the above, Ruby’s about to get piping hot. But there’s one more thing to share with you. Ruby Fire.
Although Fire is currently in conceptual stage, it’s definitely something worth getting excited about – a front end framework allowing you to create your frontends in Ruby easily. It’s being brought to you by the same team behind Opal (and Vienna – the Backbone style front end library) so they know a thing or two about Ruby on the client-side. It’s being designed for use with your favourite framework on the back end, making it perfect for bringing our current apps slap bang up-to-date without having to abandon so much of our existing code.
The team behind Fire say they plan to include quite a bit of ActiveSupport, making it a perfect fit for Rails. I’d actually love to see Rails officially adopt Fire – a match, quite possibly, made in heaven. I reckon this move would single-handedly catapult Rails back to where it belongs – at the cutting edge.
Fire will be focused on the very latest best practices in front end development, selecting the best methodologies currently out there, and Rubyfying them. The current client-side frameworks better watch this space!
In short, Fire is Ruby’s answer to Angular and Ember – so if you’ve been yearning for a front end Ruby framework, then Fire might well be just what the doctor ordered. I genuinely believe that it, along with Volt, really will help Ruby set the wwworld alight again.
This is only the beginning.
This is an exciting time for Ruby. Thanks to the power of AltRubies, you can now do in Ruby what you would otherwise have had to do in languages that you may not have been very fond of (that’s me putting it politely :p).
While RubyMotion and mruby are courageously (and actually, quite effectively) taking on big new adversaries, I think both Fire and Volt are going to be pivotal in Ruby’s continued success as the language of the web. And guess what? You can be a part of it.
Join the discussion in the respective Gitter channels or use the hashtags #RubyFire and #Voltrb on Twitter …you really can help shape, and secure, the future of Ruby on the modern web – this time, from the very beginning.
Want to see more posts on Volt and Fire? Let me know in the comments below or tweet me!