Saturday, July 04, 2009

Another IDE for IronPython? Eclipse and PyDev

A common question with IronPython is which IDE to use. Many .NET developers will immediately look for IronPython integration with Visual Studio but there are much better options.

Up until now the front runner has been SharpDevelop with debugger, Windows Forms designer and even C# to IronPython translation. Other viable alternatives are Wing IDE and Netbeans.

Another alternative has just arrived - and it is an unexpected one: Eclipse, through the PyDev extensions. The features it supports for IronPython are impressive.
One of the major features in this release is the IronPython integration. Note that it requires IronPython 2.6 (earlier versions are not supported because of the lack of sys._getframe()).

In that integration, code-completion should be working for the .NET libraries and other dlls. For the .NET libraries, just make sure that the library you're using is listed in the forced builtins -- I believe all libraries should be there already, but it could be that some default library is missing.

To use code-completion for other libraries, the code must be compiled as a dll (because Pydev does not recognize C# nor VB) and that dll must have the exact same name of the namespace it contains (e.g.: if you want to do "import iTextSharp", the dll must be named iTextSharp.dll -- the case of the file important there) and the folder containing that dll must be added as a source folder (or external source folder) -- which is the same thing for python compiled extensions.

Most features should be working fine with IronPython, with the most notable exception being that the debugger is not supported (that's because in this version, IronPython still doesn't provide sys.settrace(), so, there's no API to work on for python debugging).
So it looks like the new frame support in IronPython 2.6 are already paying off in improved tools. Once sys.settrace is implemented (coming soon) the story will get even better.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.