[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Language speeds?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Language speeds?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Drauka   (10 posts)  [Biography] 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!
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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/
[Go to top] top

Posted by Nick Gammon   Australia  (21,610 posts)  [Biography] 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
[Go to top] top

Posted by Drauka   (10 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,610 posts)  [Biography] 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
[Go to top] 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.


4,771 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]