mzscript vs. lslua Thread last updated on 2006-09-14 00:47:33

Posted by member 316614 on 2006-09-08 14:07:07

Con anybody give me a hint as to whether switching to lslua is worthwhile?

I am a semi-noob in regards to programming and for extremely arcane and complicated reasons (laziness/ignorance) prefer to use a combination of mzscript, lsmath and ckdialog over actually compiling GUIs and modules. This is a lot of fun to me and like every propper geek I am exultet like a freshly baked father every time I come up with some lil gadget. However, I feel that there are some annoyances and limitations in this combination of methods. I was wondering whether lslua would help better some of these.

Can I use recusion in lslua? Every time I try this in mzscript I shoot litestep badly and I am beginning to think it is simply not possible.

Is the lua syntax as forgiving as mzscript? Or at least not as pedantic as ckdialog?

Can lslua handle basic algebra as easily as a mzscript+lsmath?

Thanks in advance and sorry if my questions are stupid and/or trivial.

Posted by member 5575 on 2006-09-08 14:38:27 link

Lua is a much more "developed" scripting language than mzscript. As far as math and/or string manipulation goes, it's far superior. It also will give you a better idea of where (and what) your errors are as you develop new scripts. Look at the stuff that smurth has done (in the Code section of the forum here) for some examples.

Posted by member 316614 on 2006-09-08 15:18:52 link

Thanks for the advise (completely overlooked his post before), the syntax does indeed look easy and clear in his examples. I will definitely try it out now.

Posted by member 248213 on 2006-09-08 18:16:26 link

You'll still need ckdialog though.

Posted by member 7223 on 2006-09-09 12:20:03 link

Lua is a real object-oriented langage. Try it

Posted by member 37809 on 2006-09-12 15:43:29 link

Lua isn't truly object-oriented, but it has mechanisms in place that can allow for OOP constructs.

See also,
http://wiki.litestep.com/Modules:LSLua
http://wiki.litestep.com/Modules:LSLua:Code

Posted by member 7223 on 2006-09-14 00:47:33 link

Lua is a real object-oriented langage (but not in C++ words). You should try it :)

With a little amount of attention, very robust code can be write.
If you've been cool enough to play with ckdialog without breaking something, you should have no doubt about your ability to speak in lua.

Lua introduce you to a new world. You'll be able to do things you've never even thought about. It can take some time to go deep inside the philisophy of lua, but you can start to write some basic practical but working scripts, right now.

In practical words:
- you can do recursion if your code is not buggy ,
- you can do math, string, table, function manipulation easily (everything is an object) ,
- you can use lua to replace some litestep modules: textedit, scandir, filemaster, lsxcommand (need xLabel) ,
- you can use some functions I've made that missed when I came from mzScript's world: !Exec, !If, *start

I'm currently making a Lua's toolbox for Litestep that really could help to play with lua, if you're interested.