lua-users home
lua-l archive

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

On Thu, Aug 02, 2001 at 02:23:35PM +0200, Erik Hougaard wrote:
> As far as I know, it only unix shells (and some webservers) that will look
> at the first line and select the right script executer. But how does unix
> select the current binary executer for java files and other funky unix
> binaries (xenix ??)  ?

It's usually done in the kernel on most UNIXes, whether it's checking
the script header or checking for other magic to determine how to
execute it. The nice thing about the script header as opposed to adding
Yet Another binary magic number is that no kernel modification needs
to take place, everything happens in userspace, and you can add as many
scripting languages as you like.

> Yeah its not that hard :-) but you will have to create a bigger header and
> I'm interrested in keeping the compiled bytecode as small as possible.

I don't really care (I use lua for embedded stuff only anyway), but I
don't think it makes that much of a difference. With a well-designed change,
you wouldn't need to provide that header -- it would just be convenient
for people using lua standalone on *nix and compatibles. The only
added complexity would be in the interpreter, and I think that's a
pretty trivial change.

FWIW, also, I use ``.luc'' for Lua bytecode files, but that's pretty

 |/|  Julian Squires <>