Posts

Showing posts with the label ironruby

A Good Mix 34: Silverlight Logging, WPF and NotifyIcon, more Python and Ruby and pickling Python books

Another collection of IronPython and DLR related articles from around the web. A fine way to end 2009. SLog: Silverlight Logging A nascent project to Port Log(4|5)J from Java to C# with the goal of usefulness in Silverlight, especially for IronPython. A WPF Picture Viewer NotifyIcon to use from IronPython  Two Japanese blog entries, both by sasakima-nao. As with previous entries the code examples are very readable. The first is a simple WPF picture viewer (nice penguins) and the second shows how to create a NotifyIcon and ContextMenu in the taskbar (with Windows Forms classes). Python-Ruby (and a little bit of soap) This blog entry is in Russian, but I think there are enough code examples for it to be useful for those of us who don't speak Russian. As I've mentioned before the promise of the Dynamic Language Runtime is that dynamic languages can interoperate and share libraries. This is exactly what this blog entry shows: using the Ruby soap/wsdlDriver from Python. ...

A Good Mix 33: Embedding Python and Ruby, Profiling IronPython, News on JScript, ctypes and DeviantArt

More IronPython and DLR related projects, articles and news from around the web. Embedded IronRuby and IronPython in Silverlight with Multiple Source Files A  nice example of embedding both IronPython and IronRuby in a single C# project. As an added bonus the project is a Silverlight project so you can add both Python and Ruby scripting to applications that run in the browser. slimtune: A free profiling and performance tuning tool for .NET applications IronPython 2.6 has useful new hooks for profiling and debugging IronPython code. Unfortunately most 'standard' .NET tools don't know how to use these, and if you attempt to profile IronPython code (particularly in an embedded environment) you have to work hard to get useful information about performance of your Python code. It's nice to see a new (and open source) tool that is designed to work with IronPython: SlimTune is a free profiler and performance analysis/tuning tool for .NET based applications, including C#...

Executing IronPython Code from IronRuby

The Dynamic Language Runtime is a framework for writing dynamic languages that run on the .NET framework, with the two "Microsoft sponsored" languages being IronPython and IronRuby. There is also IronScheme , a community project hosted on Codeplex. The promise of the DLR is not just that it makes implementing dynamic languages possible , but also that through the DLR .NET languages can interoperate. This includes IronPython and IronRuby (etc) interacting with C#, F# and VB.NET (the supported and statically typed Microsoft .NET languages) but also the reverse (statically typed languages interoperating with dynamically typed languages) and dynamically typed languages interoperating amongst themselves. All very incestuous. As far as I know this is still unique amongst the modern polyglot runtimes (.NET and Mono, the JVM, LLVM, Parrot and so on). Whilst IronRuby in particular has been changing very rapidly (IronRuby has only recently reached 1.0 RC 1) it has been hard to g...

A Good Mix 32: Alpha Encoding Files, Embedding IronPython in Russian, IronSharePoint, IronRuby, World's Worst Paint Program

More IronPython and DLR related projects, articles and news from around the web. Alpha-encoding file versions  Steve Gilham shows how to generated encoded version strings for installers using IronPython: When building installers the UpgradeVersion must have a unique property value that is an installer public property (upper-case alpha). So, what better way of adding uniqueness than making it have the form "product name + product version" with the version suitably encoded... So, a script for turning a file version (4 x 16bit ints) encoded as a System.Version into a short alpha string, assuming that Major and Minor will be small, and that common approaches are to step Build, to use a stepped Build plus date-stamped Revision, or a timestamp Build and Revision. C# + IronPython: вызов методов An article on IronPython, and in particular using IronPython from C#, in Russian. IronSharePoint Source Code Available   A while ago Christian Glessner announced the start of the I...

A Good Mix 31: Texas Holdem, IronScheme, Indigo Cheminformatics, IronRuby and bridge xml

More IronPython and DLR related projects, articles and news from around the web. Texas Holdem Hand Equity Calculation in IronPython  Greg Bray has been experimenting with using Resolver One to write Texas Holdem calculating spreadsheets with IronPython. In this blog entry he shows the IronPython code for calculating hand equity: This year I have been working in my free time to create easy to use Texas Holdem poker spreadsheets based on IronPython using Resolver One. These spreadsheets can be used to calculate Win/Tie/Loss odds, but some people like to use hand equity instead since it represents a player’s overall stake in the pot. Equity of 1.0 or 100% means that they will win the entire pot, where as equity of 0.5 (50%) or 0.25 (25%) means that they will split the pot with other players. You can again use Monte Carlo analysis to run a number of trials before all of the board cards are dealt to estimate a player’s current equity in the hand. This means that if during 4 trials ...

IronPython and IronRuby for .NET 4.0 Beta 2

If you're part of the Python community then it may well have passed you by that a major new release of the .NET framework is imminent. .NET 4.0 is a new version of the Common Language Runtime (CLR), unlike 3.0 and 3.5 which were primarily new libraries and language enhancements for C# and VB.NET. A big part of .NET 4.0 is the Dynamic Language Runtime (DLR), on which IronPython and IronRuby are both built, and parts of the DLR are moving into the core .NET. This enables the introduction of the dynamic keyword in C# 4.0 and VB.NET 10. One of the major use cases for the dynamic keyword is to make it easier to integrate dynamic languages with the statically typed ones, for embedding or for hybrid applications. A minor addendum to the new .NET 4.0 is Visual Studio 2010. .NET 4.0 Beta 2 is the second beta (Community Technology Preview - CTP) of both .NET 4.0 and Visual Studio 2010. To go with this CTP there are new releases of both IronPython and IronRuby. IronPython 2.6 CTP for...

A Good Mix 25: The SharePoint Object Model, IronPython Tutorial, Crazy Snake and IronRuby

Yet another collection of IronPython and DLR related articles, projects and blog entries from the past few weeks. Using the SharePoint Object Model with IronPython  The iLove SharePoint blog recently posted an example of using the SharePoint object model from IronRuby . In the interests of balance he has posted the same example with IronPython. IronPython Tutorial: Basics IronPython Tutorial: Advanced (Events, Delegates, WinForms, WPF) IronPython Tutorial: Debugging (CLR Debugger)  The AvbWiki, a Russian developer wiki, has put online several IronPython tutorial pages. It looks like it is mainly based on the tutorial that comes with IronPython 2, but could be a useful online reference on IronPython. Intellisense for IronPython  Another release from the mysterious Japanese IronPython and Windows Forms project that we've covered before . crazysnake; ironpython and java, just monkeying around  This weekend I finally got around to downloading IronPython 2.6rc1 ...

A Good Mix 20: Startup time, inline C#, Global.asax in ASP.NET, an interactive shell in the web, Gtk# and more

Image
Another collection of blog entries and projects related to IronPython and the Dynamic Language Runtime. IronRuby 0.9 starts 6 times faster than IronPython 2.6B1, why is that? Does anyone know? IronPython 2.0 is significantly slower to start than CPython, which is an issue for those writing command line tools and full applications in IronPython. IronPython 2.6 improves the situation, but as the lament in this short blog entry expresses it is still slow even when compared to IronRuby: IronRuby 0.9 starts 6 times faster than IronPython 2.6B1 Why is that? Don’t they use the same DLR engine? If IronPython started the same way, probably I would not use ‘CPython plus .Net exposed through MSFT Com’ technique. It is just unfair. On the usual support channel ( Twitter ) Dino Viehland explained that the IronPython interpreter does a bunch of work at startup time that IronRuby doesn't. On startup the interpreter imports the site module site just like CPython (and IronPython uses site.py from ...

IronRuby 0.9: Performance and interop with IronPython

I'm a few weeks behind the curve on this one, but I'm finally catching up with my backlog; IronRuby 0.9 has been released. It looks like they didn't make the version 1.0 by OSCON but they have made a lot of progress. IronRuby 0.9 Released Jimmy Schementi lets us know the highlights of the new release: Library performance was a big focus for this release; basically going though the Ruby Benchmark suite and making sure any obvious slowness was fixed. As I said in my previous post about OSCON, IronRuby is approximately 2x faster than MRI when running the benchmark suite, but in the near future a complete evaluation of IronRuby’s performance will be done and published on the website. Antonio Cangiano has already published benchmark results between IronRuby 0.9 and Ruby 1.8.6, and things look really good for IronRuby. On the compatibility front, the Win32OLE Ruby library is now available in IronRuby. This builds on top of IronRuby’s existing COM interop from version 0.5, lettin...

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...

The IronRuby Tutorial

Image
Jimmy Schementi, program manager for the dynamic languages and Silverlight integration plus IronRuby developer, has pushed a new update to the IronRuby github repository . One of the major changes is improvements to the IronRuby tutorial app . "The" IronRuby Tutorial As you can see from the screenshot this is a WPF (Windows Presentation Foundation - which means it won't run on Mono) application which combines a tutorial with an integrated interpreter (REPL) for actually trying out the code: Isn’t he/she/it a bute!? This app makes Ruby-based tutorials interactive, guiding you through the material with a IronRuby REPL console and other visual aids such as another window, or whatever the tutorial writer sees fit. There is also a tutorial runner for the command-line, and a exporter for static HTML. The IronRuby tutorial included covers topics such as using the interactive window, built-in libraries, exploring .NET libraries, generics, events, Windows Forms, and Windows Prese...

Choosing a DLR language: IronPython or IronRuby?

.NET developers interested in dynamic languages but still wanting to stay within the .NET ecosystem have an interesting choice - IronPython or IronRuby? Simon Segal, who has been adding scripting support to his Entity Framework profiler , has been pondering this question: Which DLR language should I choose? Is it now IronRuby vs. IronPython. For my part so far I have delved into IronRuby and started to employ it for scripting my C# applications. Why did I choose IronRuby over IronPython? It began with curiosity in the Ruby language in general and led inevitably to IronRuby. I quickly acquired a taste for Ruby but there is something nagging in the back of my mind and I can’t get to the bottom of it - “did I choose the right language” and really after all “does it matter which one I choose?” Given Pythons relationship to C and my emotional connection to the C family of languages, would IronPython have been a better choice? Certainly IronPython is further down the track and more mature th...

IronRuby 1.0 (soon), Inside IronRuby and Professional IronRuby

IronPython 1.0, a complete implementation of Python for the .NET framework, was released in September 2006. The first IronPython 2.0 release (Alpha 1) came in April 2007. IronPython 2.0 was built on the new Dynamic Language Runtime (DLR) which was a framework for implementing dynamic languages in general, which had been abstracted out of the IronPython 1.0 release. Along with the new IronPython 2.0 project IronRuby was announced. IronRuby was an implementation of Ruby for .NET, led by John Lam who had previously been involved in the RubyCLR project. It has been a long road for IronRuby, with the latest release version 0.5. IronRuby 1.0 at OSCON 2009 Following their tradition of conference driven releases (panic-driven-development?) IronRuby 1.0 will be released at the coming OSCON 2009 conference: IronRuby is 1.0! Come and see how IronRuby is used in .NET programs, how well it performs, and how conformant it is. IronRuby is an Open Source implementation of the Ruby programming langu...

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 ...

IronPython and IronRuby: Four New Releases

There have been four new releases of IronPython and IronRuby; two new ones for each project. The first pair of releases are for the CTP (Community Technology Preview) of .NET 4.0 Beta 1. Part of the Dynamic Language Runtime is included in .NET 4 and on top of this is built one of the major new features of C# 4.0 and VB.NET 10; the dynamic keyword. dynamic is a new static type and informs the compiler that operations on dynamic objects should be performed at runtime rather than bound at compile time. In particular this makes late bound COM and interacting with objects from DLR languages much more pleasant. It also enables true duck typing (in fact dynamic typing) in these traditionally statically compiled languages. To go alongside the .NET 4.0 CTP are new releases of IronPython and IronRuby, targetting the same version of the DLR included the CTP. IronRuby CTP for .NET 4.0 Beta 1 This is our second preview of IronRuby running under the Dynamic Language Runtime that is built directly in...

The Not Python Edition: Ioke, Cobra and IronRuby

In this IronPython-URLs entry we look at four different topics on three languages; none of them Python - but all on .NET. Ioke for the CLR Released Ioke is a dynamic language created by Ola Bini , one of the core developers of JRuby (Ruby on the JVM). Ioke aims to be a highly expressive language, influenced by Io, Smalltalk, Lisp and Ruby. The primary implementation of Ioke runs on the JVM; but Ola recently unveiled the .NET (and Mono) implementation: Ioke for the CLR: Ioke E ikc is the first release of the ikc Ioke machine. The ikc machine is implemented in C# and F# and run’s on Mono and .NET. It includes all the features of Ioke E ikj, except for Java integration. Integration with .NET types will come in another release. There are several interesting pieces in ikc. Among them I can mention a new regular expression engine (called NRegex), a port of many parts of gnu.math, providing arbitrary precision math, and also an implementation of BigDecimal in C#. Cobra February 2009 Update C...

Through the Interface: AutoCAD and IronPython

Kean Walmsley, of the "Through the Interface" blog, is an AutoCAD programmer who has been meaning to try out Python for some time. He is somewhat sceptical of dynamic typing, but has heard many good things about Python: Python is also of interest because of its cross-platform availability: it’s an open source language with its roots in the UNIX/Linux world, but is now gaining popularity across a variety of OS platforms (one of the reasons it’s the scripting language chosen for at least one of our cross-platform products, Autodesk Maya). He has a (short) series of blog entries on getting IronPython (and IronRuby) working with AutoCAD. Using IronPython with AutoCAD I had originally hoped to build a .NET assembly directly using IronPython – something that appears to have been enabled with the 2.0 release of IronPython - which could then be loaded into AutoCAD. Unfortunately this was an exercise in frustration: AutoCAD makes heavy use of custom attributes for identifying commands...

A Good Mix 2: Newspapers, Testing and Samples

Another short selection of recent IronPython related articles. Mind your language I was recently at the QCon conference in London , speaking on IronPython in the "Emerging Languages" track organised by Ola Bini . After the conference the guardian newspaper published an article on the diverse languages that are becoming mainstream. At first I was surprised that a British paper could publish a sensible article on programming languages, but then I noticed it was by Tim Anderson - a noted and long time tech blogger and writer. A couple of extracts: The recent trend is towards dynamically typed languages, which use inference to reduce the amount of code to be written. Java, C# and C++ are "static typed" languages, whereas JavaScript, Ruby, Python and PHP (used by Facebook) use "dynamic typing". In static languages, the programmer must declare each variable's class (such as string, integer, or list) before the program runs; in dynamic typing, it is assessed...

Jimmy Schementi on IronRuby, the Silverlight SDK and Scripting C# with IronPython

I'm late with the news, but there is a new release of IronRuby. There has also been a fresh release of the Silverlight dynamic languages to work with the beta version of Silverlight 3. Jimmy has an unhealthy preference for IronRuby over IronPython, but he's posted a few blog entries on both subjects. IronRuby 0.3 Released Staying true to our “Conference-driven development schedule,” this release is in conjunction with MIX ‘09, where Silverlight 3 Beta and ASP.NET MVC 1.0 were announced, to name a few. John Lam spoke at MIX today at 12:30pm in Las Vegas about using dynamic languages in Silverlight for testing, scripting, and application building. And some ASP.NET MVC with IronRuby is thrown in there too. IronRuby passes approximately 80% of RubySpec, the best test suite Ruby has today. IronRuby is best at language compatibility, passing 95% of those tests, but worse on the standard libraries with a pass-rate of 77%. Overall the pass-rate as gone up approximately 10% since the la...