Saturday, July 18, 2009

A new direction for Reia: Peridot?

I've always viewed Reia as what I hoped to become a spiritual successor for Ruby in the same way that Ruby was the spiritual successor of Perl. Talking with one of my roommates he pointed out that pearls and rubies are the birthstones of June and July respectively, so an interesting name for the spiritual successor of Ruby would be Peridot. If I had the chance to do it all over again, I'd probably would've named Reia as Peridot instead, but as it stands I've already built up a decent degree of mindshare around "Reia" so renaming the language probably isn't practical. I'll come back to Peridot in a bit.

When I first started using Erlang one of the first things I wanted to do was give it a Ruby-like syntax. It seems like two of the biggest reasons people starting out in Erlang reject it is because of the ugly syntax and single assignment. Lately I've been wondering if there would be value in a language which is semantically identical to Erlang except with destructive assignment and a Ruby-like syntax. Lisp Flavored Erlang has seen a lot of interest and is a much simpler undertaking than Reia because it merely provides an alternative syntax and doesn't try to add new and complex semantics to the language. Perhaps there's a niche for a "Ruby-flavored Erlang" which provides a Ruby-like syntax, destructive assignment, and possibly a bit of syntactic sugar while preserving the underlying semantics of Erlang and not trying to add anything new.

With Reia in its current form I feel like I've bit off a bit more than I can chew. Worse, for the past few months I've been stuck on a particularly difficult problem and also very busy. I feel like perhaps I've bit off a bit more than I can chew implementing Reia, and some bad decisions in the initial compiler design plus my frustration with Erlang syntax have left me wanting to rewrite the compiler as a self-hosted implementation. But I don't think Reia as a language is ready for that yet.

Another thing that has popped onto the scene is neotoma, a Parsing Expression Grammar-based parser generator for Erlang. Ever since I began implementing interopolated strings in Reia I have longed for something like this. I have hacked and kludged my way along implementing interpolating with leex and yecc, but a PEG would solve the issue completely and allow for nested interpolated strings of the sort Ruby supports. This has left me wanting to rewrite the scanner/parser for Reia using neotoma instead.

So what to do? How should I proceed? The idea of a simpler Reia has certainly been bouncing around in my head for awhile. I am seriously thinking of reinventing Reia as something more like Erlang, then continuing on to add things like an object system in a new language: Peridot. There are a number of interesting things this would allow. First, Reia would effectively provide a subset of what's in Peridot, and most Reia programs would be valid Peridot programs. In that regard, Reia would work something like RPython and would make a great bootstrap language for implementing Peridot. A reduced Reia would be much easier to get to production quality than one which incorporates all of the elaborate features I've currently tried to implement. And it would once and for all put to rest the complaints about Erlang syntax and single assignment.

I'm interested to hear what people think about this proposal.

11 comments:

Donovan said...
This comment has been removed by the author.
Donovan said...

I think that if neotoma is going to provide significant benefits, then there is a justified reason for developing Peridot. I am a recent graduate and I am very interested in develpoing new languages; I'm intererested in contributing on Reia/Peridot for the experience and simply as a academic pursuit.

Thomas Lindgren said...

An aside: wouldn't it be easier to take care of interpolated strings in a separate rewrite pass after parsing?

grant rettke said...

You are a scientist. Be open to considering what you have learned and changing direction. *You* are the one funding this project, right? So, you can and should do whatever you like without worrying too much about it.

vk said...

I don't see myself writing anything useful in Reia as it is today. it is doo different from Erlang and it changes too much. But, I'd definitely look into a ruby-like-syntax for almost-regular-erlang as it is much lesser risk. After all I can always convert it to Erlan syntax. It can even be automated.

johnbender said...

First, kudos for undertaking such an ambitious project.

Second, I think any language that can provide beam with a cleaner (in this case Ruby like) functional syntax, even with single assignment, would be a huge success.

Whatever you do, make sure you are content with where the project is going because its a huge investment of your time.

caioariede said...

I think that you can just rewrite the parser, if neotoma provides significant benefits (like Donovan wrote).

Can you point or write something about your frustrations with Erlang syntax during compiler development?

* I like "Reia" name. :D

good luck!

@caioariede

bobby said...

I think this is a great idea. I would be very interested in using, and contributing to, a simplified Reia if the project took on this direction. I also think saving the more complex semantic additions for Peridot is wise.

luismarianoguerra said...

hi, I just found your blog from the erlang mailing list, you could help me with my project if you want ;)

it satisfies some of your requirements (except that the syntax is influenced by python/javascript)

I would love to hear your opinion about my (new/experimental) language.

luismarianoguerra said...

I forgot the url :P

http://marianoguerra.com.ar/efene

uwanna said...

gucci replica handbags
men gucci shoes
Gucci men sneakers
Gucci men moccasins
gucci women sneakers
gucci women boots
Gucci men boots
Gucci
Gucci shop
Gucci bags
Gucci shoes
Replica GUCCI SHOES
wholesale gucci shoes
cheap Gucci handbags
Gucci ON sale
Gucci Belts
Gucci small accessories
Gucci hats & scarves
Gucci wallets
Gucci Handbags
Women Gucci shoes
Men Gucci shoes
discount gucci shoes
cheap Gucci shoes