Jump to content




Use Lua to write Windows programs


  • You cannot reply to this topic
15 replies to this topic

#1 kornichen

  • Members
  • 220 posts
  • LocationGermany

Posted 01 April 2014 - 12: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.

#2 TurtleHunter

  • Members
  • 112 posts

Posted 01 April 2014 - 12:40 PM

love2d?

#3 apemanzilla

  • Members
  • 1,421 posts

Posted 01 April 2014 - 12:43 PM

View PostTurtleHunter, on 01 April 2014 - 12:40 PM, said:

love2d?


#4 6677

  • Members
  • 197 posts
  • LocationCambridgeshire, England

Posted 01 April 2014 - 01: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.

#5 apemanzilla

  • Members
  • 1,421 posts

Posted 01 April 2014 - 01:24 PM

View Post6677, on 01 April 2014 - 01:06 PM, said:

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

View PostTurtleHunter, on 01 April 2014 - 12:40 PM, said:

love2d?


#6 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 01 April 2014 - 04:00 PM

View Post6677, on 01 April 2014 - 01:06 PM, said:

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.

#7 apemanzilla

  • Members
  • 1,421 posts

Posted 01 April 2014 - 04:15 PM

If you wanted to distribute it "compiled," per se, you could always use string.dump to make it nearly impossible to read...

#8 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 01 April 2014 - 04:30 PM

View PostApemanzilla, on 01 April 2014 - 04:15 PM, said:

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?

#9 apemanzilla

  • Members
  • 1,421 posts

Posted 01 April 2014 - 04:31 PM

View Postardera, on 01 April 2014 - 04:30 PM, said:

View PostApemanzilla, on 01 April 2014 - 04:15 PM, said:

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 by Apemanzilla, 01 April 2014 - 04:33 PM.


#10 6677

  • Members
  • 197 posts
  • LocationCambridgeshire, England

Posted 01 April 2014 - 05:26 PM

View Postardera, on 01 April 2014 - 04:30 PM, said:

View PostApemanzilla, on 01 April 2014 - 04:15 PM, said:

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)

#11 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 01 April 2014 - 06:34 PM

View PostApemanzilla, on 01 April 2014 - 04:31 PM, said:

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.

#12 apemanzilla

  • Members
  • 1,421 posts

Posted 01 April 2014 - 07:03 PM

View Postardera, on 01 April 2014 - 06:34 PM, said:

View PostApemanzilla, on 01 April 2014 - 04:31 PM, said:

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 by Apemanzilla, 01 April 2014 - 07:04 PM.


#13 6677

  • Members
  • 197 posts
  • LocationCambridgeshire, England

Posted 01 April 2014 - 07:31 PM

View PostApemanzilla, on 01 April 2014 - 07:03 PM, said:

View Postardera, on 01 April 2014 - 06:34 PM, said:

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 by 6677, 01 April 2014 - 07:32 PM.


#14 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 03 April 2014 - 02:25 PM

View Post6677, on 01 April 2014 - 07:31 PM, said:

View PostApemanzilla, on 01 April 2014 - 07:03 PM, said:

View Postardera, on 01 April 2014 - 06:34 PM, said:

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.

#15 apemanzilla

  • Members
  • 1,421 posts

Posted 03 April 2014 - 03: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.

#16 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 03 April 2014 - 04:57 PM

View Postkornichen, on 01 April 2014 - 12:27 PM, said:

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





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users