Quick question regarding scripting languages.
-
- Posts: 1
- Joined: Sat May 30, 2009 11:56 pm
Quick question regarding scripting languages.
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?
Re: Quick question regarding scripting languages.
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.
Re: Quick question regarding scripting languages.
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.
-
- Posts: 13
- Joined: Fri May 15, 2009 12:52 pm
Re: Quick question regarding scripting languages.
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.
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??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.
Re: Quick question regarding scripting languages.
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.
Re: Quick question regarding scripting languages.
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!
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!
Re: Quick question regarding scripting languages.
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.
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.
Re: Quick question regarding scripting languages.
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.
Re: Quick question regarding scripting languages.
I changed nano python.prf to be 2.7 (because that's what Ubuntu 11.04 uses), but it's not compiling:
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.$ 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