New scripting language

Official forum for open source FreePIE discussion and development.
User avatar
mahler
Sharp Eyed Eagle!
Posts: 401
Joined: Tue Aug 21, 2012 6:51 am

Re: New scripting language

Post by mahler »

CyberRascal wrote:Also, mahler: What do you think about using Python?
Anyone else have any comments? I'd rather not force something like this onto anyone :p
No problem here with python. I had to learn it for a project this year.
Using indentations instead of brackets was annoying at first, but after a while I started to appreciate it.
For the rest the language syntax is very simple and short.

Code: Select all

words = ['cat', 'window', 'defenestrate']
for w in words:
    print w, len(w)
CyberRascal wrote:We are almost there, but we lack two major things - syntax highlighting and code completion.
Hopefully we can get working syntax highlighting from somewhere soon, but code completion might be harder. I will look around a bit for a compatible lexer for python.
This seems like a good one...
http://scintillanet.codeplex.com/
CyberRascal
Two Eyed Hopeful
Posts: 74
Joined: Fri Sep 21, 2012 4:46 am

Re: New scripting language

Post by CyberRascal »

Thanks for the input mahler. Sounds like python could be the way to go. It doesn't support multiline lambdas though (for event handlers), but if you understand enough to use that feature it's probably not a large leap to using

Code: Select all

def transmogrify(x, y):
    return x *= y

myPlugin.update += transmogrify
About scintilla. It's a full-size editor, and it uses GTK+ to render itself. As far as I remember, GTK+ doesn't support "native look and feel" (being cross platform). We could have used scintilla, but it's probably geared more towards winforms (don't know how well GTK+ meshes with winforms though), plus issues with fonts, rendering etc that comes with the cross-platformness.

I remember looking for a C++ editor, and I pretty much ruled out any editor based on scintilla, for reasons I can't remember right now but which probably relates to... Something. I went with Emacs instead.

Anyway, we are looking for a lexer, not a editor, because I don't think CyberVillain will be that enthusiastic towards redoing all the editor stuff.

I could refit the current (not very well functioning) CC to python. Is anyone using it though? :D And not just because it's forced upon you?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: New scripting language

Post by CyberVillain »

I'm using it :D I'm mostly missing argument completion when defining a function call, and some small bugs with the CC window stealing navigation from the editor. But on the whole its pretty ok, way better than GlovePie's CC

edit: I also ruled out Scintilla over AvalonEdit for reasons I do not remember, but one was probably that its winforms which clashes with WPF (You can invoke it but its a bit ugly, and doesnt work that nice). However I think Avalon is using Win32 under the hood because you get the same strange behavior like you get when using winform controls in WPF.
CyberRascal
Two Eyed Hopeful
Posts: 74
Joined: Fri Sep 21, 2012 4:46 am

Re: New scripting language

Post by CyberRascal »

So, the ironpython branch pretty much just went gold, it's pushed to my master as of now. Lua is removed completely from my master (barring mistakes, and a few C# types named after Lua).

Brantlew, I had to make a few changes to the console project to make it build. Instead of using LuaScriptEngine directly, it now uses IScriptEngine, so we don't have to touch it if we change engine again. I made two alterations as a bit of cleanup as well, I changed the Enumerator related code to just simply fetch the item directly. I hope you find it acceptable :)

Anyway, I haven't been able to make it crash, but I suspect as soon as the next guy/gal tests it it will crash happily. So please try it out, so we can work these kind of things out.

The code is available at https://github.com/maxmalmgren/FreePIE/
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: New scripting language

Post by brantlew »

Sounds awesome! Looking forward to using it. I guess we will need to update many of the scripts that are listed in the forum.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: New scripting language

Post by CyberVillain »

brantlew wrote:Sounds awesome! Looking forward to using it. I guess we will need to update many of the scripts that are listed in the forum.
I tested it yesterday, no crashes or slowdowns. Yeah, we need to update the Wiki too and some other places. Not a problem thought. I hope the users will take the change without problems, its a pretty big braking change.
Post Reply

Return to “FreePIE”