lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Sep 19, 2006, at 10:28 AM, Nicolas Cannasse wrote:

Hi list,

I have been working in the past years on the Neko VM (http://nekovm.org)
which share similar goals with Lua. I was interested in comparing the
different choices made by the two VM and how they can impact the
performances, so I wrote a comparison report available there :


I would like to get reviews and feedbacks from people that have been
working on Lua VM or have knowledge about its internals.


First of all, let me say that this is going to sound combative, but it's not meant to be. I just want to understand...

My first question is: why does your FAQ ignore the 600lb gorilla, _javascript_? This is not unusual, the Lua designers did the same thing in designing Lua. You have chosen to use syntax that is very similar to _javascript_, which is great! Unfortunately the Lua designers have chosen not to go this route. And at a big company like mine (Apple) this is a showstopper.

Just to tell you where I am coming from: when I started at Apple, I really wanted to use Lua, as I had with Emma (emma3d.org). But we can't introduce yet another scripting language so I have returned to using _javascript_. This is good and bad. Good because I really like _javascript_ for its syntax and semantics (which is heresy here :-) But it is bad because our _javascript_ implementation is not as fast as Lua (which is true for ALL _javascript_ implementations). But we are moving toward JIT and other optimizations in the future, so things will get better.

One other thing. Had Lua syntax been very close to _javascript_, I think I could have sold it here (but no one will ever know :-) !!!

So, with that in mind, here are a few comments:

- Is it true that your array type is not resizable? It seems like adding the ability to change the array length would not affect performance (except when you resized the array, of course).

- It seems like your function and array types cannot store hashed data values. Is that right? I find it very useful to be able to store properties on these types, like you can in _javascript_. But maybe that would be too much overhead.

- It would be useful to have an __call metamethod for objects. In fact, having this would make it possible to create function types with full object semantics, like I mention above.

- Your abstract type has a 'kind' identifier, which is a nice way to identify the type. But is this value unique? If you are using two libraries which create abstract objects, is there a guarantee that their kind values will be different? If so, this means I can simply check kind and then static cast the data pointer and be assured that the pointer will be valid. In Lua I need to access the metatable and compare it with a "prototype" metatable to make sure I have a userdata of the correct type.

- Finally, do you have any hard comparisons between Neko and Lua (and _javascript_ :-) ???

-----
~Chris                       And now, an important message from Microsoft:
chris@marrin.com  "Dear aunt, let's set so double the killer delete select all"