[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: extension for lua bytecode files
- From: "Ashwin Hirschi" <deery@...>
- Date: Sun, 17 Jun 2007 15:19:08 +0200
> I'm writing a program that embeds Lua and which will have significant
> parts written in Lua. In order to make it easier to deploy I'm embedding
> the bytecodes in the executable, which I am doing by a .lua -> .luo -> .c
> translation. The C file just declares an array and initializes it with
> the contents of the Lua bytecodes so it can be passed to luaL_loadbuffer.
> I guess lots of people do something like this?
Instead of embedding Lua byte code you might consider keeping all your Lua logic separate from your (compiled) C program.
If indeed a significant part of your application is written in Lua and you have a fair number of scripts, you could compile & bundle them in, for instance, an archive or database format [preferably one you can easily access from your C program... ;-)].
My company has been deploying software this way for years. Mostly we use "application packages" based on zip archives or SQLite databases. And this has worked very well for is.
The approach makes a lot of sense, especially if you have a fairly stable Lua-host/runtime and are developing the better part of your solution in Lua.
For such a scenario updates are often mostly enhancements/tweaks to your Lua logic. So, all you need to do to deploy any changes is recompile and send out the repackaged Lua scripts, without the need to rebuild your entire solution and distribute executables (and such).
Anyways, consider it some food for thought on a Sunday afternoon.
no signature is a signature.