Reia, Ruby/Python on the Erlang VM, presented at Boulder.rb

Made my way up to Boulder last night to hear Tony Arcieri speak about Reia, his implementation of a Ruby/Python-like syntax for the Erlang Virtual Machine. I have only just begun my venture into learning the world of Erlang, but the syntax is hard to digest. Tony’s inspiration for Reia came from trying to implement an actor model in Ruby similar to Smalltalk’s, but quickly realized that Erlang had the actor model he was looking for and decided to write a Reia instead. Building Reia on the Erlang VM also allows all code to be run concurrently, one of the big drawbacks to most OO languages. Reia is not without is drawbacks either. All variables are versioned (more later) and each instance will spawn a new gen server which makes garbage collection difficult unless you utilize linking techniques to build a tree structure or call @thing.kill() explicitly. Variables are versioned in Reia since Erlang does not have the concept that variables can be reassigned. To get around this, Tony creates versioned variables which converts from Reia’s syntax: a = a + 1, to Erlang syntax as: A1 = A0 + 1. There are a handful of things missing from Reia that are either planned or purposely absent: Loops cause a dead lock, instance_eval is planned, Mixins? Still up in the air on implementation, Metaclasses, and a handful of other niceties of Ruby. The tradeoff though is the ability for powerful pattern matching, concurrent code, a messaging protocol, and no more ugly Erlang syntax. To me its a great win for anyone who needs concurrency and speed, but does not want to fight the righteous Erlang fight. Thanks again to Tony for the great talk!


Leave a Reply