

If Ruby is object-oriented Perl, then Reia is object-oriented Erlang - bascule
http://www.unlimitednovelty.com/2010/06/reia-everything-is-object.html

======
deno
Besides Ruby-like syntax how does it differ from parametrized modules?

From his example:

= Reia:

    
    
      class Foo
        def initialize(value)
          @value = value 
        end 
        def value
          @value
        end 
      end
    

= Erlang:

    
    
      -module(foo, [Value]).
      value() -> Value.
    

And it's actually prettier.

Can you do some crazy pattern matching and type overloading like with Scala?
Or is it just syntactic sugar for parametrized modules?

~~~
bascule
Parameterized modules don't have constructors. That doesn't matter in a
trivial case, but it does when you want some complex state set-up which you
don't want to repeat every single time you "instantiate" a parameterized
module?

Also, Reia has inheritance. Parameterized modules don't.

~~~
deno
They certainly do with -extends(). As for constructors… there's probably way
around that too. Point is Reia's OO-revolution doesn't introduce any
fundamental changes besides syntax.

~~~
bascule
-extend() is another half-assed solution. It's closer to mix-ins than inheritance.

Object orientation in Reia is baked into the core language itself. Like Ruby,
all of its core types are objects. In Perl and Erlang they are not. Reia
factors the core language types into objects, instead of amalgamations of the
core types with arbitrary and poorly factored functions which act on them.

------
viraptor
I wonder about " _The canonical approach, Erlang records, are a goofy and oft
reviled preprocessor construct with an unwieldy syntax._ " After writing a bit
of Erlang code, I don't mind records that much. They're not prefect, but I
would never call them bad, goofy, etc. They're also used in pretty much every
situation where a state in a predefined form is needed (config files, server
state, etc.) so that proplists are not needed (no need for dynamic list).

So... what is the complaint about records really?

~~~
rubyrescue
i agree, you get used to them. but what i don't like about them is that the
way you have to specify the record every time you reference the object. so

Bar = Foo#foorecord.bar, Baz = Foo#foorecord.baz

it feels unnecessarily redundant. Shouldn't we already know Foo is a record of
'fake type' #foorecord? It's like a poor man's type system, and it's ugly.

Also, probably more importantly, since they're a compile-time trick you can't
use them in the console, which makes experimentation and sometimes debugging
harder.

~~~
viraptor
> _Bar = Foo#foorecord.bar, Baz = Foo#foorecord.baz_

#foorecord{bar=Bar, baz=Baz} = Foo

Readability depends on what does your brain process, when you see "=" ;)

> _since they're a compile-time trick you can't use them in the console_

Check the `rX` commands from <http://www.erlang.org/doc/man/shell.html> You
can use the records just like in normal code, but you have to load them
explicitly.

------
baddox
The title is correct, albeit vacuously.

------
yah
Clearly the author knows Erlang almost as well as he knows Perl.

~~~
azgolfer
LOL - Ruby is Smalltalk, not object oriented PERL. PERL has had objects for
quite a while.

