Reia Loses its Indentation Sensitivity
Posted by feydr | Posted in Uncategorized | Posted on 10-03-2009
View Comments
Yesterday on the reia mailing list Tony asked all of our opinions on indentation sensitivity. This is what we had to say:

This is what he had to say.
So basically python can stick it! Don’t worry, it’s not just because of the ponies

or because it’s a speed demon compared to ruby and we are jealous — it’s just a matter of principle (and developer time). Haml is next in line!
Anyways, what the fuck is Reia anyways? Taken from the wiki, “Reia (pronounced RAY-uh) is a Python/Ruby-like scripting language for the Erlang virtual machine (BEAM).”
What the fuck is erlang?
So why is it cool?? Cause, erlang is considered to be the ONLY language that not only meets concurrent concerns but EXCELS with flying colors on it — too bad the syntax can suck a nut or two…and coupled with the fact that since it’s a functional language with single assignment it doesn’t really fit into the object oriented paradigm that we’ve (20 something and under) have grown up with. Reia adds to the coolness by taking the 9 9′s of uptime, hot-code swapping, 80-core power producing, rampaging code crocodiling that is erlang and allowing us lowly programmers that are not voluntary-bald to kick ass with our time-saving dynamic language, duck typing, BDD, money making Machiavellism.
How do I get down with this madness?
Simple padawan. Let’s start by
installing erlang.
1 | sudo apt-get install erlang |
make sure we have 5.6.3 or greater..
1 | erl |
type q(). to quit
clone reia:
1 2 | git clone git://github.com/tarcieri/reia.git cd reia; rake install; sudo rake install |
I spend most of my time in irb so let’s
run ire:
1 2 3 | me@spicetrader:~$ ire Reia Interactive Shell (prerelease) Running on Erlang (BEAM) emulator version 5.6.3 [source] [smp:2] [async-threads:0] [kernel-poll:true] |
simple.. enough..
let’s hello world this shit up:
1 2 3 | >> puts("hello world") hello world => nil |
yes, those parens are necessary for now..
lambda?
1 2 3 4 5 6 7 8 | >> pp = fun(str) { puts("#{str} does the limbo dance"); } => # >> pp('ian') ian does the limbo dance => nil >> pp('kara') kara does the limbo dance => nil |
recursion?
for this example let’s use reia’s interpreter: reia..no kidding?!
open up your favorite text editor
vim blah.reand paste this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | module Fib def calc(1) 1 end def calc(n) if (n == 0) 0 else calc(n - 1) + calc(n - 2) end end end puts(Fib.calc(3)) puts(Fib.calc(10)) |
now let's run it:
1 2 3 | me@spicetrader:~$ reia blah.re 2 55 |
this shows you a couple important things about erlang and reia.
1st: most ppl on the erlang list will shun if/else conditionals
saying there is no need for them when you have pattern
matching and recursion
last but not least we get back to the original point of this article:
reia lost it's indentation sensitivity!!

