Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are a number of reasons why I did this:

1. I want to experiment with implementing an imperative language with mutable global state on top of Erlang. A goal was to do it in straight Erlang without extensions.

2. I am giving a talk on implementing DSL's on Erlang at the next Erlang Factory in San Francisco in March, http://www.erlang-factory.com/conference/SFBay2012 (be there, it's going to be good, the whole factory I mean), and I wanted to be able to give practical experience from implementing a real-life imperative mutable data language. Lua is a nice, small, relatively clean language and is a good choice for this. And it is actually in use. I was also considering PHP or Javascript but they are definitely not small and clean.

3. Lua is an interseting language in its own right and has some cool ideas. You can get quite far with a few simple primitives. I don't know if these would be transferable to Erlang.

4. I like implementing languages.

While erlua is definitely interesting it is "just" an Erlang interface to a standard Lua system and not what I was after. I know that this idea is being used in some commercial systems so it is definitely a viable option.

Whether this is of any practical use I don't know. For doing large amounts of Lua execution then a solution like erlua is probably better as the straight lua implementation is faster than luerl can ever be; doing mutable data in an immutable environment is not free. However, the interface between Erlang and Lua in luerl is definitely faster so for smaller amounts of work it may be better. There is also the benefit of while there are many languages there is only one system running them. Could lead to easier maintenance.

This only a first version and there is much still to do. I am experimenting with different ways of implementing Lua's mutable data and I am looking at compiling the Lua code down to native Erlang machine code; the current version is an interpreter. There are also some language features left to implement. More libraries would help.

That is the status as it stands. My goal is to have a system where people could take their Lua code and just run it in luerl.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: