lua-users home
lua-l archive

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


On Tuesday 03 October 2006 11:01, Philippe Lhoste wrote:
> askok@dnainternet.net a écrit :
> > Maybe AutoHotkey should embrace Lua as its language core,
> > entirely?  :) 
> 
> I thought about this, of course... Since it is GPL, I have access to
> the sources, so writing a Lua wrapper for its core shouldn't be too
> hard... 
> But it is time consuming, and I haven't much free time.

Well, I don't know what's more work: adding associative arrays to a 
scripting engine, or adding a binding for another scripting 
language... Depends on how much script code has to be ported, how 
well you know the respective APIs, code bases etc.

But of course, if one alternative means someone else does the work, 
that would be a clear winner in most cases! ;-)


Anyway, EEL ( http://eel.olofson.net/ ) currently contains a very 
simple table implementation, without hashing or any other 
"performance hacks". In another place, there is also rudimentary 
hashing for globally managing immutable strings, if you want a simple 
example of how to (maybe not :-) do that.

The main reason why I haven't optimized this stuff yet is that tens of 
thousands of lines of code later (mostly OO using tables for objects, 
similar to how many Lua projects do it), performance has not been an 
issue. For a frame of reference, some of this code runs on embedded 2 
GHz Celeron D CPUs doing closed loop regulation, data acquisition, 
signal processing, network communication etc at a 1 kHz "frame rate".


Of course, having core components such as scripting engines run fast 
never hurts ("free" extra CPU cycles, basically) - but if you need to 
get actual work done in a limited time frame, slow code is better 
than no code. In fact, in a turn-key real time system, making code 
run faster than it has to is usually a total waste of time.


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'