Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Language speeds?
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Drauka
(10 posts) Bio
|
Date
| Wed 01 Nov 2006 08:49 PM (UTC) |
Message
| I noticed that some people seem to be stuck on Lua and Python for scripting.
I can understand Lua as it seems to be _the_ scripting langauge of Mushclient, yet is there a speed comparison someplace? Maybe how one would be slower or faster in different situations.
Searching hasn't given me much to work with, so posting here.
Thanks in advance! | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #1 on Wed 01 Nov 2006 09:23 PM (UTC) |
Message
| Lua is embedded, while all other languages go through ActiveScripting, so where Mushclient callbacks are involved Lua will be faster than any other language. But even with ActiveScripting it's all very different. For example, Python is slower with it than Vbscript.
Other than that - depends on the language and task. This seems to be a popular, though disputed source of cross-language benchmarks: http://shootout.alioth.debian.org/ | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 01 Nov 2006 10:14 PM (UTC) |
Message
| Yes indeed, that page shows that Lua stacks up pretty well, against things like Perl, for instance. Interestingly they don't list VBscript, who knows why? Perhaps legal reasons.
Lua is slower than C++, however C++ is of course compiled and not a script language.
My personal tests have shown that Lua is acceptably fast for most applications I have wanted to use it for, even doing things like finding the fastest speedwalk path through Darkhaven, involving thousands of calculations. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Drauka
(10 posts) Bio
|
Date
| Reply #3 on Wed 01 Nov 2006 11:00 PM (UTC) Amended on Wed 01 Nov 2006 11:01 PM (UTC) by Drauka
|
Message
| Oh ok, that clears up some things. I thought they all had embedded interpreters.
I may have to refresh Lua then, I am currently writing mine in Perl... yet if anything can be prototyping for Lua.
Just was running into issues where it made it clear that I am not sharp as a tack on Lua (like trying to append to a table lookup: foo["bar"] = foo["bar"] .. "monkeys" .. "moo")
One great thing about Lua, all documentation is online and the language isn't complex (like C++, which can be a pain versus the spoiledness of scripting langauges).
note: I code for a living using about 4 different langauges in my day to day work. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 02 Nov 2006 01:36 AM (UTC) |
Message
| Yes, it is a nice language alright.
Quote:
(like trying to append to a table lookup: foo["bar"] = foo["bar"] .. "monkeys" .. "moo")
You can save a bit of typing here:
foo.bar = foo.bar .. "monkeys" .. "moo"
For string subscripts, an alternative syntax is to omit the brackets and quotes, that is equivalent to what you did.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
17,028 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top