Edgewall Software
Modify

Opened 18 years ago

Closed 16 years ago

Last modified 13 years ago

#667 closed enhancement (wontfix)

Tighter Win32 Integration with IronPython for Mono/.NET

Reported by: jamesm@… Owned by: Jonas Borgström
Priority: lowest Milestone:
Component: web frontend/tracd Version: devel
Severity: normal Keywords: ironpython python
Cc: mladen@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I saw this recently and thought it was interesting…

http://www.ironpython.com/

Its a Python interpreter for Mono/.NET. It may be possible to package Tracd (for example) to run on the CLR. This would be nice because it may simplify installation and may reduce the number of dependencies.

Attachments (0)

Change History (16)

comment:1 by Jonas Borgström, 18 years ago

What kind of win32 integration would you like to see?

Making Trac run on IronPython will probably require much much more work than simply making Trac easier to install on win32 platforms. IronPython currently doesn't even support standard python library modules like, os or StringIO.

comment:2 by jamesm@…, 18 years ago

Resolution: wontfix
Status: newclosed

Actually, I'm quite happy with the way things are now. I just thought I'd bring it to the team's attention to see if it may be useful. If IronPython offers nothing new/interesting then no big deal.

comment:3 by mladen@…, 16 years ago

Cc: mladen@… added
Keywords: ironpython python added
Priority: normallowest
Resolution: wontfix
Status: closedreopened
Type: defectenhancement

I'd also be interested to see how Trac run on this. They are claiming that it is at least twice as fast as normal python (see http://www.sdtimes.com/article/story-20060201-04.html). That alone could be a great feature.

Couldn't the standard python libraries just be made to run on IronPython too?

If anyone has played with this maybe you could share your experiences? If someone wants to write a little document on how to run Trac using IronPython that would also be cool as I don't really know python too well so I'm not sure where to start myself.

comment:4 by Matthew Good, 16 years ago

Resolution: wontfix
Status: reopenedclosed

Trac relies on CPython natively compiled modules for the ClearSilver and SVN libraries which prevents IronPython compatibility.

comment:5 by anonymous, 16 years ago

But if those libraries could run on ironpython, would that be a good start? Would you condider changing trac in order for it to be able to run on the .net framework?

in reply to:  5 comment:6 by Matthew Good, 16 years ago

Replying to anonymous:

But if those libraries could run on ironpython, would that be a good start? Would you condider changing trac in order for it to be able to run on the .net framework?

It's already possible to disable the SVN portions of Trac. In 0.11 ClearSilver will no longer be a dependency. It's replacement, Markup, depends on Python bytecode generation, which I don't know if IronPython supports. Trac also requires a database library, all of which currently depend on CPython.

IronPython does not provide the "md5" module which is used by Trac. It also doesn't have "zipimport" which means that you can't use zipped plugins.

So at this point it looks like there are still a number of things IronPython will need to implement before it will be possible to consider making Trac compatible with it.

comment:7 by davidf@…, 16 years ago

I don't think Markup (now Genshi) does Python bytecode generation - is there a reference to that? There are some replacement modules that I have found useful in trying to port our web framework to Python by Seo Sanghyeon - including md5, socket, pyexpat and he's even working on a dbapi using ADO.NET

in reply to:  7 ; comment:8 by Christopher Lenz, 16 years ago

Replying to davidf@sjsoft.com:

I don't think Markup (now Genshi) does Python bytecode generation - is there a reference to that?

Sure, see the genshi.eval module:

http://genshi.edgewall.org/browser/trunk/genshi/eval.py?rev=299#L154

In particular, the bytecode generation depends on the compiler module. I have no idea if that (or something equivalent) is available for IronPython.

in reply to:  8 comment:9 by Matthew Good, 16 years ago

Replying to cmlenz:

In particular, the bytecode generation depends on the compiler module. I have no idea if that (or something equivalent) is available for IronPython.

No, IronPython does not provide this module. Users interested in Python on the CLR should also look into PyPy, which is a project focused on making Python easily translatable to many runtime environments.

comment:10 by sanxiyn@…, 16 years ago

Re: jonas IronPython supports os and StringIO module now.

Re: mgood As you pointed out, ClearSilver is a C extension and can't be made to run on IronPython. I think getting Genshi run would be possible though. See below.

For SVN access, I am willing to write a VC plugin using .NET subversion libraries like NSvn.

For a database library, I have DB-API implementation backed by ADO.NET and a compatibility module for sqlite ready.

I also have md5 module using System.Security.Cryptograpy ready.

For compiler package, the package itself is pure-Python, the problem lies on parser module. PyPy project wrote a pure-Python implementation of parser module, which should run just fine on IronPython: http://codespeak.net/svn/pypy/dist/pypy/interpreter/pyparser/

Another possibility is new _ast interface in Python 2.5. (See http://genshi.edgewall.org/changeset/31) Unlike old parser interface, it looks very feasible for IronPython to implement this interface.

Bytecode generation is problematic. Naturally IronPython can't support new.code called with CPython bytecode. I am thinking about using unparse to turn that to Python source and then exec to get a code object: http://svn.python.org/projects/python/branches/p3yk/Demo/parser/unparse.py

Lots of rough ideas.

in reply to:  10 comment:11 by Matthew Good, 16 years ago

Replying to sanxiyn@gmail.com:

Another possibility is new _ast interface in Python 2.5. (See http://genshi.edgewall.org/changeset/31) Unlike old parser interface, it looks very feasible for IronPython to implement this interface.

Actually Genshi no longer uses the _ast package, but instead uses compiler.ast and compiler.pycodegen for transforming the parsed code into bytecode (both are written in Python).

Bytecode generation is problematic. Naturally IronPython can't support new.code called with CPython bytecode. I am thinking about using unparse to turn that to Python source and then exec to get a code object: http://svn.python.org/projects/python/branches/p3yk/Demo/parser/unparse.py

I guess you could also look at the compiler.pycodegen package to see if it could be rewritten for generating IronPython code objects.

comment:12 by anonymous, 16 years ago

I would suggest all ideas, suggestions, code, etc should be posted on the IronPython mailing list. The guys were a bit optimistic and there were already some good suggestions on the list. If we group all efforts together perhaps it can be done faster:

comment:13 by anonymous, 15 years ago

I too would like to see this implemented. It would mean Trac could be deployed within companies that want to standardise on the .net platform.

comment:14 by Mika, 14 years ago

I'd also love to see this.

Also check out http://fepy.sourceforge.net/

comment:15 by marcus, 14 years ago

+1 vote for reopening this ticket

comment:16 by djanosik, 13 years ago

What about now? Is it possible?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.