InfoQ

News

The IronPython, Unicode, and Fragmentation Debate

Posted by Jonathan Allen on Jun 15, 2007

Community
.NET
Topics
Dynamic Languages
Tags
IronPython

Unlike the canonical implementation, IronPython implements the str class as Unicode rather than an ASCII byte stream. While some are saying this is a serious fragmentation issue, others say it is no big deal.

The root of the issue is whether or not the str class must to be implemented as ASCII. While ASCII is severely limited in terms of supporting non-English languages, it can do so using code pages. ASCII strings can also be used to represent binary data as byte streams.

In non-canonical implementations like IronPython and JPython, the str class is implemented using the platform defined String class. In this case, that means Unicode strings. While this will not affect most applications, those that use str for non-English code pages or as byte arrays won't work.

Calvin Spealman argues this is a serious problem:

IronPython takes the syntax, but stops short of the language. The problem is one for both Python and IronPython lovers. In Python land, we're seeing what appears to be an influx of interest from the IronPython (also, via Silverlight) world, but all those new developers are creating completely incompatible code. IronPython advocates, on the other hand, look silly to think they are promoting the Python language, and are completely missing out on hundreds of great libraries, years of built up community, and synergy that isn't just a buzzword.

Response from the community have not been quite so negative. Michael Foord responds:

To make it clear - at Resolver we have a 'large' IronPython application, which uses many modules from the Python standard library as well as third party Python libraries - and it works *great*.

Manuel also defends the decision:

First of all, Python, CPython, IronPython, Jython, PyPy are all changing entities. As changing entities, we can only legitimately criticize their trajectories. I see zero evidence that IronPython will "fork" the Python community. So much activity is being spent to make the Python library run in IronPython, in the FePy community and in the Microsoft sanctioned community.

Even Guido van Rossum, the creator of Python himself, stepped in:

You realize that Jython has exactly the same str==unicode issue, right? I've endorsed this approach for both versions from the start. So I don't know what you are so bent out of shape about.

For the time being, it looks like the Python community is willing to accept some incompatibilities in exchange for support on more platforms.

Check out the pythonic-syntax Boo .NET language. by Cedric Vivier Posted Jun 15, 2007 2:47 PM
How about a Python section in InfoQ? by Zeev B Posted Jun 19, 2007 1:16 AM
  1. Back to top

    Check out the pythonic-syntax Boo .NET language.

    Jun 15, 2007 2:47 PM by Cedric Vivier

    If you do not know it, maybe you should try the Boo Language for .NET instead of IronPython.
    Boo is a new object oriented statically typed programming language for the .NET/Mono with a python inspired syntax and a special focus on language and compiler extensibility.

    Thought from the ground-up for the .NET/Mono world everything is Unicode by default.

    Oh, I forgot to add, no more "self"-plague in your classes YAY! :)


    class MyClass:
    y = 1

    def AddToFieldY(x):
    y += x

    c = MyClass()
    c.AddToFieldY(2)
    print c.y // displays 3



    The official website is here: boo.codehaus.org/
    Oh, and if you like it, please join the community on the mailing-list :)

  2. Back to top

    How about a Python section in InfoQ?

    Jun 19, 2007 1:16 AM by Zeev B

    I see there is a Ruby section in InfoQ - Why not add a python section also?

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.