Slide deck from my talk at the BulgariaWebSummit 2015.
Volt: Ruby WebDevelopment Rechargedby Bozhidar Batsov
View Slide
@bbatsov
Joan
Few important things youneed to know about me
I’m an Emacs fanatic
I still have nightmares aboutPHP4
I love Ruby
I tolerate Rails
I don’t like JavaScript
Why am I here?
Welcome to Rubylandia!
Ruby (2005)
Ruby (2006)
OMG, Rails is amazing!
Ruby (2008)
OMG, Rails is amazing &useful!
Ruby (today)
Rails is somewhat boring…
Rails is the new JEE!
Aren’t all the cool devsdoing Clojure now?
Hell,yeah!!!
Rails innovation (2005-2008)Convention over configurationInteractive developmentScaffoldingActiveRecordREST
Rails innovation (today)Turbolinksforeign keysbackground jobs
10%90%Rails Other
4%96%Web Development Other
Fuck thisshit!!!
Rails, Rails, Rails
Development Complexity
02550751001999 2000 2001 2002 2003 2004 2005 2006 2007 2009 2011 2015
Web development (2005)ModelViewControllerRoutingServer Client
Web development (2006)ModelViewControllerRoutingServer ClientAJAXRandomJS
Web development (2010)ModelViewControllerRoutingServer ClientAJAXRESTAssetsRandomJS
Web development (2013)ModelViewControllerRoutingServer ClientAJAXRESTModelViewControllerRoutingAssetsAssets
What’s the solution?
VBScript!
Isomorphic Development
Isomorphic?
Isomorphicbeing of identical or similar form, shape, or structure
Same code runs on theclient & the server
Web development (2015)ModelViewControllerRoutingServer ClientAJAXRESTModelViewControllerRoutingAssetsAssetsSharedAuto Sync
Meet Volt
Volt is isomorphic
Models, views, controllers & routing areshared between the client and theserver
WOW!!!
Meteor.js
Ruby on the server-side,Ruby on the client-side
Ruby on the server-side
Ruby on theclient-side
Ruby > JavaScript
Ruby’s advantagesDoes’t have thisSane nil semanticsNo need for a book called “Ruby: The Good Parts”Standard libraryDo you really need more?
Opal.rbhttp://opalrb.org/
Does this shit work?
Yes!
def hello(name)puts "Hello, #{name.capitalize}!"endhello("bruce")
/* Generated by Opal 0.7.0 */(function(Opal) {Opal.dynamic_require_severity = "error";var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice;Opal.add_stubs(['$puts', '$capitalize', '$hello']);Opal.Object.$$proto.$hello = function(name) {var self = this;return self.$puts("Hello, " + (name.$capitalize()) + "!");};return self.$hello("bruce");})(Opal);
Is this shit any good?
Debatable
Opal featuresSource mapsruby-spec compatibilitySmall footprintLittle performance overhead
Ruby compatibilityMostly compatible with Ruby 2.0Implements most of the Ruby stdlibHas immutable strings (unlike Ruby)
Volt Architecture
MVCController ViewModel
MVVMController/ViewModelViewModel
Volt is reactive
Web Sockets FTW
<:Body>Todo ListTodovalue="{{ page._new_todo }}" />
def add_todopage._todos << { name: page._new_todo }page._new_todo = ''end
<:Body>Todo List{{ page._todos.each do |todo| }}{{ todo._name }}{{ end }}
Demo
Interesting bitsComponentsUser management is built-inTasks
Volt’s not perfectOpal isn’t quite there yetMongoDB is the only supported datastoreMany features are work in progressThe documentation is kind of lacking
Contribute to Volt!
https://github.com/voltrb
02550751001998 1999 2000 2001 2002 2003 2004 2005 2006 2009 2011 2015
02550751001998 1999 2000 2001 2002 2003 2004 2005 2006 2009 2011 2015 2016
Getting Started with VoltOfficial docs (http://voltframework.com/docs)gitteroffice hoursvideo tutorials
Felina
@bbatsovhttp://batsov.comhttp://emacsredux.com
[email protected]