

Reia: Friendly, Ruby-style syntax on the Erlang VM - nathanwdavis
https://github.com/tarcieri/reia

======
nathanwdavis
This is still very alpha, but I'm submitting this because I really hope this
succeeds. Erlang is really powerful and provides more modern paradigms for
concurrent programming that just are not easily implemented in other VMs.
However, Erlang's prolog inspired syntax is a big turnoff to many programmers.
This could be a breakthrough.

~~~
gurraman
I guess I'm weird but I actually like Erlang's syntax. To me it's part of the
language's personality.

~~~
nathanwdavis
Yeah, I don't mind it either. Syntax is not a big deal to me, I care more
about the unique capabilities of a language are. But I have heard other
developers say they hate it.

~~~
gordonguthrie
I was mostly using Ruby when I switched to Erlang full time 5 years ago and I
really struggled with the syntax.

I have got to start writing Ruby again now (to use the OLE libraries which I
ain't going to reimplement). Ruby looks like line noise now.

The key thing about switching to Erlang is that _it is not a programming
language choice_. Erlang/OTP is an _Application System_ that runs on one or
more computers. We stick with Operating Systems (including super-ugly ones
like the Unices) because of the benefits of knowing that your unwritten
software can write to disk, speak to a network, use a GUI etc. Once you have
started writing to an Application System where your unwritten software knows
how to fail over to a new machine, you ain't going back.

The syntax could be nicer? Who cares? Love the one your with is my experience
- oh and I really do heart the mighty Erlang.

------
jwecker
I too have been following Reia since he started it up and... well, I'm
consistently disappointed. I'm putting this out there publicly because it's
come up with co-workers. In the end, he's waffled with so many language design
decisions that, in my opinion at least, it's turned into a language that on
one end doesn't have the true syntactical flexibility of Ruby, and on the
other side has buried a lot of what is most useful in Erlang. For alternatives
I would suggest Lisp Flavored Erlang
<http://forum.trapexit.org/viewtopic.php?p=40268> or Efene / Ifene
<http://www.marianoguerra.com.ar/efene/> \- both of which do much better at
being Erlang-(but-with-better-syntax).

Edit: This is referring to its current state only- I reserve the right to
change my mind in the future (:

~~~
bascule
Hi, Reia's my thing. My view on waffling on language design decisions:

If you're working on a language project, fuck it up, and don't do a rewrite,
you get PHP.

That said, your other criticisms are valid: much of Erlang's functionality
doesn't have first class Reia support (but is still directly callable through
the presently undocumented Erlang interfacing syntax)

Many of Ruby's great features aren't available in Reia yet either. I'm
shooting for a subset of Ruby's metaprogramming features which aren't
incompatible with Erlang-style code loading.

I hope you'll continue to watch the project.

~~~
jwecker
The word waffling was too negative, and you're right. I apologize and I'll
definitely keep watching. Erlang and Ruby are my two favorite languages as
well, so if you do pull it off at some point, you'll have my support (:

------
ohyes
I feel that we spend too much time worrying about the syntax of programming
languages. I don't find switching between typing in erlang/lisp/java/ruby code
any more difficult. All I do is switch IDEs (or plugins) and I'm at about the
same level of productivity typing wise.

Semantics are much more interesting to talk about, but it seems we never do
talk about them. We rarely have holy-wars over the semantic differences
between (for example) c and lisp, or lisp and Erlang.

There are certain problems that are easier to solve when expressed as many
concurrent processes. In this same way, there are certain problems that are
easier to solve when expressed as self modifying code or a tower of objects,
or low level bit bashing.

At a certain level, different syntaxes do absolutely nothing for me. No matter
what I'm doing with code, I am manipulating a syntax tree. I'm never thinking
about the syntax on the page as the 'code,' what is on the page is just a
representation of the 'code' that is in my head and being run by the computer.
And the semantics of that 'code' is what influences how I use the language.

Syntax on the page is almost a deception. Kind of an illusion that influences
you into thinking about the code in a certain abstract way (a spatial 'on the
page' arrangement of different parts), when really, the code was already
abstract to begin with (runtime execution 'arrangement' of the different
parts).

------
daleharvey
This is a cool and fun project, but a lot of people in the thread are pretty
confused about erlang syntax so I wanted to post this.

erlang's syntax is not some arcane afterthought, it may look strange or even
"ugly" to people not familiar with it, but it has been very well thought out
and purposeful, every time there is a choice between a beautiful construct
that can add confusion, or a less elegant solution that is crystal clear,
erlang chooses less elegant every time.

I have been doing javascript since I started programming and still get
confused by its object model + prototypal inheritance, the same is true for
pretty much every language, python, ruby, c++ etc going back to erlang is a
refreshing break.

~~~
moe
I'll stick with Damien Katz on this:

    
    
       Erlang is based originally on Prolog, a logic programming     
       language that was briefly hot in the 80's. Surely you've 
       seen other languages based on Prolog, right? No? Why not? 
       Because Prolog sucks ass for building entire 
       applications. But that hasn't deterred Erlang from 
       stealing it's dynamite syntax.
    

cf. <http://damienkatz.net/2008/03/what_sucks_abou.html>

~~~
troutwine
Until our species gets rather better at quantifying the effect of
communication mediums' on cognition I take issue with Mr. Katz's assertion.
The semantic meaning of Erlang and prolog code is such that ideas can be
expressed rapidly, in my experience. Besides, taste in syntax is like taste in
tea: you might prefer a light cup of Earl Grey, I might like mine over-brewed
and bitter. Prolog's syntax--and by extension Erlang's--is an acquired taste,
perhaps; I like them both.

Tea time!

~~~
moe
You of course have a point in that "you can't argue with taste".

However programming languages live and die by the size of their community.
Erlang has, by choice of an over-brewed and bitter syntax, drawn itself into a
niche much smaller than it deserves. The only chance to escape would be to
adapt a more popular taste.

Otherwise it will eventually be obsoleted by a language "as powerful as
erlang, but minus the arcane syntax".

~~~
troutwine
I'd like to use that language.

------
pjscott
What would make this more attractive to me is a mechanism for _local_ mutable
state. Some algorithms are just easier to express if you're allowed to change
the values of some local variables. Erlang has no shared mutable state, but as
Haskell's State monad shows, it's perfectly possible (and often useful) to
keep mutable state boxed off safely.

Since this can be transformed to tail-recursion, you should be able to
implement it on the Erlang VM without too much trouble. Getting a convenient
syntax and doing the transformation would be the hardest part.

~~~
wnoise
There is still the process dictionary, but it's a bit unwieldy.

<http://www.erlang.org/course/advanced.html#dict>

~~~
gordonguthrie
Yes the process dictionary seems attractive, but you will come to regret it.
It will always bit you in the bum, don't do it, don't do it, don't do it.

~~~
nathanwdavis
Can you explain why please?

~~~
gtani
background on PD (tho i havent kept up with developments in R14, i can't say
whether everything below still valid

[http://groups.google.com/group/erlang-
programming/browse_frm...](http://groups.google.com/group/erlang-
programming/browse_frm/thread/15e3718c9fab68f7/c64371fee1f859f6?tvc=1#c64371fee1f859f6)

\------------

(Oct 09) [http://groups.google.com/group/erlang-
programming/browse_frm...](http://groups.google.com/group/erlang-
programming/browse_frm/thread/8c5aac9e0ae91895/72683f33f1c4be85?tvc=1#72683f33f1c4be85)

~~~
nathanwdavis
Hey, great links. Thanks!!

~~~
gtani
I think the consensus in 2009 was you should see how far you can get with ETS
(and this will motivate me to read the R14 release notes), PD's are kind of
like lisp reader macro's, very sharp and very slippery. There are many threads
in the google group if you want more argumentage.

------
grav1tas
Here's a question. Does there exist a decent stand alone representation (BNF
or otherwise) of the Ruby grammar? I see all this stuff that says Ruby-style,
and it looks almost like straight up Ruby. Moreover, I Google around for a
Ruby grammar and can't find much of anything substantial, but I haven't looked
in awhile. I've tried cruising the Ruby YACC file, but that's kind of a
disaster. Is there good one that exists as a reference for 3rd party Ruby
implementations?

~~~
RickHull
You might take a look at <http://mirah.org>, which is Charles Nutter's
(creator of JRuby) forging of Ruby-like syntax with static typing that
compiles to Java bytecode.

------
knodi
I really like Reia and have been following it for sometime now, I hope to use
it onces it makes into beta.

------
nivertech
Still using rake for build?

Please rebar-ify!

~~~
bascule
Perhaps. Rebar is cool. But I'd like for as much of Reia as possible to be
accessible to Rubyists with little or no knowledge of Erlang.

