[erlang-questions] Luerl - Lua in Erlang

Henning Diedrich hd2010@REDACTED
Mon Feb 20 06:16:54 CET 2012


On 2/20/12 3:38 AM, Robert Virding wrote:
> I have given some more comments in http://news.ycombinator.com/item?id=3610332 .
>
> Suggestions are welcome.
>
 >> Re ycombinator:

 >> "Lua is a nice, small, relatively clean language."

I experience Lua as very magic, in the non-least surprising sense.

It can be so overloaded that it can be hard to guess what a simple bit 
of Lua code really does. Which is maybe not ideal for an DSL

Since __metatable is on the TODO list, maybe Luerl hasn't yet run into 
those waters.

I'd expect challenges there because the magic stems from Lua's 
formidable small- & cleanness -- or maybe Erlang turns out a marvelous 
fit. Certainly a very exciting side of the experiment.

 >> "However, the interface between Erlang and Lua in luerl is 
definitely faster so for smaller amounts of work it may be better."

This is a very exciting point - and all it needs for an answer to the 
'practical use' question. I'm anxious to see how you will eventually 
implement the tables.

To go for speed, wouldn't you have to make a choice based on table size? 
Isn't there an absolute threshold where lists and trees just become to 
expensive to 'udate'? I measured structures once and the cost of flat vs 
deep structures' mutations was as expected [1].

Is it known lore from when on ets are more performant than, say, trees?

The table structure in Lua has been endlessly debated on the Lua list. 
Good thing you are probably striving for a true image rather than a 
'better' Lua. The temptations would be endless.

However, if you were to restrict yourself to a version that e.g. leaves 
metatables out, it would not really be Lua, but as a DSL still very 
useful. Maybe -- even more so.

Henning


[1] http://www.eonblast.com/blog/cost-of-mutation/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120220/f1b29aac/attachment.htm>


More information about the erlang-questions mailing list