Posts

Showing posts with the label mono

Hello GTK# from IronPython and F#

GTK# is a managed interface to the GTK user interface library. GTK# is part of the Mono project, but it can also be used from .NET on Windows. In this blog entry, another one from Steve Gilham, he illustrates using GTK# from both IronPython and C# by porting some C# examples. “Hello GTK#” from the latest IronPython and F# A little post to record a short bit of spiking with GTK# as UI toolkit, porting the simple C# examples from here to my preferred .net languages. Neither of these explorations are totally novel -- there are examples in either language to Google, but not all of them recorded all the details of the slight rough spots that needed a little working (and they were often not at all recent, either). For IronPython 2.6 latest with GTK# 2.12.9-2, running the programs as ipy Program.py . The dynamic nature of the language means we can lose a lot of the declaration clutter. We just have to explicitly reference the main GTK# assembly (which is GAC'd by the GTK# install...

Talking to ActiveDirectory from (Iron)Python

Active directory is one of the standard (and important) parts of a Windows network. Working with active directory is therefore a common task for a Windows system administrator. Naturally you can work with active directory from Python , but there is also good support for active directory in the .NET framework that can be accessed from IronPython (including from IronPython on Mono). This is something that Brendan McAdams has been exploring on the Evil Monkey Labs blog and has created a utility module to make it even easier: Talking to ActiveDirectory from (Iron)Python ad_util.py on github  We're building a new intranet system at work, and I've been toying with a few things that the Windows admin asked for. Namely, since the secretaries here will update the intranet data to add people's Work & Emergency contact numbers, AIM handles, email addresses, etc. that we find a way to keep it all in sync with ActiveDirectory. Thereby keeping all the Outlooks and Blackberries up ...

Python on .NET: PyPy-cli-jit

PyPy is the combination of an interpreter compiler toolchain that allows you to write interpreters (Virtual Machines really) in a static subset of Python, called RPython, along with an implementation of Python in RPython. The compiler toolchain allows you to compile your interpreters for several backends. The major backends are native code, for the JVM and for the CLI (which is .NET and Mono). This allows you to maintain a single codebase and produce an interpreter that runs on all these platforms. The PyPy .NET backend is called pypy-cli. PyPy on its own runs at somewhere between the same speed as CPython and twice as slow. Because it has better garbage collection (PyPy doesn't use reference counting) there are some things it does faster but there are also places it is slower. There are various cool things about PyPy, for example it is already useful where you want a sandboxed Python interpreter. The really cool thing, and perhaps one of the driving forces for creating PyPy...

A Good Mix 26: Winforms in Arabic, xbuild, Mono on Mandriva, Scheme and Poker

Still working through the large collection of IronPython and DLR related articles that I've discovered in the last few weeks. Only a few more to go. Windows Forms with Mono and IronPython - in Arabic  This is a translation of the Winforms with Mono and IronPython Tutorial Series  into Arabic. It includes implementations of Snake and Tetris games as the final two parts of the tutorial showing how to create applications with IronPython on Mono or .NET.   xbuild and Mono 2.6p1 A blog entry on new features in Mono 2.6 which has just had a preview release . Included in the release is xbuild , the Mono implementation of the MSBuild tool. xbuild is now compatible enough that it is capable of building IronPython and IronRuby. Mandriva 2009.1 on mono and IronPython This is a Japanese blog entry on using IronPython 2.0 with the Mandriva Linux distro. From the same blogger who has also blogged about IronEditor ,  IronScheme - An R6RS conforming Scheme implementation ...

More from Mono: Moonlight 2, Monodevelop 2.2 and Debian Packages

Several of the recent entries here have been about Silverlight and IDEs. We continue the theme in this entry, but looking at things from the Mono side of the fence. Moonlight 2.0 Goes Beta Moonlight 2.0 Beta Download Silverlight is a cross-platform, cross browser plugin by Microsoft that allows you to execute Python code in the browser with IronPython. It is a Rich Internet Application framework with a user interface model based on WPF (Windows Presentation Foundation) and full access to the browser DOM. Unfortunately cross-platform only means Windows and Mac OS X, leaving Linux users out in the cold. Fortunately the Mono team have stepped up to the plate. Their implementation is called Moonlight, and Moonlight 2.0 (the version that can run Python code) has recently reached beta. It is a Firefox plugin that runs on Linux and is capable of running most of my IronPython Silverlight examples . MonoDevelop 2.2 Beta 1: We go cross-platform Python support in MonoDevelop What's New in Mon...

Developing cross-platform applications with IronPython: GtkBuilder and Glade on IronPython

Image
IronPython is a great cross-platform development language, running on the Microsoft .NET framework for Windows and on Mono just about everywhere. Even for CPython developers IronPython has a few features that make it of interest. These include: Under IronPython there is no Global Interpreter Lock (GIL) meaning that multi-threaded pure-Python applications can scale across multiple CPUs with no extra work from the developer .NET AppDomains allow you to create Python engines and restrict their security privileges, including controlling network and filesystem access and which assemblies the Python code can use Easily create Python applications with multiple isolated Python engines in the same process Easy to compile applications to binary and make binary only applications Through the Dynamic Language Runtime (DLR) you get interoperability with languages like C# / F# / IronRuby and IronScheme Extending IronPython with C#, for performance, is worlds easier than extending Python with C For d...

IronPython and IronRuby in Debian and Fedora

Microsoft software is not what you might expect in Debian and Fedora / Red Hat (although perhaps it's commonplace now ), but this is what C.J. Adams-Collier has been working towards. Looking to get Iron* and the DLR into RedHat I sent an email to the Fedora Legal list asking whether they will accept software released under the MS-PL license. My friend and former colleague, Brett Lentz mentioned that he was concerned that the Fedora folks might not accept software released under the MS-PL. So I asked. I also bcc’d a certain troll on said mail so as to get lots of flame mail. I’m practicing to become a master twitterbaiter. MS-PL is acceptable for Fedora as a GPL-incompatible https://www.redhat.com/archives/fedora-legal-list/2009-August/msg00017.html In addition, IronRuby/IronPython/DLR may make it in to FC 13, thanks to Brett. dlr-languages package passes another hurdle It looks like the upload of the Iron* languages to Debian is imminent. We’ve gotten the debian/watch file downloa...

Mono builds of IronPython (and IronRuby)

Ivan Porto Carrero , when he's not writing IronRuby in Action , has been working on ASP.NET MVC integration with dynamic languages. His main focus has been IronRuby, but a lot of the core work (the DLR hosting API integration) applies equally to IronPython. Jeff Hardy has recently taken up the mantle of working on the IronPython integration. Anyway, that is all by the way of an aside. In the process of doing this Ivan has been building IronPython and IronRuby for Mono. He posted this email to the IronPython mailing list: I've added the ironpython mono package to the ironruby mono CI server. It is slightly different from the windows package it doesn't have the licenses included nor does it have the 64bit builds and the pyc.py file. The tutorial is also not in the github repository so I couldn't include that either. you can download the packages here: ironruby.colliertech.org/ The continuous integration server is maintained by CJ Adams-Collier, and it also has a pretti...

A Good Mix 15: SharpDevelop, IronRuby, Mono and Scripting

More blog entries, articles and podcasts on IronPython and the Dynamic Language Runtime. Why SharpDevelop is a better IDE Discussing IDEs for IronPython is all the rage at the moment , and it is great that tool support is finally improving (and at an impressive pace). This post is by a developer called Mandar Vaze extolling the virtues of SharpDevelop for working with IronPython. In my first post about IronPython, I documented how installing IronPython Studio was painful (Needed Visual Studio shell, which in itself was confusing). When I started with IronPython I did not know about any other IDE, hence I went ahead with IronPython Studio. But later I came to know about SharpDevelop. IronRuby 0.6 Released IronRuby, the evil-twin of IronPython, has had a new release on the road to version 1.0. Jimmy Schementi announces and explains the release: Performance has been a major focus to this release, getting startup time quicker and optimizing built-in types. There has been more progress with...

Choosing an IronPython editor for teaching

As outlined in IronPython in Action Goes to College , Tony Andrew Meyer is teaching a programming course and using IronPython in Action as course material. Part of his preparation is deciding which IDE to use in the course - a choice that is not entirely straightforward for IronPython. Tony has done a long and thorough blog entry going through all the possibilities. The editors he looks at are: Notepad++, IronPython Studio, SharpDevelop 3.0, SharpDevelop 3.1b1, Wing IDE 101, Davy's IronPython Editor, Visual Studio under experimental hive and Komodo Edit. Choosing an IronPython editor for teaching The Northtec D520 “Programming” course is changing to IronPython (from Visual Basic) this year, so I have to figure out what editor/IDE the students should use. In some ways, Visual Studio would be ideal, since they need to get exposed to that during the course (and it’s an excellent IDE, with a really great form designer), but since there isn’t any real IronPython support in Visual Stu...

Mono can now compile IronPython 2.0

If you follow this blog, or the state of IronPython on Mono , you will know that the version of IronPython included in Mono (from the FePy project ) is quite out of date. This is because (for various reasons) Mono has been unable to compile IronPython 2.0 from source which has prevented a new FePy release. This causes a problem with running the IronPython in Action examples from Mono and I wrote a blog entry about how to work around this: IronPython in Action Examples on Mono The intention is that MultiDoc, along with as many examples from the book as possible, run on both Mono and the .NET framework; IronPython isn't just for Windows but can also be used on Linux and Mac OS X or anywhere that Mono will run. Some readers have reported that MultiDoc crashes on exit when run with Mono. The root cause of this is the old version of IronPython 2 that ships with Mono. ... This is reason enough to look at using a more recent version of IronPython 2. Even though IronPython can't be co...

A Good Mix 8: Python 101, Regular Expressions, Silverlight, IronRuby and More

The Coding Geekette is a Python and .NET developer who has spoken on IronPython at many developer conferences including PyCon . Her next adventure is teaching .NET developers Python in Cleveland: Python 101 for the .NET Developer What: "Python 101 for the .NET Developer" with Sarah Dutkiewicz, Cleveland C#/VB.NET SIG When: Tuesday, June 23, 6:30-8:30pm Where: Beacon Place Conference Center, Beacon Place Office Building, 6055 Rockside Woods Blvd, Lower Level, Independence, OH 44131 Python and .NET Regular Expressions at the Interactive Interpreter This blog entry (non-English) shows two interactive sessions using the System.Text.RegularExpressions.Regex class; performing the same task from both IronPython (2.6 beta) and IronRuby (0.4). The interactive interpreter is a great environment for experimenting, and the sessions ably demonstrate this. Of course you could also achieve the same thing with the Python re module . This is true of many things in IronPython, file and path ...

How to install IronPython 2 with Mono on Ubuntu

IronPython has been included with Mono for quite some time. The versions included are the last releases of the FePy project (IronPython Community Edition), which are a stable version of IronPython 1 and an alpha version of IronPython 2 - both very old. In the FePy status update Seo Sanghyeon (FePy maintainer) explains the difficulty of compiling the latest stable version of IronPython with Mono. It is easier to compile IronPython 2.6 (the up and coming version), so hopefully we will see a new release of FePy - along with an update in Mono - when this is released later this year. In the meantime the latest binary versions of IronPython released by Microsoft work with recent versions of Mono (although they need a terminal with a dark background). In this post Ali Afashar explains exactly what you need to do to get a cooperating version of IronPython and Mono working on Ubuntu. How to install IronPython 2 with Mono on Ubuntu This is just an instructional post with the hope that it might...

FePy Status Update (and IronPython on Mono)

FePy is the community edition of IronPython maintained by Seo Sanghyeon. It includes the Python standard library plus various bugfixes and compatibility wrappers for Python modules not normally available with IronPython. More importantly it is intended to be compiled with Mono. (Although the FePy binaries work on Windows and the Windows binaries work on Mono - which is the point of Mono.) The latest released binary versions of FePy are for IronPython 1 and IronPython 2.0 Alpha 5. These are the versions that are included with Mono. Unfortunately they're pretty old. Problems with the Mono compiler have prevented IronPython 2 being compiled with Mono. These aren't always bugs; they're usually places where the .NET compiler has a different interpretation of the C# standards to the Mono compiler, or even places where the IronPython sources rely on features of the .NET compiler that appear to actually violate the ECMA language specification for C# . That aside Seo says that he r...

A Fairly Meaningless Server Performance Comparison

An interesting article by James Gardner comparing the performance of IronPython, Jython, Scala and CPython for serving web pages. Not only does it carry the usual caveats of all benchmarking and performance comparisons, but the version of IronPython used is the very old IronPython 2.0 Alpha 5 which still comes with Mono. UPDATE: it turns out that not only is the article using an old version of IronPython, but it advises installing Mono 1.9.1 because of the handy universal installer for Linux. Whilst this is indeed handy it is also outdated (the installer used to be built with a tool called BitRock which is non-free). The latest version of Mono is 2.4. That aside it is still an interesting read and includes instructions on how to get Mono installed and have IronPython working with the Python standard library on Linux: IronPython, Jython, Scala and Python: A Fairly Meaningless Server Performance Comparison IronPython 2.0 is a full implementation of Python 2.5 targetting the .NET platform...

Exploring ActionScript Bytecode with IronPython

OK, so I'm not fully certain what this about - but it certainly looks interesting. AbcExplorationLib is " a library to read and write ActionScript Byte Code (ABC) files. When completed it could be used for compiled program analysis or as part the back end of an experimental compiler. It is written in F# but it could be used from other .NET languages. Inspiration for this library comes from many excellent libraries for bytecode manipulation such as BCEL, ASM, Cecil or System.Reflection.Emit ". The blog entry linked to here, is about experimenting with ActionScript bytecode from IronPython; and in particular with the bytecode for the switch statement. Support for the LookupSwitch opcode in AbcExplorationLib Given the following ActionScript code: var x; for(x = 1;x switch(x) { case 1: print("one"); break; case 2: print("two"); break; case 3: print("three"); break; case...

An IronPython on Silverlight Collection

A collection of links about using IronPython with Silverlight, the Microsoft ' flash killer ' browser plugin. DLR + IronPython + Silverlight in 5 Steps (with pictures) A post by the MetaDeveloper to get you started developing Silverlight applications with IronPython and the Silverlight Dynamic Languages SDK . It includes the development process using Chiron. State of the DLR for Silverlight Whilst we're talking about the Dynamic Languages SDK for Silverlight, it's time for a word from the guy responsible for maintaining it: Jimmy Schementi. This is a long post that describes the SDK and answers some Frequently Asked Questions on the subject. The post starts with: It would seem the next release will be focused around REPLs, testing, scripting support, and maybe some server-side integration pieces. And you’d be right. Proof is in the project’s public source code repository. And ends with: I hope that made some things clear; the DLR, IronRuby, and IronPython are committed ...

Winforms with Mono and IronPython Tutorial Series

IronPython runs great on Mono, and if you use the official Mono installer then IronPython is included out of the box. (Although the version of IronPython 2 is quite old now and could really do with being updated - when I tried it the latest Windows binary worked fine on Mac OS X which isn't something you hear often. For Debian and Ubuntu users it is as easy as apt-get ironpython .) So cross platform application development with IronPython is really possible, and for client applications Windows Forms is the GUI toolkit to use. Although it looks ungainly by default on non-Windows operating systems, with customization it is possible to create applications that look great on Windows, Linux and the Mac. Up on ZetCode there is a 12 part tutorial on creating applications with IronPython and Windows Forms on Mono. It covers the basics, plus dialogs, advanced use of controls, drag and drop and handling painting yourself. It even creates Snake and Tetris applications as examples! Anyway - lo...

An IronPython Silverlight Bonanza

Silverlight 2 is the Microsoft browser plugin that includes a cut down version of the .NET runtime called the CoreCLR. Silverlight 2 runs on the IE, Firefox and Safari browsers on Windows and Mac OS X (Intel only). The Dynamic Language Runtime can run inside Silverlight, making it possible to natively script the browser with Python. Meanwhile, the Mono guys have been busy creating a Mono version of Silverlight 2 for Linux called Moonlight . Although Moonlight 2 hasn't yet been released, they are making great progress with it. The latest development version (build instructions here ) is capable of running some of my IronPython demos: Python in the Browser on Linux On my Silverlight pages I have a series of articles and simple demos of developing Silverlight applications with IronPython. This includes my Web IDE which is a great tool for interactively exploring the Silverlight APIs and comes with several different demos preloaded. Due to the minor trials of completing IronPython in...

Python on Android with Mono and the DLR

Koushik Dutta has been working on porting Mono to the Android mobile platform, including a bridge that allows you to call into the Java APIs from C# and other Mono supported languages. Of course through the Dynamic Language Runtime, other Mono supported languages includes IronPython and IronRuby: Microsoft's DLR and Mono bring Python and Ruby to Android After copying the necessary DLLs over to the phone, I was able to run the simple ipy.exe console application that comes with the DLR source code. The neat thing I discovered while perusing through the documentation is that IronRuby and IronPython are actually compiled into CIL byte code and thus eventually native code! Anyhow, as you can see, IronPython is working dandily on the phone.