Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: jmccay on July 25, 2005, 02:18:26 am

Title: Scripting/macro language to automate tasks & prototype new features
Post by: jmccay on July 25, 2005, 02:18:26 am
I have been considering creating a pluggin that would add scripting capabilities to codeblocks.  The idea would be able to do things like highlight a member function name and then create standard header comments with a script to produce a result like:

/******************************
FUNCTION: void MyClass::MyFunction()
PURPOSE: {cursor left here to type the purpose}
******************************/
void MyClass::MyFunction() {
//code here
};

   I have decided on two possible languages Ruby and/or Python.  Ruby because it's supposed to be easy to learn and use.  Python because IBM is throwing its weight behind it.

jmccay
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: mandrav on July 25, 2005, 08:43:30 am
I haven't seen Ruby so I don't know about it. (wxRuby)
I haven't used Python but I know it's powerful enough. (wxPython)
You might also want to add Lua as a poll option which is really lightweight and has bindings to wxWidgets (wxLua).

Yiannis.
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: Urxae on July 25, 2005, 10:21:48 am
You might also want to add Lua as a poll option which is really lightweight and has bindings to wxWidgets (wxLua).
I'd like to mention that wxRuby and wxPython are also available, just to clarify.
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: mandrav on July 25, 2005, 10:44:17 am
I'd like to mention that wxRuby and wxPython are also available, just to clarify.

Yes, sorry for not mentioning it above. Edited.

Yiannis.
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: jmccay on July 26, 2005, 03:59:19 am
I will look into Lua, but I have books on Ruby & Python.  This would definitely be a long term project.  I was thinking of using SWIG, and hiding the details of GUI environment.  I am still working on the idea and details, but here is what I was thinking.  It very basic at the moment.

   A Workspace class (say cbWorkspace) would be the main control of the projects.  You'd be able to open/create Workspaces to process.  Once a Workspace is established you can add and remove projects from the Workspace.  You can set the working project, and traverse a list (or container) of the projects.

   Once a working project is set, you can add & remove files from the project, and you can also traverse a list (container) of the files in the project.  Then you can open a file from the project into the editor.

   Here is where things are murky.  I am not sure how this will work out.

   At any time you can traverse a list (container) of the open files in the workspace.  In the current file at the top (I'm tired and can't remember the right word), you can manipulate the cursor to move it, select text, cut text, copy text, and paste text.

   That's what I am starting with at the moment.  My goal is to make it so that what ever scripting language chosen, one doesn't need to know wx{Whatever} to write a script to accomplish a task.  My goal is to make it so that the person can focus on the task they want done thinking in terms of what they want to accomplish.

   Personally, I like the idea of ruby, but I haven't been able to vote yet.  I like python just as  much--especially since IBM likes it.  I will do that later in the week when I get to a faster connection.  I have been looking for an IDE that was designed to add pluggins.  No open source IDE has this type of feature that I know.  Maybe KDE, but its not cross platform and I never figured out how to use the scripting.  I am looking forward to getting my hands wet.  I have been going through coding withdrawl. :D

jmccay

Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: jmccay on July 26, 2005, 04:00:36 am
I should note that I don't really know either language yet.  I've been somewhat following them.
jmccay
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: mandrav on July 26, 2005, 08:58:36 am
I should note that I don't really know either language yet.  I've been somewhat following them.
jmccay

I 've used none of them too, so I won't vote. My vote goes to whatever is more popular ;)

Yiannis.
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: squizzz on July 26, 2005, 12:23:10 pm
I will look into Lua, but I have books on Ruby & Python.

For Lua you can try this (http://www.lua.org/pil/) online book. It's freely available directly from Lua's website (http://lua.org).
Title: Re: Scripting/macro language to automate tasks & prototype new features
Post by: jmccay on July 27, 2005, 03:02:53 am
Cool.  I will check it out.
jmccay