Murga-Projects Forums
Does Luac work ? - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: Does Luac work ? (/showthread.php?tid=98)


Does Luac work ? - chrimo - 07-12-2007 06:02 AM

Hello Community,

is it possible to compile murgaLua interpreter code like it luac does ?
At standard distribution murgaLuac is not included Big Grin

Thanks for pros and cons
Bye
Christian


RE: Does Luac work ? - mikshaw - 07-13-2007 01:35 PM

I was waiting to see if someone else would respond to this, since I honestly don't know whether or not I understand your question. It sounds like luac might be similar to LuaJIT, which was mentioned here in another post just before you asked your question.
http://www.murga-projects.com/forum/showthread.php?tid=96
http://luajit.org/


RE: Does Luac work ? - JohnMurga - 07-13-2007 05:57 PM

Hi,

They are a little different, luac compiles lua code to lua bytecode ...

It is not really faster when a program runs, it just allows you to compile scripts into binary files that murgaLua could load ... With this you would loose the source, so I rather keep things running from scripts. What's more there are a couple of issues around implementing it for murgaLua, so its something that I really have no motivation at all to do.

LuaJIT is something I probably WILL be adding, this doesn't change the behavior of murgaLua, but would increase the performance dramatically under some circumstances. So it's on the todo list, but it is low priority (but easy to check out).

The issue with LuaJit is that it is x86 only at the moment, which means that only Windows/Intel-Linux/Intel-Mac would work ... This may not be such a bad thing as these are the only platforms I support right now anyway. There are a few other caveats, and I think my time is better spent looking at other things right now, so we'll see ...

Cheers
JohnM


RE: Does Luac work ? - chrimo - 07-13-2007 07:04 PM


ReHi,

Yes, LuaJIT just works at X86, but I have to use PPC and SPARC CPU's, too.
Luac is included at lua for many years Big Grin
The advantage of compiled scripts are much faster load and hide some things
from end-users... ;-(
YES, it is true...sometimes you have to hide or secure something to avoid problems at special environments (last week it worked, but today not. I haven't changed anything...)
Luac-Bytecode and Lua-Source can coexist together, if luac exists it is used, else lua...

I've asked for it, because I expect problems with some murgaLua included
extensions...
I try it out myself this weekend Big Grin

Thanks for all your friendly responses

Bye
Christian


RE: Does Luac work ? - JohnMurga - 07-13-2007 10:44 PM

chrimo Wrote:
Yes, LuaJIT just works at X86, but I have to use PPC and SPARC CPU's, too.

If you build murgaLua for these architecture I'd be REALLY interested if you could contribute the binaries :-) :-)

chrimo Wrote:
Luac is included at lua for many years Big Grin

I know, but I've never liked it, see below for a solution to your problem though ;-)

chrimo Wrote:
The advantage of compiled scripts are much faster load and hide some things from end-users... ;-(

I found the speed increase to be negligible, but as far as hiding ... Read on ...

chrimo Wrote:
YES, it is true...sometimes you have to hide or secure something to avoid problems at special environments (last week it worked, but today not. I haven't changed anything...)

Lua obfuscates pretty well, that is also an option for you in this scenario (and is what is done with things like Javascript).

chrimo Wrote:
Luac-Bytecode and Lua-Source can coexist together, if luac exists it is used, else lua...

It is that mix that I am trying to avoid, murgaLua WILL load bytecode though, however it has to be plain Lua code.

chrimo Wrote:
I've asked for it, because I expect problems with some murgaLua included extensions...

What do you mean ? And how would this help you with extensions inside murgaLua ? If you want to load plain Lua bytecode into murgaLua you can do that currently, you just have to use the luac compiler bundled with Lua itself (which you already have if you built murgaLua for these other architectures) ... murgaLua is fully compatible with plain Lua bytecode :-)

chrimo Wrote:
I try it out myself this weekend Big Grin

Please let us know how it goes, if I can help with your specific problem I'd be happy to.

chrimo Wrote:
Thanks for all your friendly responses

A feature that I am going to be adding is a murgaLua compiler, but this works completely differently to the Lua compiler ... It produces standalone compressed executables for all platforms. The beauty is that although the source will be completely hidden from end-users and regular tools, it'll be retrievable in it's original form through the use of a specialized de-compiler I will also provide.

Cheers
JohnM


RE: Does Luac work ? - mikshaw - 07-13-2007 11:10 PM

Quote:
Lua obfuscates pretty well

Do you know of any available examples to see? I'm not one to use obfuscation myself, but I find the concept interesting.

Quote:
YES, it is true...sometimes you have to hide or secure something to avoid problems at special environments

Speaking somewhat idealistically, I don't believe that hiding code is beneficial in any respect other than protecting "intellectual property". Hiding your code only gives you the appearance of security. There is NO security if "special environments" includes a system that does not have proper file permissions and the user logs in as root/administrator. I have no idea what you meant by special, so I can only guess at that. In any case, compiled code is hidden only to those who are not very interested in what's inside.