This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
FuuuAInfiniteLoop(F.A.I.L)'s profile picture

Any way to make an standalone?

Started by FuuuAInfiniteLoop(F.A.I.L), 06 June 2013 - 04:58 PM
FuuuAInfiniteLoop(F.A.I.L) #1
Posted 06 June 2013 - 06:58 PM
There is some way to compile a cc program to an standalone executable?
Kingdaro #2
Posted 06 June 2013 - 07:07 PM
I can recall someone making a program that did this, but I personally would prefer to stay within the bounds of the actual mod, as a CC program isn't exactly presentable outside of CC (in my opinion).
D3matt #3
Posted 06 June 2013 - 08:49 PM
http://lmgtfy.com/?q=Compile+lua+to+exe
Symmetryc #4
Posted 06 June 2013 - 09:00 PM
I think he is talking about programs for ComputerCraft, not for normal Lua.
Kingdaro #5
Posted 06 June 2013 - 09:03 PM
"Let Me Google That For You" stopped being oh so funny and witty ages ago. Now it's just plain rude and it makes you look like a smartass. Not only that, but you seem to have misunderstood the OP's question.

*clap*
D3matt #6
Posted 06 June 2013 - 10:14 PM
Then what is the OP looking for? A CC Emulator? A CC emulator he can compile into an executable?
M4sh3dP0t4t03 #7
Posted 07 June 2013 - 01:04 AM
It would be possible, but why should you do that? Just learn a language like c++ or java.
Mads #8
Posted 07 June 2013 - 01:30 AM
GO C++
Kingdaro #9
Posted 07 June 2013 - 02:35 AM
That's actually a good question. OP, what are you looking to distribute as a standalone? Chances are you could make it better using one of the above languages, or Python and GTK+ if it's a general purpose application, or LÖVE if it's a game.
jesusthekiller #10
Posted 07 June 2013 - 04:15 AM
GO C++

+1 ^_^/>
Mads #11
Posted 07 June 2013 - 06:11 AM
Y U NO PRESS +1 :P/>
jesusthekiller #12
Posted 07 June 2013 - 08:25 AM
Forgot :P/>
nutcase84 #13
Posted 07 June 2013 - 10:03 AM
I have been looking for this as well. I wish someone would make one. :D/>
M4sh3dP0t4t03 #14
Posted 07 June 2013 - 12:33 PM
This would be impossible just because you would need some program to run it and that wouldn't be a standalone anymore. Just learn c++ or any other language that is good to make standalone programs.
nutcase84 #15
Posted 07 June 2013 - 12:46 PM
Tomass needs to make something like this. :D/>
Engineer #16
Posted 07 June 2013 - 04:01 PM
I think at best someone could make a 'translator'. With that I mean, a converter to LÖVE or something. That is because I actually do not know if it is possible to make GUI's without an engine
Kingdaro #17
Posted 07 June 2013 - 05:07 PM
I think at best someone could make a 'translator'. With that I mean, a converter to LÖVE or something. That is because I actually do not know if it is possible to make GUI's without an engine
It is. You could totally do it in Visual Studio or with GTK+ with a bit of work. Though I might consider that an engine too.
FuuuAInfiniteLoop(F.A.I.L) #18
Posted 07 June 2013 - 05:37 PM
I mean like a compiler that copy itself with the program so when you run it, the compiler executes your program dont having to install a emulator, just running it
jesusthekiller #19
Posted 07 June 2013 - 06:15 PM
Since Lua is an script language it needs an envioverment to run in. Hello World would be 30Mb.
D3matt #20
Posted 07 June 2013 - 07:07 PM
I mean like a compiler that copy itself with the program so when you run it, the compiler executes your program dont having to install a emulator, just running it
Do you want CC specifcally or just lua? There are many such things for Lua, nothing for CC specifically.
Engineer #21
Posted 07 June 2013 - 07:24 PM
I mean like a compiler that copy itself with the program so when you run it, the compiler executes your program dont having to install a emulator, just running it
Do you want CC specifcally or just lua? There are many such things for Lua, nothing for CC specifically.
As he states in the OP, he wants it for a CC program..
AfterLifeLochie #22
Posted 07 June 2013 - 07:25 PM
While you all seem to be orbiting the whole objective, this is actually pretty simple in terms of execution.
  • It's theoretically pretty easy to convert any of the two emulators currently in existence into a `standalone launch` platform, it's just not been implemented yet, I've had a few PM's asking me how it could be done, or if it could be embedded into websites, and I've told people to stay tuned.
  • If converting an emulator isn't attractive, you could probably replicate the Computercraft API's inside a standalone application on the Lua51.dll library in your-language-of-choice - but note, you can't directly interface with, or use, ComputerCraft code (dan200's license restricts this). There are some potentially serious limitations to be considered as well.
  • If you're talking non-ComputerCraft Lua code, you can already do this by downloading the Lua 5.1 application for your operating system, and by launching with `lua51.exe <somescript>`.
D3matt #23
Posted 07 June 2013 - 11:34 PM
I mean like a compiler that copy itself with the program so when you run it, the compiler executes your program dont having to install a emulator, just running it
Do you want CC specifcally or just lua? There are many such things for Lua, nothing for CC specifically.
As he states in the OP, he wants it for a CC program..
Right, but that could just be a terminal program in lua, he didn't really specify.
M4sh3dP0t4t03 #24
Posted 08 June 2013 - 05:07 AM
Since Lua is an script language it needs an envioverment to run in. Hello World would be 30Mb.
True, but you could modify it a little bit so you have to import all libraries you use in the program like in c or java so it would only copy the needed libraries in there.
jesusthekiller #25
Posted 08 June 2013 - 09:23 AM
No wonders why your nick includes 'noob'…
Lua is SCRIPT language what makes code impossible to be compiled. You would have to pack your code with Lua run-time system.
M4sh3dP0t4t03 #26
Posted 08 June 2013 - 01:54 PM
No wonders why your nick includes 'noob'…
Lua is SCRIPT language what makes code impossible to be compiled. You would have to pack your code with Lua run-time system.
I know that but you could only pack the needed libraries in there. It would still be much bigger than a program in any other language, but it would reduce the side of that package.

What I mean is that you pack a run time into the program you make, but only the needed stuff. For example, if you aren't using any colors for highlighting stuff, the things needed for it don't get in the package. I know it would still be a lot of space even for little programs and not really a stand-alone, but it would reduce the side of it.

Another way to do this would be modifying the emulators to make it a runtime for cc programs. Java for example needs to have the java runtime installed to run java bytecode.
jesusthekiller #27
Posted 09 June 2013 - 04:18 AM
FFS,
Lua is SCRIPT language what makes code impossible to be compiled. You would have to pack your code with Lua run-time system.
M4sh3dP0t4t03 #28
Posted 09 June 2013 - 04:53 AM
I know that.
Pinkishu #29
Posted 09 June 2013 - 09:37 AM
FFS,
Lua is SCRIPT language what makes code impossible to be compiled. You would have to pack your code with Lua run-time system.

Which is entirely possible. Not sure why people think it would be bad either, Lua itself is quite compact
iirc lua itself is about <1 MB and LuaJit still <4 MB
May be large for a "Hello World" program, but then if you start coding something worthwile it shouldn't matter
MaHuJa #30
Posted 10 June 2013 - 09:24 AM
Lua is SCRIPT language what makes code impossible to be compiled.

And now for the truth: see luac.

And if that is TooMuchWork;Didn'tBother: The output of luac will still require the full lua runtime (at a few hundred kB), it's just entered in place of the code that generated it, and so it can skip the compilation step. The version of luac must match the runtime.

Anyway, this thread is fairly useless because the OP was way too ambiguous. With the way it degenerated (at least in part as a result), I suggest the thread should be locked.
M4sh3dP0t4t03 #31
Posted 10 June 2013 - 10:10 AM
He wants CCLua and not the normal one.
D3matt #32
Posted 11 June 2013 - 01:39 AM
He wants CCLua and not the normal one.
Then compile it with the CC APIs.
M4sh3dP0t4t03 #33
Posted 11 June 2013 - 07:33 AM
He wants CCLua and not the normal one.
Then compile it with the CC APIs.
Sure but what about the graphics and that stuff? You would have to completely rewrite the code that displays all the stuff in it
Tiin57 #34
Posted 11 June 2013 - 09:34 AM
He wants CCLua and not the normal one.
Then compile it with the CC APIs.
Yeah, but the Java-side APIs wouldn't be there.
jesusthekiller #35
Posted 12 June 2013 - 10:54 AM
And you would have to emulate terminal…
And rednet…
And modems…
And shitton of other stuff…
nutcase84 #36
Posted 12 June 2013 - 02:30 PM
Why don't you guys just make a LOVE 2D emulator? I would, but I HATE OOP.
Lyqyd #37
Posted 12 June 2013 - 02:56 PM
Anyway, this thread is fairly useless because the OP was way too ambiguous. With the way it degenerated (at least in part as a result), I suggest the thread should be locked.

Then report it next time, please, rather than posting it. You seem to have been a fairly positive contributor so far, so I'd hate to see you wander down the backseat moderation path. We greatly prefer and encourage the use of the report button any time a user feels that moderation is required.

I'm still comfortable letting the thread meander, albeit with a little cleanup.
Tiin57 #38
Posted 12 June 2013 - 04:38 PM
I HATE OOP.
Ok, mister time traveler from the 70s.
Engineer #39
Posted 12 June 2013 - 04:51 PM
Why don't you guys just make a LOVE 2D emulator? I would, but I HATE OOP.
Well, it is pointless to make it in my opinion. Because you must decide yourself what you are putting in your .load .run .draw etc. functions. Im not saying it is impossible to do, but it is pointless imo
nutcase84 #40
Posted 12 June 2013 - 06:52 PM
Why don't you guys just make a LOVE 2D emulator? I would, but I HATE OOP.
Well, it is pointless to make it in my opinion. Because you must decide yourself what you are putting in your .load .run .draw etc. functions. Im not saying it is impossible to do, but it is pointless imo

Someone just made my day.
http://www.computercraft.info/forums2/index.php?/topic/13445-lightweight-cc-emulator/