On Jan 7, 2008 4:25 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
Btw, I would like to work on the Python integration but still no idea how. If anyone has any experiences with that or know a good resource of documentation, feel free to post it(in a new thread please).
From what I can tell, Python's not too difficult to embed. Lua, though, seems to take to embedding like a fish to water. And it's small. And *fast* (check out this neat little benchmark http://www.timestretch.com/FractalBenchmark.html ). One note about Python: they're in the middle of a transition at the moment. Their newest version ("Python 3000") has just had its 2nd alpha release.
Anyhow, a while ago I posted that I was waiting for Python support for Geany. I should probably take that back. Really, most of these commonly-used scripting languages are very similar except for syntax differences. There's variables, loops, functions, and so on. Python makes OO programming very easy, but I'm not sure how much OO features are really required for writing an average plug-in for a text editor.
Enrico, have you tried writing any plug-ins in Lua yet? I may try to take a crack at it this week.
---John
On Mon, 7 Jan 2008 20:24:24 -0500, "John Gabriele" jmg3000@gmail.com wrote:
Anyhow, a while ago I posted that I was waiting for Python support for Geany. I should probably take that back. Really, most of these commonly-used scripting languages are very similar except for syntax differences. There's variables, loops, functions, and so on. Python makes OO programming very easy, but I'm not sure how much OO features are really required for writing an average plug-in for a text editor.
Well, I think this is not the question. My intention to add a Python interface was to make it possible that users can write their plugins in Python, whatever and however these plugins will do.
Enrico, have you tried writing any plug-ins in Lua yet? I may try to
To be honest: no. For me it's easier(basically, exceptions may exist ;-)) to write some code in C/GTK than in Lua because for writing something in Lua I had to learn it before, C/GTK I know well enough to get some code working ;-).
A python interface probably won't provide many advantages via the Lua interface but I guess there are many people who prefer to write Python code because it's widely spread.
Regards, Enrico
On Mon, 7 Jan 2008 20:24:24 -0500 "John Gabriele" jmg3000@gmail.com wrote:
From what I can tell, Python's not too difficult to embed. Lua, though, seems to take to embedding like a fish to water. And it's small. And *fast* (check out this neat little benchmark http://www.timestretch.com/FractalBenchmark.html ). One note about
I think Lua scripting is a great match for Geany. Lua also seems to be the fastest scripting language here (basic is compiled):
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&am...
Note: I enabled memory usage as part of the criteria, but even without it Lua comes out very well vs. other scripting languages.
[...]
Anyhow, a while ago I posted that I was waiting for Python support for Geany. I should probably take that back. Really, most of these commonly-used scripting languages are very similar except for syntax differences. There's variables, loops, functions, and so on. Python makes OO programming very easy, but I'm not sure how much OO features are really required for writing an average plug-in for a text editor.
I know someone who says you can simulate OOP fairly acceptably in Lua (but haven't tried it myself). Link: http://www.lua.org/pil/16.1.html
Enrico, have you tried writing any plug-ins in Lua yet? I may try to take a crack at it this week.
I haven't written any yet, but I've been meaning to. (Personally it'd be better for me if the Lua plugin was distributed with Geany because then it would get rebuilt automatically each time we change the plugin abi version - but for most users this isn't a problem).
Regards, Nick
Hi
Lua have very small footprint (compared to other scripting languages). If geany include it like scintilla it will not gain too much fat.
This will allow to distribute lua plugin within geany and don't add more libraries to depend list.
Best regards, Yura Siamashka
2008/1/9, Nick Treleaven nick.treleaven@btinternet.com:
On Mon, 7 Jan 2008 20:24:24 -0500 "John Gabriele" jmg3000@gmail.com wrote:
From what I can tell, Python's not too difficult to embed. Lua, though, seems to take to embedding like a fish to water. And it's small. And *fast* (check out this neat little benchmark http://www.timestretch.com/FractalBenchmark.html ). One note about
I think Lua scripting is a great match for Geany. Lua also seems to be the fastest scripting language here (basic is compiled):
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&am...
Note: I enabled memory usage as part of the criteria, but even without it Lua comes out very well vs. other scripting languages.
[...]
Anyhow, a while ago I posted that I was waiting for Python support for Geany. I should probably take that back. Really, most of these commonly-used scripting languages are very similar except for syntax differences. There's variables, loops, functions, and so on. Python makes OO programming very easy, but I'm not sure how much OO features are really required for writing an average plug-in for a text editor.
I know someone who says you can simulate OOP fairly acceptably in Lua (but haven't tried it myself). Link: http://www.lua.org/pil/16.1.html
Enrico, have you tried writing any plug-ins in Lua yet? I may try to take a crack at it this week.
I haven't written any yet, but I've been meaning to. (Personally it'd be better for me if the Lua plugin was distributed with Geany because then it would get rebuilt automatically each time we change the plugin abi version - but for most users this isn't a problem).
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On Wed, 9 Jan 2008 16:42:51 +0200 "Yura Siamashka" yurand2@gmail.com wrote:
2008/1/9, Nick Treleaven nick.treleaven@btinternet.com:
I haven't written any yet, but I've been meaning to. (Personally it'd be better for me if the Lua plugin was distributed with Geany because then it would get rebuilt automatically each time we change the plugin abi version - but for most users this isn't a problem).
Lua have very small footprint (compared to other scripting languages). If geany include it like scintilla it will not gain too much fat.
This will allow to distribute lua plugin within geany and don't add more libraries to depend list.
I don't like this idea, it adds extra maintenance, and isn't really necessary. If the Lua plugin was distributed with Geany, Lua can be an optional dependency - probably we could disable building of geanylua if there were no lua headers found when running ./configure.
Distros could then package geany-lua-plugin as a separate package.
Anyway, I'm not sure if everyone wants to do this, maybe not ;-)
Regards, Nick
On Wed, 9 Jan 2008 17:13:21 +0000, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Wed, 9 Jan 2008 16:42:51 +0200 "Yura Siamashka" yurand2@gmail.com wrote:
2008/1/9, Nick Treleaven nick.treleaven@btinternet.com:
I haven't written any yet, but I've been meaning to. (Personally it'd be better for me if the Lua plugin was distributed with Geany because then it would get rebuilt automatically each time we change the plugin abi version - but for most users this isn't a problem).
Lua have very small footprint (compared to other scripting languages). If geany include it like scintilla it will not gain too much fat.
This will allow to distribute lua plugin within geany and don't add more libraries to depend list.
I don't like this idea, it adds extra maintenance, and isn't really necessary. If the Lua plugin was distributed with Geany, Lua can be an optional dependency - probably we could disable building of geanylua if there were no lua headers found when running ./configure.
Distros could then package geany-lua-plugin as a separate package.
Anyway, I'm not sure if everyone wants to do this, maybe not ;-)
I'd be fine with that. Especially the idea of only enabling to build/install it when Lua headers are found is great.
It's up to Jeff now ;-).
Regards, Enrico
On Jan 10, 2008 2:29 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
On Wed, 9 Jan 2008 17:13:21 +0000, Nick Treleaven nick.treleaven@btinternet.com wrote:
If the Lua plugin was distributed with Geany, Lua can be an optional dependency - probably we could disable building of geanylua if there were no lua headers found when running ./configure. Distros could then package geany-lua-plugin as a separate package. Anyway, I'm not sure if everyone wants to do this, maybe not ;-)
I'd be fine with that. Especially the idea of only enabling to build/install it when Lua headers are found is great.
It's up to Jeff now ;-).
Sounds good to me!
A few minor issues come to mind:
* The code is formatted a bit differently than the Geany "standard". I am mostly accustomed to using a two-space indent and although I used tabs for the geanylua code, my tab width is set at two, so the code looks pretty bad if you look at with tabwidth=4.
* There are a few other differences in our coding styles. For me, if something is NULL then it's false, so you won't find a lot of "if (something != NULL)" in my code it's just "if (something)". I also tend to use *lots* of parenthesis instead of depending on operator precedence. (I guess you could call me "algebraically challenged" :-)
* The documentation is hand edited HTML, I tried to make it look similar to the Lua docs, I'm not sure how well it would "fit" with the Geany docs.
So if you are asking me to maintain the geanylua code from inside the Geany codebase, I would like to preserve these little formatting idiosyncrasies. Of course, the code is GPL, so if you'd rather just maintain it yourself you are certainly free to change it any way you please. ;-)
Also, there is no Win32 makefile for geanylua. The windows build uses autotools just like the rest. I know there are good and bad points to both approaches, but IMO the main purpose of autotools is to provide cross platform support.
I guess either approach will work, but I imagine that using both methods within the same source tree might cause some problems.
Having said all that, I think there are also some big advantages to having the two projects more closely integrated. There is a horrible kludge in my configure.in file that tries to guess the Geany version and installation directories using --version and --print-prefix. I would really love to able to rip that crap out completely and just let Geany decide where to install the plugin. I am also having a terrible time trying to load third-party modules into Lua, and I think *possibly* there might be a way to solve the problem by passing some extra flags to the linker when Geany is built to support Lua.
I'm sure there will still be some other points to work out, but nothing we can't handle...
- Jeff
On Thu, 10 Jan 2008 17:04:03 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
[integrate GeanyLua into Geany] A few minor issues come to mind:
- The code is formatted a bit differently than the Geany "standard". I am mostly accustomed to using a two-space indent and although I used tabs for the geanylua code, my tab width is set at two, so the code looks pretty bad if you look at with tabwidth=4.
No problem for me.
- There are a few other differences in our coding styles. For me, if something is NULL then it's false, so you won't find a lot of "if (something != NULL)" in my code it's just "if (something)". I also tend to use *lots* of
Most people do this, but for some reason I personally don't like it very much. I can't really give a concrete reason, that's just the way it is. But it really doesn't matter.
- The documentation is hand edited HTML, I tried to make it look similar to the Lua docs, I'm not sure how well it would "fit" with the Geany docs.
Does it have to? Ok, it would be nice if all docs would look like the same but either we play a bit with the CSS or we just skip it. The most important thing is that docs exist and are usuable. The look is a secondary goal, IMO.
Also, there is no Win32 makefile for geanylua. The windows build uses autotools just like the rest. I know there are good and bad points to both approaches, but IMO the main purpose of autotools is to provide cross platform support.
I'm interested in how to use the autotools on Windows? Is there any way to use them without cygwin?
Having said all that, I think there are also some big advantages to having the two projects more closely integrated. There is a horrible kludge in my configure.in
Without any doubt.
I'm sure there will still be some other points to work out, but nothing we can't handle...
E.g. whether to wait until after the next release or to push it immediately into it.
Regards, Enrico
On Jan 11, 2008 7:55 AM, Enrico Tröger enrico.troeger@uvena.de wrote:
On Thu, 10 Jan 2008 17:04:03 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
For me, if something is NULL then it's false, so you won't find a lot of "if (something != NULL)" in my code it's just "if (something)".
Most people do this, but for some reason I personally don't like it very much. I can't really give a concrete reason, that's just the way it is.
You are certainly not alone, some projects *insist* on using the explicit ==NULL or !=NULL, so I just wanted to make sure.
{ Completely off-topic, but there is a big "gotcha" in Lua, zero is considered a valid number and evaluates to TRUE. e.g. if(not N) and if(N==0) mean two different things. }
- The documentation is hand edited HTML, I tried to make it look similar to the Lua docs, I'm not sure how well it would "fit" with the Geany docs.
Does it have to? Ok, it would be nice if all docs would look like the same but either we play a bit with the CSS or we just skip it. The most important thing is that docs exist and are usuable.
I say we just don't worry about it. Most beginning script writers will probably be bouncing mostly between the geanylua docs and the Lua docs anyway, at least that was my reasoning.
I'm interested in how to use the autotools on Windows? Is there any way to use them without cygwin?
I ran the "bootstrap" autotools setup for geanylua on SuSE, but the resulting ./configure script worked for me with mingw-cross for Linux, and mingw+msys on win98 and Win2k.
The main problem I ran into is that libtool complains about undefined references and refuses to build the DLL. But it doesn't generate an error, so I added a target to call the linker on its own which seems to work fine. The catch there is that you have build the target explicitly by saying "make win32"
You can search "mingw" in my "configure.in" to get a general idea of what I did, but of course, Geany is a lot more complex project, so your mileage may vary.
I'm sure there will still be some other points to work out, but nothing we can't handle...
E.g. whether to wait until after the next release or to push it immediately into it.
I have some bug fixes and a couple of new features that I haven't released yet. I'll try to give the code one more good cleanup and then upload it to my site in the next couple of days. After that you can decide when you want to perform the transplant surgery.
- Jeff
On Fri, 11 Jan 2008 16:05:54 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
On Jan 11, 2008 7:55 AM, Enrico Tröger enrico.troeger@uvena.de wrote:
On Thu, 10 Jan 2008 17:04:03 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
For me, if something is NULL then it's false, so you won't find a lot of "if (something != NULL)" in my code it's just "if (something)".
Most people do this, but for some reason I personally don't like it very much. I can't really give a concrete reason, that's just the way it is.
You are certainly not alone, some projects *insist* on using the explicit ==NULL or !=NULL, so I just wanted to make sure.
{ Completely off-topic, but there is a big "gotcha" in Lua, zero is considered a valid number and evaluates to TRUE. e.g. if(not N) and if(N==0) mean two different things. }
Interesting. I'm not completely sure but I believe to remember in Pascal it is similar. If so, this might be a reason for my preference to use the explicit "!= NULL" because my first programming attempts were with Pascal ;-). There is another little, though not really important, advantage of the explicit "!= NULL": you can see the type of the checked variable more easily. E.g.
char *data = "asdasd"; ... (many lines of code) ... if (data)
Then you have to know data is a pointer of char, or scroll back to look at it. With "if (data != NULL)" you know, it is a pointer type and not an integer or something similar. But again, this is not really important. Better to write code where you don't have to scroll back so far that it matters ;-). Or just use variable names which indicate the type like data_ptr but this I personally don't like even more, hehe.
- The documentation is hand edited HTML, I tried to make it look similar to the Lua docs, I'm not sure how well it would "fit" with the Geany docs.
Does it have to? Ok, it would be nice if all docs would look like the same but either we play a bit with the CSS or we just skip it. The most important thing is that docs exist and are usuable.
I say we just don't worry about it. Most beginning script writers will probably be bouncing mostly between the geanylua docs and the Lua docs anyway, at least that was my reasoning.
I don't think this is a really big problem. Maybe we can discuss/solve it later.
I'm interested in how to use the autotools on Windows? Is there any way to use them without cygwin?
I ran the "bootstrap" autotools setup for geanylua on SuSE, but the resulting ./configure script worked for me with mingw-cross for Linux, and mingw+msys on win98 and Win2k.
The main problem I ran into is that libtool complains about undefined references and refuses to build the DLL. But it doesn't generate an error, so I added a target to call the linker on its own which seems to work fine. The catch there is that you have build the target explicitly by saying "make win32"
You can search "mingw" in my "configure.in" to get a general idea of what I did, but of course, Geany is a lot more complex project, so your mileage may vary.
Thanks for the info. I'll have a look at it.
I'm sure there will still be some other points to work out, but nothing we can't handle...
E.g. whether to wait until after the next release or to push it immediately into it.
I have some bug fixes and a couple of new features that I haven't released yet. I'll try to give the code one more good cleanup and then upload it to my site in the next couple of days. After that you can decide when you want to perform the transplant surgery.
We? Nick and me already stated we would be happy with merging.
Regards, Enrico