This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Use Lua to write Windows programs
Started by kornichen, 01 April 2014 - 11:27 AMPosted 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.
Posted 01 April 2014 - 01:40 PM
love2d?
Posted 01 April 2014 - 01:43 PM
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.
Posted 01 April 2014 - 02:24 PM
Not true withproblem 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.
love2d?
Posted 01 April 2014 - 05:00 PM
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.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.
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…
Posted 01 April 2014 - 05:30 PM
What about decompiling it?If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
Posted 01 April 2014 - 05:31 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.What about decompiling it?If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
Edited on 01 April 2014 - 03:33 PM
Posted 01 April 2014 - 06:26 PM
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)What about decompiling it?If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read…
Posted 01 April 2014 - 07:34 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.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.
Posted 01 April 2014 - 08:03 PM
Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.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.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 - 06:04 PM
Posted 01 April 2014 - 08:31 PM
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.Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.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.
Edited on 01 April 2014 - 06:32 PM
Posted 03 April 2014 - 03:25 PM
Yep, that's exactly what I wanted to say.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.Have fun trying to modify the raw bytecode. You can modify any compiled language, I just never said it was easy.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.
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.
Posted 03 April 2014 - 05:57 PM
you can easialy bundle Lua and libriaries such as GUIs: http://lua-users.org...terfaceToolkitsJust 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.
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