Mzscript vs Lslua Thread last updated on 2006-07-08 00:40:01

Posted by member 321598 on 2006-06-21 19:30:56

So I didn't notice that another scripting language was available until after I already learned how to use mzscript. A look through some of the forums seem to imply that SOME people think lua is faster than mzscript. Is this true? And would it be worth it to re-learn lslua after already learning mzscript for whatever speed boost there may be?

Posted by member 212670 on 2006-06-21 19:56:13 link

Speed-wise, with the newest lslua, I can't tell the difference between the two. Which you should use really depends on your preference. Lslua can really simplify certain things (Cerbie's mzscript for rgb to hex vs his lslua script comes to mind), though, because of its internal functions. But, for the most part, theme's never really get complex to the point where the scripts actually needs to be using a real coding language.

I personally like lslua better now, because I like the structure/syntax better, but there's no reason to not use mzscript if that's what you're familiar with.

If you're open to relearning something, go for it, and learn lslua. Nothing wrong with learning stuff.

Posted by member 321598 on 2006-06-21 20:04:44 link

Hmm, I don't like mzscript's flexibility in terms of some of the conditional statements. Especially the lack of elseif, for loops, and some other stuff I'm thinking of right now that I'm particularly used to. If lua is more like a programming language, I'll probably have an easier time with it anyways.

Posted by member 212670 on 2006-06-21 20:47:25 link

Well, mzscript can handle loops.

For example, this in mzscript...
*Script exec !varset i 1
*Script label loop
*Script gotoif ["%{i}" = "5"] break
*Script exec !dostuff
*Script exec !varadd i 1
*Script goto loop
*Srcipt label break

is the same as this in lslua...
i = 1
repeat
lslua.exec ("!dostuff")
i = i + 1
until i == 5

or even better...
for i = 1, 5 do
lslua.exec ("!dostuff")
end

...and you can make "i" part of the iteration.

But yes, lslua is much more flexible - and a lot easier on the eyes heh.

Posted by member 321598 on 2006-06-21 21:36:59 link

Yea, you're right, but then I keep hearing people say how "bad" goto statements are (I'm no programmer, so I don't know what their logic is.) But I've gotten to the habit of avoiding it. Mzscript feels a bit basic-ish overall, which I guess can be both good and bad.

Posted by member 7223 on 2006-06-22 19:19:06 link

I've played with mzscript since many years
I've made real huge scripts
I've spent many time switching from mzscript-0.9 to 1.0 in rewriting most of my scripts

But when I've started to play with lua, I've definitively switched to it
It's a little bit more "abstract" than mz but it's really an object oriented langage
It should be part of the "GlobalSchemes" project (OTS3)
Then...

Posted by member 321598 on 2006-06-22 19:31:02 link

whoa, OTS3? where is that being developed?

Posted by member 37809 on 2006-06-22 21:36:36 link

Posted by member 212670 on 2006-06-23 05:01:18 link

Just for those interested, I was bored and did a loop speed test of mzscript vs lslua. I moved a small label 1px at a time across the screen (1600px) and back. I used a similar loop script for mzscript as above, and I used the repeat until loop for lslua. (The site wouldn't let me paste the code...you would think the code tags would let you paste things explicitly. :P )

This probably won't come as a surprise to the real coders out there, but lslua blew away mzscript. For this test, lslua was clearly faster when running its loops, showing an obvious speed increase in the label's movement.

Posted by member 321598 on 2006-06-23 10:28:09 link

Haha, well I don't need anymore convincing. I like this syntax better anyways.

I'm a bit confused about OTS, I thought OTS stood for something like Official Theme Standard, like a way to distribute themes? Is this definition too narrow? It looks like it also involves the LS build involved?

I hope the 'for' loops runs just as fast as the repeat until, because I like for loops better :-o

Posted by member 5575 on 2006-06-23 11:47:58 link

OTS is a "configuration" used to standardize theming so that contributions from many and various themers would all work compatibly "out of the box". OTS has been through two incarnations now - OTS3 will be the third. The previous theming standard was known as "Anarchy". =P

Posted by member 1949 on 2006-06-23 12:45:34 link

"Anarchy"
You can say that again boreas...

Posted by member 321598 on 2006-06-23 12:51:08 link

Any idea on what stage of development it's at?

Posted by member 212670 on 2006-06-23 13:19:18 link

Posted by member 5575 on 2006-06-23 13:55:35 link

Link whore =P

Posted by member 212670 on 2006-06-23 14:13:56 link

The links are whores or me? I'd like to be the link pimp. :D

Posted by member 5575 on 2006-06-23 14:16:09 link

Heh - you should register that domain name - link-pimp.com =)

Oops - looks like someone already did. Oh well.

Posted by member 321598 on 2006-06-23 14:46:27 link

Well I already saw that page, but it hasn't been updated since december

Posted by member 99 on 2006-07-06 19:41:46 link

mzscript is string-based assembly language.

Posted by member 321598 on 2006-07-07 11:59:57 link

What are the ramifications of that?

Posted by member 5575 on 2006-07-07 12:08:12 link

Your code can get tied in [k]nots.

Posted by member 12025 on 2006-07-07 20:39:05 link

I laughed at that. Does that mean any social hopes I had are ruined? :)

Posted by member 248213 on 2006-07-07 21:01:10 link

Yes. Yes it does.

/me contiues beating up nerds with my macho jock buddies

Posted by member 5575 on 2006-07-08 00:40:01 link

The fact that we are even posting anything here is, in itself, a pretty good sign that a so-called "normal" life is beyond our grasp. Making jokes about assembly language? Just another step down that road...