This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
kornichen's profile picture

Use Lua to write Windows programs

Started by kornichen, 01 April 2014 - 11:27 AM
kornichen #1
Posted 01 April 2014 - 01:27 PM
Just want to know what you think about using Lua to write programs for Windows because normally Lua is thought as a script language I think. Does it make sense to use Lua for the mentioned use.
TurtleHunter #2
Posted 01 April 2014 - 01:40 PM
love2d?
apemanzilla #3
Posted 01 April 2014 - 01:43 PM
love2d?
6677 #4
Posted 01 April 2014 - 02:06 PM
problem with using scripting languages such as lua is that you require the end user to have the lua interpreter installed and you are distributing your entire program in source form. It can also be pretty slow compared to compiled technologies but with relatively modern machines its fine for most purposes.
apemanzilla #5
Posted 01 April 2014 - 02:24 PM
problem with using scripting languages such as lua is that you require the end user to have the lua interpreter installed and you are distributing your entire program in source form. It can also be pretty slow compared to compiled technologies but with relatively modern machines its fine for most purposes.
Not true with
love2d?
1lann #6
Posted 01 April 2014 - 05:00 PM
problem with using scripting languages such as lua is that you require the end user to have the lua interpreter installed and you are distributing your entire program in source form. It can also be pretty slow compared to compiled technologies but with relatively modern machines its fine for most purposes.
Not true, you can compile Lua programs with LuaJIT in the command line. Not to mention you could always package Lua binaries with your program.
apemanzilla #7
Posted 01 April 2014 - 05:15 PM
If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
ardera #8
Posted 01 April 2014 - 05:30 PM
If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
What about decompiling it?
apemanzilla #9
Posted 01 April 2014 - 05:31 PM
If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
What about decompiling it?
Can't. string.dump converts a function into it's binary representation, you can run it with loadstring but there's no way to convert it back into the raw code.
Edited on 01 April 2014 - 03:33 PM
6677 #10
Posted 01 April 2014 - 06:26 PM
If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
What about decompiling it?
LuaDec51, one of many decompilers of lua bytecode. Reverse engineering of lua bytecode is extensively documented, it won't be identical to original source but is often recognisable (more so than machine code decompile efforts usually)
ardera #11
Posted 01 April 2014 - 07:34 PM
Can't. string.dump converts a function into it's binary representation, you can run it with loadstring but there's no way to convert it back into the raw code.
Maybe getting the original code is not possible, but one of the effects of compiling is making the code "unmodifiable" (you could also modify the bytecode, but that's complicated). Making the code readable to humans makes it modifiable. Even if you can't get the original code, a code that does the same thing is modifiable too.
apemanzilla #12
Posted 01 April 2014 - 08:03 PM
Can't. string.dump converts a function into it's binary representation, you can run it with loadstring but there's no way to convert it back into the raw code.
Maybe getting the original code is not possible, but one of the effects of compiling is making the code "unmodifiable" (you could also modify the bytecode, but that's complicated). Making the code readable to humans makes it modifiable. Even if you can't get the original code, a code that does the same thing is modifiable too.
Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.
Edited on 01 April 2014 - 06:04 PM
6677 #13
Posted 01 April 2014 - 08:31 PM
Maybe getting the original code is not possible, but one of the effects of compiling is making the code "unmodifiable" (you could also modify the bytecode, but that's complicated). Making the code readable to humans makes it modifiable. Even if you can't get the original code, a code that does the same thing is modifiable too.
Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.
I think the connotation was that you could use LuaDec to get the human readable source and alter that. It won't be 100% accurate to the original code but it is still going to achieve the same thing and is still human editable.
Edited on 01 April 2014 - 06:32 PM
ardera #14
Posted 03 April 2014 - 03:25 PM
Maybe getting the original code is not possible, but one of the effects of compiling is making the code "unmodifiable" (you could also modify the bytecode, but that's complicated). Making the code readable to humans makes it modifiable. Even if you can't get the original code, a code that does the same thing is modifiable too.
Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.
I think the connotation was that you could use LuaDec to get the human readable source and alter that. It won't be 100% accurate to the original code but it is still going to achieve the same thing and is still human editable.
Yep, that's exactly what I wanted to say.
apemanzilla #15
Posted 03 April 2014 - 04:48 PM
True, but then again- there are decompilers for Java and other compiled languages. string.dump is as close an alternative to compiled Lua as you're going to get.
PixelToast #16
Posted 03 April 2014 - 05:57 PM
Just want to know what you think about using Lua to write programs for Windows because normally Lua is thought as a script language I think. Does it make sense to use Lua for the mentioned use.
you can easialy bundle Lua and libriaries such as GUIs: http://lua-users.org...terfaceToolkits
it does make sense because its faster to develop programs in Lua than C (or even java sometimes) but you do need to be very good with vanilla Lua
another advantage is that its very portable, if you want to make a package you just need the Lua binaries for that platform, usually dont need to compile on different platforms