luac question
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
luac question
After compiling a lua script with luac--what does the file need to be named so that love can read it?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: luac question
Nothing different, if it's your main.lua, name it main.lua. I have to say, I can't advice you to use luac.
Re: luac question
I see. Figured it might be a way to protect source.
Re: luac question
Will only work on the OS and architecture you compiled it on. So if you compiled it in 32-bit Windows, it wouldn't work on Linux, OS X, and not even 64-bit Windows.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: luac question
I guess hypothetically you could compile a version on every OS then release each one as a finished launchable product separately for each platform.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: luac question
It should be somewhat compatible around platforms, just not versions, well lua bytecode is kind of a grey area, I don't think anyone knows exactly where it does and does not run.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: luac question
Bytecode for "source code protection" is right up there with black cats and those little crosses.
Help us help you: attach a .love.
Re: luac question
The luac manual page says this.
The binary files created by luac are portable only among architectures
with the same word size and byte order.
- Felipe Budinich
- Citizen
- Posts: 67
- Joined: Thu Jul 29, 2010 1:36 pm
Re: luac question
Be careful or you could get sued for religious intolerance, some people really believe that Santa is real.Robin wrote:Bytecode for "source code protection" is right up there with black cats and those little crosses.
But in all seriousness it could deter my mother from looking at the source code.
Re: luac question
Only partially correct.thelinx wrote:Will only work on the OS and architecture you compiled it on. So if you compiled it in 32-bit Windows, it wouldn't work on Linux, OS X, and not even 64-bit Windows.
This was taken from the 4.0 Lua manual, but the same holds true for 5.1.The binary files created by luac are portable to all architectures with the same word size. This means that binary files created on a 32-bit platform (such as Intel) can be read without change in another 32-bit platform (such as Sparc), even if the byte order (``endianess'') is different. On the other hand, binary files created on a 16-bit platform cannot be read in a 32-bit platform.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests