IronPython on Mono howto

S

sanxiyn

Skip wrote:
For those of us who have never used IronPython or Mono, is there a
quick start document laying about somewhere? It wasn't clear to me
where to even look.

Okay, here we go:

1. Download IronPython

Go to http://www.codeplex.com/IronPython. Click Releases tab. Click
IronPython-1.0-Bin.zip or IronPython-1.0-Src.zip. You need to agree to
the license. Read it if you haven't.

2. Download Mono

Go to http://www.mono-project.com/. Click "download now" icon
(topright). DO NOT DOWNLOAD 1.1.13, IT WON'T WORK. Download according
to your platform and install in the usual way. If you are using Debian
Unstable like me, apt-get install mono is enough. For Linux users not
covered, but using x86 architecture, I highly recommend "Linux
Installer for x86 (All distributions)" download. It's a graphical
installer, can be installed under your home directory not to distrub
package managers, and uninstalls cleanly.

3. Run (Binary case)

Unzip IronPython-1.0-Bin.zip. It unzips to IronPython-1.0 directory.
Change to it. Run "mono ipy.exe". Make sure mono --version shows the
version you installed; you may have non-working (for IronPython) 1.1.13
already installed on your system. You will see:

IronPython 1.0.60816 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
4. Compile and Run (Source case)

Unzip IronPython-1.0-Src.zip. It unzips to IronPython-1.0 directory.
Change to it. Change to Src directory under it. Edit makefile.

1) Change "CSC=csc" to "CSC=gmcs".
2) Change "mkdir ..." to "mkdir -p".

Make. "Compilation succeeded". Change to the parent directory and you
will see newly compiled ipy.exe and DLLs. Run as in 3.

Seo Sanghyeon
 
N

Nick Craig-Wood

Okay, here we go:
[snip]

Thanks for those good instructions - they worked well!

I tried running a test program under mono/linux.

I found I needed to add

import sys
sys.path.append("/usr/lib/python2.4")

As per the FAQ to the code. Setting this in an environment var would
be nice but I didn't find one.

The code then ran fine. (Its a test suite for my sudoku solver.)

$ mono ipy.exe ~/Python/sudoku.py -t
...........
----------------------------------------------------------------------
Ran 11 tests in 5.533s

Compared to

$ python2.4 ~/Python/sudoku.py -t
...........
----------------------------------------------------------------------
Ran 11 tests in 1.637s

It seems to take about a second to start IronPython vs ~15 ms for
Python2.4, eg

$ time mono ipy.exe -c pass

real 0m1.034s
user 0m1.000s
sys 0m0.036s

$ time python2.4 -c pass

real 0m0.015s
user 0m0.008s
sys 0m0.007s

Over all I'm very impressed - it is great to have a new implemention
of Python. I'm not sure mono is showing it off to its full extent
though!
 
S

skip

sanxiyn> For those of us who have never used IronPython or Mono, is
sanxiyn> there a quick start document laying about somewhere? It wasn't
sanxiyn> clear to me where to even look.

sanxiyn> Okay, here we go:
...

Thanks. Worked like a charm. Like others I noticed the apparent
performance drop. I presume that's more a comment on the state of
optimization in Mono than on IronPython itself.

One thing I did find especially annoying though was that none of the editing
keys worked. DELETE, BACKSPACE, Ctrl-U. All just inserted themselves.
Ctrl-D didn't exit. (I had to "raise SystemExit" to exit.)

Is this a known problem? Is it a Mono thing or an IronPython thing? Any
workaround?

Thx,

Skip
 
M

Marc 'BlackJack' Rintsch

One thing I did find especially annoying though was that none of the editing
keys worked. DELETE, BACKSPACE, Ctrl-U. All just inserted themselves.
Ctrl-D didn't exit. (I had to "raise SystemExit" to exit.)

Is this a known problem? Is it a Mono thing or an IronPython thing? Any
workaround?

The `boo` shell and the `Nemerle` shell can be quit with Ctrl-D under
Mono, so I guess it's an `IronPython` thing.

Ciao,
Marc 'BlackJack' Rintsch
 
S

sanxiyn

One thing I did find especially annoying though was that none of the editing
keys worked. DELETE, BACKSPACE, Ctrl-U. All just inserted themselves.
Ctrl-D didn't exit. (I had to "raise SystemExit" to exit.)

Is this a known problem? Is it a Mono thing or an IronPython thing? Any
workaround?

It is a known problem. It is a Mono bug. (ncurses-based colored console
is not really complete.) There is a workaround.

Apply
http://sparcs.kaist.ac.kr/~tinuviel/download/patch-ironpython-mono-console

Seo Sanghyeon
 
S

skip

Seo> It is a known problem. It is a Mono bug. (ncurses-based colored
Seo> console is not really complete.) There is a workaround.

Thanks, it worked perfectly. I guess the white text on the white background
prevented the Mono developers from seeing that the editing characters were
self inserting. ;-)

Skip
 
A

Alex Martelli

Seo> It is a known problem. It is a Mono bug. (ncurses-based colored
Seo> console is not really complete.) There is a workaround.

Thanks, it worked perfectly. I guess the white text on the white background
prevented the Mono developers from seeing that the editing characters were
self inserting. ;-)

On MacOSX, my workaround for the white-on-white behavior of
IronPython+Mono on Apple's Terminal was to try other terminal emulators
-- Terminator worked fine (display-wise). But the editing remains off,
so I'll be glad to try the suggested workaround (if and when
sparcs.kaist.ac.kr responds...:).


Thaks,

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top