IronPython support

126 views
Skip to first unread message

Derek

unread,
Apr 3, 2015, 6:21:58 PM4/3/15
to web...@googlegroups.com
I tried loading the latest Web2Py in IronPython but I hit a few snags. I've changed the driver module loader to check for an additional error type which gets past the db drivers loader, and now it seems to stop on the rocket.py with some error about a string expected but got int instead. In any case, hopefully the patches I provided allow those of you who use IronPython to enjoy using pyDAL. 

If anyone has gotten Web2Py working with IronPython, I'd like to hear your experiences, so hopefully I can create a pull request to get fixes for it in mainline.

My experience has been that with the patches to pyDAL, I can run using the anyserver.py script like so:

ipy.exe anyserver.py -s wsgiref -i 127.0.0.1 -p 3000

now, in order to access admin, I need to create a parameters_3000.py with a password in it. The only line is this:
password='25d55ad283aa400af464c76d713c07ad'

Don't worry, I'm not sharing my super secret password. This is just 12345678.

With that set, I get a ticket on startup... apparently I have to create a 'sql.log' file in applications\admin\databases. And in 'examples'...

Examples seemed to work after that, Admin works, Welcome doesn't for some strange reason...

Traceback (most recent call last):
File "E:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
File "E:/web2py/applications/welcome/models/db.py", line 58, in <module>
plugins = PluginManager()
File "E:\web2py\gluon\tools.py", line 5318, in __init__
self.__dict__.clear()
File "E:\web2py\gluon\tools.py", line 5330, in __getattr__
TypeError: Value cannot be null.

Parameter name: key
I tried to modify that tools.py and so the line numbers will be off slightly (I added a few to debug). It's a work in progress... but, it's very encouraging.

Thanks,
Derek Wilson

Massimo Di Pierro

unread,
Apr 3, 2015, 11:39:31 PM4/3/15
to web...@googlegroups.com
Just curious. Why using IronPython? What are the pros?

Derek

unread,
Apr 6, 2015, 11:58:48 AM4/6/15
to web...@googlegroups.com
It doesn't have a GIL, plus it has a good JIT and I know Web2Py works on PyPy, so it seems like a good fit. It does run pretty fast. If you have any benchmarks you want me to run I'll give them a try.
I think Windows users should have a choice of what python interpreter they want to use. It does allow you to use .net libraries in IronPython. So instead of only supporting C extensions, I could use a C# extension to IronPython.

Richard Vézina

unread,
Aug 27, 2015, 3:45:16 PM8/27/15
to web2py-users
I could be interresting in IronPython from a compliance stand point, even if it doesn't change anything, manager may be less anxious with ms crap...

:)

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Vézina

unread,
Aug 27, 2015, 4:05:45 PM8/27/15
to web2py-users
Derek, where is the gain come with PyPy? Just loading the welcome index, CPython I get a steady 20 ms and PyPy 50-75 ms with a simple page load and relaod test with chrome dev tool...

Richard

Derek

unread,
Aug 27, 2015, 6:09:11 PM8/27/15
to web2py-users
It gains on complex templated pages, mainly. If you are just accessing databases, you won't get speed increases. If your server is CPU overloaded, switching to PyPy will benefit.

Richard Vézina

unread,
Aug 31, 2015, 11:27:15 AM8/31/15
to web2py-users
Thanks for explain that, does web2py rows processing (dict init, etc.) get speed up when you render a lot of records?

Richard

Richard Vézina

unread,
Aug 31, 2015, 11:28:49 AM8/31/15
to web2py-users
Do you have a step by step migration to PyPy tutorial... I try PyPy, but it failed over import of module like os.

Thanks

Richard

Derek

unread,
Aug 31, 2015, 4:16:02 PM8/31/15
to web2py-users
When I tried it, I didn't have those issues. If you don't have an 'os' module, you can't even run pypy from the command line. You should re-install pypy and try again.
Reply all
Reply to author
Forward
0 new messages