lua-users home
lua-l archive

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



There's also another route, possibly better, if you're only targetting Windows machines.

Instead of compiling Lua code into a C binary structure, you could attach it to the .exe as a resource. Then it lives 'within' the exe file, but is extractable / replaceable without full recompile. I would recommend this option.

full control of screen print postion so that some rudimentary GUI might be devised
for a command window.

Dream on.. That won't be easy.

-ak


25.8.2004 kello 00:01, The Doctor kirjoitti:

 It is complicated for me. :) Thankyou for the support though, I think
the idea is a good one, given Lua's ease of use, and given that it
will allow Lua coders to write for other people once it exists in
practise.

I've had a moment of clarity, so I'll describe the idea as I see it.
I'd write a script, and the finished file (by path/name), either text
or compiled Lua chunk, would be passed as argument to a single
executable, with in turn would generate a new executable for testing
and using, functioning as directed by the script. It would allow
control over user keyboard input, file access and full control of
screen print postion so that some rudimentary GUI might be devised
for a command window.

The ideal would be as easy as:
MakeLua.exe  Infile.lua  Outfile.exe

The ability to have the 'make' of the final result being this easy is
of incalculable benefit, given that Lua is intended to make general
purpose coding fast and easy. It seems such a natural move that I'm
surprised it's not one of the most established forms Lua has been
adapted to..
If it really is easy to do, I'd welcome a working one from anyone who
finds it so. :)
It's not easy for me, but I'd use it well if I had one.


Asko Kauppi <asko.kauppi@sci.fi> wrote:
(24/08/2004 20:58)



I did that for a serial port logging tool at my former employer.  The
clue is in using luac (to compile the script), bin2c (to wrap the
compiled script as a lua table) and then to link them together with
main Lua (which is set up so that it initiates the script block, of
course).

I'm afraid I don't have a "keys ready" solution for you, though.  That
one was custom made, using Hamster as the build tool to automate the
process, but you could use a makefile.  It isn't complicated, and well
worth someone doing a generic solution (or a working example) on.

-asko


24.8.2004 kello 22:18, The Doctor kirjoitti:

 Hello, I am totally lost.
I can program Lua 4 as it is used in PtokaX, and I want to run this,
or Lua 5, in the same easy way, but to build standalone commandline
executables for Windows or DOS. (Basically small customised tools for
my own use..)