Quick question regarding scripting languages.

Gorlasintan
Posts: 1
Joined: Sat May 30, 2009 11:56 pm

Quick question regarding scripting languages.

Post by Gorlasintan »

Is there an estimated timetable for when Mudlet will begin to support scripting languages besides Lua, or is there some way to do this already? The documentation says that it will be possible, but looking through the forums, I haven't seen anything indicating that it will happen before the 1.0 (or even 2.0) release of the client. Specifically, I'm looking for Python, but I also know people who also use Perl. So, is this still planned, or has it been aborted/put off?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Quick question regarding scripting languages.

Post by Heiko »

I will not build support for any other scripting languages because Lua is the fastest scripting language there is at this point. Python or Perl wouldn't improve anything except making things slower and being more difficult to package in a cross platfom way. Anybody can learn how to program in Lua within 5 minutes - yes, it's that easy to learn.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Quick question regarding scripting languages.

Post by Heiko »

That said, if somebody steps up and offers to develop support for Python or Perl I would support him and help him if necessary. It is not difficult and the Lua implementation can be used as a blueprint. However, it definitely does take a fair bit of work.

FormerZmudUser
Posts: 13
Joined: Fri May 15, 2009 12:52 pm

Re: Quick question regarding scripting languages.

Post by FormerZmudUser »

Lua > all.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Quick question regarding scripting languages.

Post by Rakon »

This is a bit late, however if the above post by Heiko is still valid regarding 'no languages but lua', then the mudlet.org/about page needs to be changed.
Powerful Scripting
Mudlet will feature a scripting framework, into which initially Lua will be “plugged in” and be used. While this certainly isn’t exactly a new innovation, at least we won’t be taking a step back by creating a home-made scripting language. It would additionally be able to support many more languages right inside the client, like Python, Perl, Ruby and Javascript. We’ll also make use of the Scintilla editor to provide syntax highlighting and other nice things like zooming on the text.
I'd still love to see support for python/activepython. What is the actual process behind getting support for it coded in?? Would all functions available to lua have to be re-written for python, or just hooked into the C code calling the same??

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Quick question regarding scripting languages.

Post by Vadi »

Thanks, I'll update that. It'll be the latter process, but besides the lack of manpower, the other reasons for not adding additional languages was a) splitting the community - help, scripts, etc... b) install size - Lua is tiny, other languages can be bigger than Mudlet itself... there's also the lack of data sharing between different languages, and a variable server isn't really awesome at all.

Aico
Posts: 27
Joined: Wed Jan 20, 2010 3:46 pm

Re: Quick question regarding scripting languages.

Post by Aico »

In case anyone is still interested in this, I've added python scripting to mudlet. My main motivation for doing this was to access some nlp packages for more involved text processing that Lua lacks.

The GIT remote: git@github.com:Aico/mudlet.git

Features:
- stdout and error redirection to main console.
- gmcp, atcp and channel102.
- can turn Python on/off in Settings. (default is off so you must turn on for python to work)

Currently added Lua equivalent functions:
Communications: send, expandAlias
Selection: selectString, selectCaptureGroup, selectSection
Color: bg, fg, setBgColor, setFgColor
Edit: replace, replaceAll, deleteLine
Enable/Disable functions.
Event: raiseEvent
Variables: matches and multimatches

Instructions for compiling on Ubuntu can be found in the COMPILE-UBUNTU file. I have not tried compiling on windows or mac since I use neither at home, but apart from the python dependencies, the rest should be the same as how you would normally compile mudlet.

I hope there will be those who will find benefit using this. Feedback is most welcomed!

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Quick question regarding scripting languages.

Post by Heiko »

Nice work. A few comments:
1. Your git repo must be based on the main git repo on sf.net. Keep the master branch in synch with main git and do your work in a python branch to keep it in sync with the sf.net master. Otherwise it's too complicated to merge your code when it's ready as it will eventually affect a large number of files.

2. Move the script language selection to a per object basis -> main object template tree.h
For peformance reasons change the if scriptinglanguage == "PYTHON" to #define SCRIPTENGINE_LUA 1; #define SCRIPTENGINE_PYTHON 2, store the integer in the object and when an object's script is called use the script engine on the basis of the object's script engine.

Aico
Posts: 27
Joined: Wed Jan 20, 2010 3:46 pm

Re: Quick question regarding scripting languages.

Post by Aico »

Thanks for your feedback. If I sync with sourceforge main, is there anyway I could upload my branch like I currently do with github? Ideally I would like to keep my code backed up and easily accessible.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Quick question regarding scripting languages.

Post by Vadi »

I changed nano python.prf to be 2.7 (because that's what Ubuntu 11.04 uses), but it's not compiling:
$ qmake
$ make
cd src/pythonqt/ && /usr/bin/qmake /home/vadi/Programs/Mudlet2/mudlet-python/src/pythonqt/pythonqt.pro -o Makefile
Cannot find file: /home/vadi/Programs/Mudlet2/mudlet-python/src/pythonqt/pythonqt.pro.
make: *** [src/pythonqt//Makefile] Error 2
My opinion is still that I'd rather keep it to a single language, so we don't get into the mess that cmud and mushclient have.

Post Reply