lua-users home
lua-l archive

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


On 11/05/2011 13.29, steve donovan wrote:
On Wed, May 11, 2011 at 1:11 PM, Lorenzo Donati
<lorenzodonatibz@interfree.it>  wrote:
Of course, if Lua could do system API calls directly and there were a Lua
_compiler_ that allowed to translate Lua code directly to exe files with no
mandatory extra dependency, that would be sweet! :-)

Ah, but embedding Lua in a little Lua core is not difficult - have a
look at lhf's srlua.  And for larger multiple-file applications, there
is Mathew Wild's Squish which can knock an app into a single file.


Yes, I know srlua and use it from times to times. As for squish, which would be very interesting, last time I checked (~1yrs ago) it didn't work for me (it had problems with C extension modules). I don't remember having seen updates announced on lua-l, but I admit I didn't checked its website recently.

Generally, doing system API calls directly is cool but only needed for
the most demanding of tasks.  One could bundle the necessary C
extension code with the srlua executable.  A clever tool could
generate the needed code and compile it all together.


Well, I don't think sleeping a process for a given amount of time, or detecting the title of the Windows of a running process or accessing Window's registry can be defined "demanding". There are things that Lua simply can't do without a C extension.

Probably there are packages out there that do the same things as AutoIt or AutoHK, but I doubt there is any one that packs all those "general purpose functions" as these two tools. I prefer AutoHK, because it is open source, but its syntax is ugly (and full of loopholes, workarounds, and lacks coherence). If its author would ever think to drop its current interpreter and replaced it with Lua, I would be an happy man! :-)

Whenever its bulk justifies it, I use wxLua, but it also lacks some things, and nevertheless using wxLuaFreeze generates at least ~2MB of exe file (when passed through UPX; ~5MB otherwise).

I tried also IUPLua for GUI stuff, but it was a pain to build and didn't work so well. I found the learning curve was too steep compared to wxLua, so I stick with this latter when it comes to GUIs+Lua, notwithstanding its size.

Then there is LuaCOM. I tried it, but I had some issues with it (I don't remember now - ~1yrs ago), and that still forces me to learn COM (which I wouldn't want to). If I have to choose where to spend time learning MS specific stuff, I'd prefer investing on Win32 API directly.

I don't like too much to rely on proprietary technology, since I don't run a business that makes money out of it. So I try to stick to the basics there - WinAPI seems more stable and less boilerplate, at least for simple things, even if you have to write some C code (from my POV, of course).

What's nice about distributing little apps as Lua executables is that
they remain pretty small, less than 200K, which falls way below the
threshold of 'small' these days.


Yes. Definitely!

steve d.




Cheers!
-- Lorenzo