luac question

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
slushe
Prole
Posts: 2
Joined: Sat Aug 21, 2010 3:14 pm

luac question

Post by slushe »

After compiling a lua script with luac--what does the file need to be named so that love can read it?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: luac question

Post by bartbes »

Nothing different, if it's your main.lua, name it main.lua. I have to say, I can't advice you to use luac.
slushe
Prole
Posts: 2
Joined: Sat Aug 21, 2010 3:14 pm

Re: luac question

Post by slushe »

I see. Figured it might be a way to protect source.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: luac question

Post by thelinx »

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.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: luac question

Post by Jasoco »

I guess hypothetically you could compile a version on every OS then release each one as a finished launchable product separately for each platform.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: luac question

Post by bartbes »

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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: luac question

Post by Robin »

Bytecode for "source code protection" is right up there with black cats and those little crosses.
Help us help you: attach a .love.
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: luac question

Post by pekka »

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.
User avatar
Felipe Budinich
Citizen
Posts: 67
Joined: Thu Jul 29, 2010 1:36 pm

Re: luac question

Post by Felipe Budinich »

Robin wrote:Bytecode for "source code protection" is right up there with black cats and those little crosses.
Be careful or you could get sued for religious intolerance, some people really believe that Santa is real.

But in all seriousness it could deter my mother from looking at the source code.
User avatar
Sergeant
Prole
Posts: 6
Joined: Sat Jul 24, 2010 4:01 pm

Re: luac question

Post by Sergeant »

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.
Only partially correct.
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.
This was taken from the 4.0 Lua manual, but the same holds true for 5.1.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 7 guests