Have you heard of IronPython and Jython?
These two alternate implementations of Python were created by Jim Hugenin.
They run on top of the .NET and JVM runtimes.
On this episode, we're going to look at the story of IronPython.
It's been around for many years, although the last few years it's been somewhat stagnant.
That's why I'm thrilled to introduce you to Alex Earle,
who, along with Benedict Eggers, has become the maintainer of the IronPython project.
It's great to see IronPython getting the attention that it deserves.
We'll talk about IronPython past, present, and future in this episode of Talk Python to Me.
This is episode number 74, recorded August 31, 2016.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
This is your host, Michael Kennedy.
Follow me on Twitter, where I'm @mkennedy.
Keep up with the show and listen to past episodes at talkpython.fm.
And follow the show on Twitter via at Talk Python.
This episode is brought to you by Hired and SnapCI.
Thank them for supporting the show on Twitter via at Hired underscore HQ and at Snap underscore CI.
Hi, Alex. Welcome to the show.
Hey, thanks for having me on, Michael.
Yeah, I'm excited to talk to you about IronPython and its history and its future, even more importantly.
Where is it going, right?
So that's going to be a great conversation.
Yeah, definitely.
Yeah, I'm looking forward to share it with everyone.
Before we do, though, let's get to your story.
Like, how did you get into programming in Python?
You know, as of probably most people my age, mid-30s or so, I kind of got started programming back in the Q&A days.
I like, there's a game that came with a computer called Gorillas, where there are two gorillas and you threw bananas at each other.
And I like to go in and modify that and make the bananas like purple or just change things about it.
So that's kind of my first introduction to programming.
From there, I didn't really do much until high school when I took a computer programming class for C++.
And it was really fun and I enjoyed it.
But my first introduction to Python was in college.
I had a buddy who I was in several classes with.
His name is Travis Hartwell.
He introduced me to Python.
I'd never even heard of scripting languages or anything like that.
I'd only done C or C++.
You're like, where's the compiler?
Exactly.
Yeah.
I can just run these files, you know.
So it was pretty awesome.
And it was so easy to do things that were like way more complex in C++.
You know, the lists, dictionaries are awesome.
Functions you can use to sort or find things in them.
And then he introduced me to lists, comprehensions and stuff like that.
My mind was blown about how easy it was to do things in Python compared to C or C++.
And so I've just had a love of Python ever since then.
I didn't use it a ton in college except for in one class our professor actually let us.
He said, if you can write a program to do your homework for you, go ahead and do that.
It is a math class.
And so I used Python and basically wrote some easy functions to do all my homework for me for certain assignments.
And so that made me love Python even more.
I could do my homework for me.
So that was pretty awesome.
Credit to that professor who's like, look, if you can think outside of the box and solve this problem, do it.
That's really cool.
Yeah.
It was like a math for algorithms type class.
It was kind of breaking down algorithms into math.
And it was really cool to apply Python to that because, I mean, Python is great at that sort of thing.
Yeah, sure.
Was that like graph theory type stuff and those kinds of things?
Exactly.
Yeah.
It seems like you could totally automate that for a lot of them.
Find the most efficient path here.
Well, guess what?
We'll just try them.
Beautiful.
Okay.
So that was, yeah, that's how you got into programming in Python.
What do you do today?
Where do you focus now?
I work for a validation group, actually.
So most of my work is actually done in Assembly or C.
I write code that runs on embedded chips.
As part of my job as well, I also develop some software tools that we use to automate our tests and so forth.
And that's where I really got into Iron Python.
So I write software tools and develop a software infrastructure for embedded processor testing.
Okay.
Yeah, that sounds fun.
All right.
So you mentioned Iron Python.
And I think Iron Python is definitely one of the interesting alternative Python interpreters or runtimes out there.
And we've talked about alternate runtimes before on the show, like PyPy, for example.
But I think it's maybe worth just touching on the concept that there are other interpreters or runtimes out there because maybe not everybody's heard of what the options are.
Could you give us like a little bit of a rundown of what the options are?
Sure.
So as you mentioned, you mentioned PyPy, which is a JIT-enabled fast interpreter for Python.
There's also what we call it from Iron Python.
And I don't know if other Python interpreters call it this, but CPython, which is the main one developed.
You know, you can go to python.org and download the installation or it comes on if you're running like Linux or something, it usually comes on on Linux.
We call that CPython because it's based on the C language.
Yep.
And I feel like if people don't really know what version of Python they have.
Yeah, it's definitely true.
You know, you type like Python something and that's usually the CPython, but there are other Pythons.
JIT-enabled Python is another option.
It's developed on the Java framework.
So it runs on the JVM, the Java virtual machine.
And then there's us, Iron Python, which is developed on the .NET runtime.
So those are kind of the main ones that I know about.
We've kind of looked at those ones in particular as kind of the main areas where we can focus on compatibility and optimization so that we can perform well.
Yeah, those are definitely the main ones.
That's great.
And so if you don't realize that there's a bunch of interpreters or runtimes, however you want to think of them, for Python, you know, there may be a better choice than the default Python, the CPython implementation for your project, depending on what you're trying to do.
So let's talk about Iron Python, because that one's been around for a while.
A lot of the ones you mentioned, they're not brand new.
There are some new things coming out that maybe we'll touch on a little bit later, some of the JIT-based ones like Pigeon and so on.
But let's talk about Iron Python.
It's been around for a while.
When did it get started?
Do you know?
It got started at Microsoft, I think it was around 2006.
It's been around for about 10 years.
Right now it has an Apache license.
Microsoft kind of took it to a certain point and then they decided to open it up to be run by the community.
And so they open sourced it as Apache license.
And so that's the license we currently have.
Yeah, I remember it was licensed under a different license, like the Microsoft open source license or something that people are like, what is this?
Right?
And then finally they switched it to the Apache license.
Just go, here's something you're totally familiar with.
Already approved.
Go with that.
Yeah.
It was MSPL, I think.
The MS public license or something like that.
And it had some weird stuff within the license that people were like, I don't really want to touch this because, you know, it's a Microsoft license.
So moving it to Apache was a huge benefit to the project.
Yeah, that's great.
So it was started by Jim Hugenin, is that right?
Yeah, he was the one who did Jython as well.
So it's kind of a funny story.
The whole way that Iron Python came around is Jim had started working on Jython and he saw this .NET framework come out.
And he said, oh, I'm going to go show that a Python implementation would be horrible to run on the .NET framework.
And so he kind of started out Iron Python as a way to show that .NET was a horrible platform to work with.
But it ended up being great.
He said, it's a wonderful platform.
It's great to write these languages for.
And they run really well on top of it.
He started out as kind of trying to attack .NET and ended up loving it.
And he even was hired by Microsoft to continue development on Iron Python.
Yeah, I remember that.
And I think he worked there for like six years before he moved on to Google.
It's really funny.
You start out to prove something that is totally inadequate.
You're like, wait, it's not totally inadequate for this thing.
That's pretty interesting.
Yeah.
Do you know how similar Jython and Iron Python are?
I've never really done a lot of work with Jython because I don't do tons of Java.
They kind of aim at similar ideas, kind of bridging the gap between either Java and Python or the .NET framework and Python.
The implementation is very different, mainly because there's while Java and the .NET framework or C# are similar in ideas because they have garbage collector.
They're all object-oriented and that sort of thing.
Really, the way that the different platforms solve things can be quite different.
The way that they implemented things in Jython is actually, I believe, quite different in how things are implemented in Iron Python.
Like their object structure, how they interact with the actual Python modules and then represent those in the Java runtime.
That can be very different from how we do it in Iron Python.
Okay.
I forgot one detail.
I just wanted to make sure people understood why it's called Iron Python.
Iron stands for implementation runs on .NET.
Okay.
So that's why it's in Python.
Right, right.
You have a couple of languages.
Like you had Iron Ruby as well.
Well, they did when they started out at least.
And it is under the project that you're maintaining.
Before we get to that, though, maybe tell us a little bit about why would I choose Iron Python over CPython?
The .NET framework has a lot of capabilities.
And there's a lot of things.
There's the WPF.
There's Windows Forms for writing GUI apps.
There's network libraries that may or may not be available in Python as a module.
And so really the place that I use Python the most or Iron Python the most is creating a scripting environment for my applications.
When I write my tools, I generally develop in C# and I use Windows Forms or WPF to create these tools.
And to provide a scripting interface for those tools, Iron Python is very good at embedding into a C# application and accessing the components that you give it access to.
It's very easy to provide it access to like a text output window.
And so it can write to a text output window very easily that's developed in C#.
I've tried doing similar things with CPython.
I've used Boost Python to try embedding Python into an application.
And I ran into some issues with wanting to rerun scripts over and over and over.
I got weird assertions and seg faults and stuff like that.
So for me, embedding Python in an application is very easy with Iron Python.
And that's my biggest use case as a software engineer using Iron Python.
Okay.
So I guess, yeah, you can embed CPython pretty easily, especially if you're doing a C-based application.
Then that probably makes a lot of sense.
But if you're already writing in C#, this might be better because you can share information across it better, right?
Like your classes and libraries in one language are available to the other.
Does it go both ways?
Yeah, you can definitely access Iron Python objects and stuff from C#.
One of the tools I actually developed was we have a hardware team that they develop boards with FPGAs and stuff on there.
And they wanted a way to test their hardware platforms.
And so I created a GUI that interfaces with Iron Python.
And they write scripts to test these boards.
And I use the unit test module.
And so they write their tests in the standard unit test format.
But I can parse those objects and find all the unit tests from my C# GUI and present those.
And they can select which ones they want to run and run those tests to test the hardware boards out.
Oh, that's nice.
So you, like, load the Python modules and inspect what tests are there and then present some kind of custom runner on top of it?
Exactly.
Yep.
Okay.
Oh, that sounds really cool.
So we were talking about C#.
And a lot of people say, you know, C# means Windows only.
And a lot of people doing Python are not interested in Windows.
Does it run outside of Windows or is that required?
Yeah.
So we do have pretty basic support for running on Linux under Mono right now.
We definitely want to improve that because, you know, we want to be everywhere that people want to use C# and Python.
So whether that's Linux or, you know, OSX or Windows, we really want to provide a solution to everybody.
So we're going to put some focus on improving our support for Mono as well as .NET Core, which runs on Linux right now.
Yeah, yeah.
That's really interesting.
I think that that's going to unlock a lot of things like this that used to be tethered more or less to Windows to set them free to run on, you know, Linux machines in a data center or something like that, which definitely opens up the appeal, I think.
What about performance?
Like, is there a performance benefit doing this versus CPython?
Are there performance penalties, but you get the integration?
What's the story?
So one, I think, so performance benefits, we do outperform CPython in several benchmarks.
I don't have the details right now.
Recently, someone ran that.
They compared CPython, PyPy, and IronPython.
And we outperform CPython in many cases, but PyPy definitely outperforms us right now.
I think that really probably is related to the global interpreter lock because we don't have that in IronPython.
It can help us in a lot of those benchmarks.
One of the things that we do have, something that we definitely need to look into optimization and performance problems is startup time.
It takes us a lot longer than CPython to get started, you know, actually executing the Python code.
And so that's something that we're planning on looking at.
Sure.
Yeah.
If you're just going to run a little bit of code and then shut back down, maybe it doesn't make so much sense.
I think PyPy also has that challenge that it takes a lot longer to get rolling at a high speed.
But once it's up in a sort of like a web app type of environment where it starts and runs for a long time, then it's better.
Yeah, definitely.
Okay, great.
Now, one of the things I thought was really intriguing about IronPython, and you brought it up, is the lack of the GIL or the global interpreter lock.
And that seems to be one of the challenges for doing real parallel, computational parallelism in Python.
You can do it and you can use the, you know, multi-process support and things like that.
But, you know, straight up threading when you're just doing computational stuff is challenging, right?
Is that more doable in IronPython?
Yeah, I would say so.
Because we don't have that, the GIL in IronPython, when we have something that can be spread across multiple cores, which .NET supports very well, you can really take advantage of multiple cores and not running into that, the GIL, which can slow you down.
Okay, so people are out there and maybe they have some project and they're trying to use parallelism.
How hard would it be for them to switch from running, you know, CPython to try out IronPython with their code?
Like, what's the chances of them taking what they have and running it with a different interpreter and having it work?
It depends quite a bit on what modules they're using.
Because we're running as a .NET application, we really can't use C modules, C-based modules.
So if you have something that's based on a C module, it's hard for us to interact with that right now.
Now, we do have a side project that had started a while ago when we were working on 2.6, Python 2.6 compatibility called Ironclad, which allowed us to interact with C modules.
It was kind of abandoned for a while, and now we're going to try and bring it back so that we can reuse some of those C modules that CPython provides so that more things are compatible under IronPython.
Okay, yeah, I mean, that seems really important to me.
I think one of the lessons from PyPy is it's really great, but it had these huge challenges around some of the popular packages that relied heavily on C, like NumPy, for example.
And they went so far as to try to implement their own version of NumPy in PyPy or in Python, in pure Python.
And that just seems like such a hard battle to, like, look at all the open source projects that are successful out there and go, let's just reimplement all of those.
And instead have to date, right?
Yeah.
It seems almost impossible.
Yeah, it's hard to play catch up.
It feels like you're always playing catch up, and that's a hard position to be in.
For one thing, you're trying to maintain compatibility with the language itself, which can change slightly from rev to rev, even on just the 2.7 baseline.
But then you have the open source projects that provide modules that are native or written in C, and those can be difficult to keep up with as well.
So it's definitely a trial that we're trying to work on and figure out.
Yeah, it sounds like Ironclad would be really important, or something filling that role at least.
How do you end up becoming one of the maintainers?
And you have a co-maintainer as well, right?
Yeah.
So my co-maintainer is Benedict Eggers.
He's located in Germany.
He was kind of what really kind of kicked off the resurgence of IronPython, I would say.
Ever since Microsoft open sourced it, I had been working, doing some stuff, because I was using it in my job.
So I wanted it to be a good piece of software.
And Jeff Hardy was the maintainer at the time.
And he's gotten, as with all of us, we go through hills and valleys of how busy we are with our jobs and family and stuff.
And he just reached a point where his job and his family were taking up a lot of time, as they should.
And he just didn't have the time that he thought he could put into helping IronPython be successful.
And so Benedict kind of pushed some buttons using some Twitter conversations between Jeff and myself and Benedict to kind of push.
And Jeff finally realized that he could pass it off to myself and Benedict.
Myself, because I had some history with the project and so forth, and Benedict, because he really had some excitement about it to get it going again.
So that's kind of how I got in there.
And Benedict is good at making people excited about things.
And so I got excited about IronPython again.
How nice.
We started making plans for the future.
Yeah, yeah, that's cool.
And it's interesting that was over Twitter.
I feel like people outside the development space don't really appreciate how special Twitter is in connecting you to people you would otherwise not be connected to.
Yeah, I mean, you can go to a site for a project and see like an email address for a developer, but you don't know, is it current?
Are they using that email address?
But Twitter, it's so easy to connect real fast.
Yeah, and the messages are small enough, you're likely to get a response.
If you write some 500-word email, people are just going to ignore you most of the time if they're busy or whatever.
But yeah, so I think it's really cool that that started out over Twitter.
This portion of Talk Python is brought to you by Hired.
Hired is the platform for top Python developer jobs.
Create your profile and instantly get access to 3,500 companies who will work to compete with you.
Take it from one of Hired's users who recently got a job and said,
I had my first offer on Thursday after going live on Monday and I ended up getting eight offers in total.
I've worked with recruiters in the past, but they've always been pretty hit and miss.
I tried LinkedIn, but I found Hired to be the best.
I really like knowing the salary up front.
Privacy was also a huge seller for me.
Sounds awesome, doesn't it?
Well, wait until you hear about the sign-in bonus.
Everyone who accepts a job from Hired gets $1,000 sign-in bonus.
And as Talk Python listeners, it gets way sweeter.
Use the link Hired.com slash Talk Python to Me and Hired will double the signing bonus to $2,000.
Opportunity's knocking.
Visit Hired.com slash Talk Python to Me and answer the door.
So do you want to talk a little bit about the internals, about how this works?
I know how it works in CPython.
We have Python bytecode and we have this eval loop that will go through and pull out this bytecode.
Instead of a JIT compiling it, it will just interpret it and piece it all together.
What happens in IronPython?
How is it the same or different?
Sure.
It's kind of a similar concept.
We parse the Python code into an abstract syntax tree.
And then we kind of do some optimization or, yeah, you can call it optimization.
So when something is executed, we generate what's called a call site for that operation.
So that in the future, if we execute the same code or similar code,
we have an optimized version of that code that we can then call.
So we basically take the Python and we convert that into the abstract syntax tree.
And then that gets converted into like a Lambda, basically, in the .NET world.
Something that we can execute.
And we cache off the compiled or optimized version of that call so that if we get another get adder call,
for instance, we have an optimized version of that that we can call
and we don't have to recompile it into the Lambda format from the abstract syntax tree.
Okay. That's interesting.
So every instruction when I run Python code in IronPython is JIT compiled eventually?
Yes. Because it gets converted into a .NET IL, which is the intermediate language,
the JIT will run on that code when it's executed and can get cached off.
All right. That's a really interesting difference than, say, PyPy.
Because when I talked to the PyPy guys, they said it initially runs through CPython,
but if it runs enough, they're like, all right, this is the hotspot.
We're going to JIT this part.
But it doesn't always JIT, which is interesting.
I think it makes it a little less predictable, perhaps, in the way that PyPy works.
So that's pretty cool.
So I guess that means things like garbage collection apply as well, right?
The standard garbage collection that you would know from there.
Yeah, definitely.
So the .NET framework includes garbage collection.
And so we don't, unlike the CPython, which has to do reference counting on objects in the internals,
we don't have to do that.
It's all done automatically for us.
And the GC takes care of anything that's not around anymore.
Well, that definitely makes it easier on you as an implementer.
What are the benefits or drawbacks of that versus, say, reference counting in CPython?
In CPython, it's deterministic because you're telling the runtime when something is no longer needed.
And so it can clean it up right then.
In running under .NET with IronPython, the garbage collection is non-deterministic.
So it can run even during a critical point in your app and slow things down slightly.
Now, because we're running on .NET, we can have multi-core stuff.
So the garbage collector may be running on one core.
And so you still have, like, three cores out of four that can actually execute code.
But there is a non-deterministic garbage collector.
And Jython would have the same issue.
Java runtime garbage collection is also non-deterministic.
So it's a similar issue or problem between the two managed frameworks.
Interesting.
Yeah, I remember playing around with some of those ideas and checking out the performance,
realizing that allocation was actually faster a lot of the times in some of the GC spaces.
But you paid for it later when it had to be cleaned up because that was way more complicated
because the compacting GCs and simplifying.
You don't have to, like, find an empty slot in the free space.
Those usually get compacted.
Okay, that's pretty cool.
So you brought up some of the different types of apps that you can build with IronPython.
Want to give us a bit of a rundown on that?
So you said you could build WPF apps, which is sort of the standard Windows UI framework these days.
What else?
So we actually have a module, a WPF module.
So you can import WPF, and it provides kind of higher-level ways of interacting with WPF that are more Python-like.
So it makes it easier to develop those sort of things.
Benedict actually does quite a bit with WPF on IronPython.
We also have, you can write Windows Forms, which is kind of the older format of Windows applications.
WPF is supposed to replace Windows Forms, but it hasn't happened yet.
People still write Windows Forms apps.
You can write Windows Forms apps under IronPython.
Now, you have to start them differently than you would a, like a command line application.
On Windows, when you're running a Windows application, it has to have an event loop in order for it to process Windows events and things like that.
The normal command line client doesn't have that message loop, so it can't run Windows Forms apps or WPF apps.
So we actually have a separate interpreter executable, which allows or has an event loop started up so that your forms applications and stuff work correctly.
Oh, that's interesting.
Yeah, because it has to plug in basically to that already running event loop or something like that, right?
Exactly.
Yep.
Okay.
And can you build, what do you distribute, I guess?
Like, do people have to have IronPython installed in the system?
Can you give them, like, an executable that's self-contained?
What thing do you give to people to run?
We do have what's called the IronPython compiler, which is basically what it does is takes any .py files that you want,
and you can actually also include the Python standard library,
and you can build a standalone executable that is basically a, has the Python code as a resource embedded inside,
and then some wrapper code to pull out those resources and execute it as if you were running it from the command line using the IPy interpreter.
So you can create pretty standalone executables.
They are pretty large because you're embedding everything inside,
but you can distribute a single executable that has all of the data inside for running your application.
Oh, that's pretty awesome.
Does that take, like, external packages?
Like, if I'm using requests or passlib or some of these things, will it get sucked in and become part of my project?
Right now, we don't have automatic dependency checking for that,
so you would have to specify the path to the .py file on your system.
But that is something we're looking into.
I recently created a patch for Module Finder for IronPython because we don't have bytecode,
and Module Finder uses bytecode, the Python bytecode, to determine what's being imported.
But I created a patch that uses the AST module to find all the imports within your project as well.
And that's something I'm going to roll into the IronPython compiler
so that it can automatically find the dependencies that you're using and include them.
Okay. What's the timeline on that?
Probably in the next major release of the 2.7 branch that we're working on.
We are working on IronPython 3, which would be 3.x support,
but we're still maintaining the 2.7 release track as well.
And so probably the next major release.
We're going to do another minor release here pretty soon because we had some regressions.
It was our first release as project owners, and we were human, so we made a few mistakes.
But we're working to fix those and get out kind of a minor release.
But I think in the next major release, we can include that type of support.
So what's the story with Python 3 versus Python 2 since you brought it up?
Sure. So in .NET, all strings are Unicode.
So we've had some Python 3-esque support for a while now because of that.
It also caused us problems with some of the 2.7 modules, but that's kind of a different story.
But we are working on implementing all of the features for the most recent 3.x series.
It's in a separate code repository from the IronPython 2.
Because we're going to make some fairly significant changes to the parsing logic for the new language features and things like that.
But it also allows, you know, a lot of those Unicode issues will go away with IronPython 3, which, because Python 3 switched to Unicode as well.
Sure. So is that something I can use today or is it still being worked on?
It's still being worked on. We don't have all the language features in yet.
We're working on trying to get out a first release in the end of October that has language features implemented.
And then we're going to work on fixing bugs and making sure all the tests are passing.
And we're really trying to push standard library features upstream so that you can use the normal Python standard library.
Right now we have some changes in the standard library and have a local version of it.
So you can't just go and grab the standard library of CPython and use it with IronPython and have it work.
But we want to push those changes upstream so that you can use the normal CPython standard library with IronPython 3.
Okay. Yeah. It seems like a great plan.
You touched on threading. And one thing I did want to ask you about, since we're talking about Python 3,
is there's some coroutine parallelism features in Python 3 with the async and await keywords.
And C# also has async and await keywords.
So is there some special tie-in, like does async and await do anything extra cool on IronPython versus regular Python 3?
The async and await stuff is something we haven't implemented yet, but I think it's going to be fairly easy because C# and .NET have the async and await already built in.
But that's something we haven't implemented yet in the IronPython 3 yet.
Okay. And speaking of implementation, we said that CPython is not mostly Python.
Mostly it's C code in the actual low-level parts, right?
So I had some of the standard library. But what is IronPython written in?
IronPython is written in C#.
And so the native modules or some of the built-in modules are implemented in C#.
We replicate the functionality of the native C modules, things like underscore hashlib, underscore SSL,
things that are imported in the Python module like SSL.py or hashlib.py.
We implement those and try and create them as feature-complete as possible in C#.
Okay. And how hard is it to match those things up? Do you have like tons of tests? Do you run the standard Python tests to verify your code or anything like that?
Yeah, we definitely use all the tests that are already there for the CPython in the standard library.
We use those heavily. In addition, we have some features that we test for like COM, which is a Windows technology, the common object model.
We have some stuff that makes it easier to work with COM objects. And so we have some tests that do that.
We have tests for interaction between C# and IronPython to make sure that if you're hosting IronPython in your application, it continues to run well.
So we do use the CPython tests and then we add additional tests on top of that.
Right, because you're trying to add additional functionality, I guess, in addition to what they're providing.
Okay. So also you talked about Windows apps. Can you build web apps, which is maybe where Python is used more?
Yeah. So Benedict has been working on something that we recently imported into the Iron Languages repository or organization on GitHub, which is IronPython ASP.NET MVC.
And basically what it does is allows you to write ASP.NET MVC apps, web apps in IronPython or in Python.
So you can define your routes and that sort of thing in Python. So it's a really exciting thing.
And that's one of the things we really want to get running under .NET Core as well.
Yeah, that sounds awesome. If you could get that running on .NET Core so I could develop that on my Mac and deploy it on Linux, that's pretty interesting.
Yeah, and you still get the power of some of the .NET libraries that may not have a Python module to do.
Sure. Okay. Well, yeah, that sounds pretty exciting. I'm looking forward to that.
What about managing local environments?
CPython has great support for virtual environments, especially in Python 3. It's got VEMD built in.
Do you guys have this concept of virtual environments with what you built?
We had some patches upstream to virtual ENV because there are some things that we were having some issues with.
They requested us to make some changes and all that kind of happened back when development was really kind of dying out on IronPython.
So it's something we need to resurrect and re-look at, but it's definitely something we want to support because people love that as part of CPython.
So we'd really like to provide that as part of IronPython as well.
Yeah, yeah. It's definitely pretty important. Okay, cool.
And then you also have something called PyLauncher.
How does that relate? Is that like the thing that will sort of associate with Python files and run them, or what's the story of that?
It is a launcher. I don't know if you're familiar with Visual Studio at all.
Visual Studio has a bunch of different formats for their project files, and so they have what's called a Visual Studio Launcher.
Visual Studio Launcher will get the format of the file that it's received and determine which version of Visual Studio that you have on your system you should open it with.
And that's kind of what PyLauncher does as well.
It allows you to have multiple different Python versions on your system and launch a different one based on different things within the files.
Right, okay.
So you mentioned Visual Studio, and Visual Studio is fine if you're on Windows, but if you're not, then you don't really have it.
And I'm also a fan of PyCharm, as people listening to the show know.
Could I, say, open PyCharm and write IronPython apps with it?
Yeah, I mean, we do run on Mona right now.
So, which we'll install on OSX or on Linux.
And so, you know, some people I know who are working on IronPython itself use like Emacs or Vim or, you know, their favorite editor.
And they write the Python and then they execute it from the command line using the ipy.exe.
So if you're developing the Python itself, you can write it anywhere and run it under the interpreter.
Now, there is an awesome tool from Microsoft called the Python Tools for Visual Studio, which is basically a free Python ID if you're running on Windows.
They do an awesome job of a lot of stuff.
And that kind of started out of IronPython initially.
And so that's kind of why I like it.
But, yeah, you can use basically any ID you want to write the Python.
And then you just execute it under the IronPython interpreter.
All right.
Yeah, that sounds really cool.
Yeah, I remember the IronPython tools for Visual Studio just became the Python tools for Visual Studio at some point, right?
Yeah, and so they work with IronPython.
They work with CPython.
I don't know if it works with PyPy.
I've never tried that.
But as I've created this tools here at work that use IronPython, I've had to recommend, you know, GUIs for people who are, you know, hardware engineers and stuff like that to write Python.
They can get syntax highlighting, IntelliSense type stuff or auto-completion stuff of methods and parameters, documentation.
So, yeah, Python tools is very good for that.
Most people here run Windows.
So, it's easy for me to recommend Windows tools to them.
Yeah, it's an easy sell if it already runs there.
We all want to ship our software faster, respond to user requests quicker, and build an edge on the competition.
But the faster you go, the more likely a bug or issue will slip by and cause your users grief.
I have the same trade-offs with my Talk Python websites and infrastructure.
That's why I use SnapCI.
Every time I check in at GitHub, SnapCI springs into action.
A clean copy of code is pulled from GitHub.
A Python 3 virtual environment is created.
All the packages and dependencies are installed.
The unit tests are run.
Finally, I'm notified in Slack and a menu bar on my Mac about the outcome.
That way, I know it's safe to ship a shiny new version of my web app.
Ship your software faster with a 30-day free trial at snap.ci slash Talk Python.
Yeah, there's a whole, let's say, vibrant debate that we could start about whether you should use IDEs or you should use something minimalistic like Emacs or Sublime, relatively speaking.
Maybe we shouldn't really go into it.
I kind of lean a little more towards the ID side myself on the PyCharm space.
And I think the tools, if you are on Windows, I think the Visual Studio tools are pretty sweet as well.
I've played with them a little.
So one thing that I thought was interesting that I saw on the mailing list going around was about the time that you took over, I think,
there was a meeting that said there's a bunch of urgent issues and we're going to sort of reset the direction of IronPython.
Yeah, when was that?
So we had our first community meeting a couple months ago.
We've been trying to have them every two weeks on Thursday.
And we have them on Gitter.
I don't know if you're familiar with Gitter.
It basically allows you to use your GitHub credentials and organizations to have meeting rooms in a web page.
Yeah, and they're generally like around a project on GitHub, right?
Exactly, yeah.
So we have one for our organization, which is the Iron Languages organization.
Sure, so tell people what the GitHub URL is.
Of course, I'll put it in the show notes.
Sure, so we're at github.com forward slash iron languages forward slash main is currently the main repository for the Python 2.7 branch.
Then there's github.com forward slash iron languages forward slash iron Python 3 for the work we're doing for Python 3 support.
All right, excellent, yeah.
Cool, I'll definitely link to those.
So the meeting, the first meeting, some of the issues that people brought up were this idea of Iron Ruby.
What is it doing here?
Does it make sense in Iron Python?
Do you want to talk about that a little?
Sure.
So when Microsoft open source the code, they had two languages are basically implemented on top of what's called the dynamic language runtime, which is kind of a set of classes or objects that make writing dynamic languages on top of .NET a little easier.
It does all that stuff about the call sites that I talked about, caching things and converting an abstract syntax tree into the lambdas for calling the code and so forth.
So they had Iron Python, which is an implementation of Python, and they had Iron Ruby, which was an implementation of the Ruby language on top of the DLR.
So what we kind of did is we split out Iron Ruby into its own repository under the organization.
And I submitted a message to the Ruby mailing list, say if there's anybody interested in taking up Iron Ruby and keeping it alive.
And so there were a couple of people who responded.
And, you know, we're willing to help them in any way we can.
But we really kind of just split it out so that they could lead their own destiny wherever they want to take it.
Yeah, that makes a lot of sense to me because while there's some similarities, there's a lot of differences between those two communities and languages.
And I feel, I mean, maybe correct me if I'm wrong, but I feel like the mission of Iron Python these days is no longer to say we're going to be this cool thing that shows off the ability to do dynamic languages on .NET.
It's all about making the Python as an alternate implementation special, right?
And so then that makes Iron Ruby being tied up in it make a lot less sense, right?
Yeah, and it really, we don't want to tie them down either with the decisions that we make going forward.
We don't want to impact them in a negative way if they want to keep it alive and keep it going.
So allowing them to have their own space is, I think, a good way to let them do what they need to do and let us do what we need to do to make both of our languages the best we can.
Yeah, excellent.
Okay, I'd say that's a good choice.
And then when you moved over from where it used to be hosted to GitHub, there was something like 960 issues that were just sort of stale out there.
And you're like, what do we do with these?
Did you end up throwing them all away?
Did you keep them?
Like, how do you manage that transition?
So, and all those issues were originally filed on CodePlex, which was Microsoft's open source competitor, if you will, to GitHub.
I actually wrote a Python script that ported them, did a screen scrape using Beautiful Soup on CodePlex because they didn't have an API to do this.
And then importing them into GitHub using one of the GitHub Python modules.
Nice.
That was a lot of fun.
Yeah, who says they don't have an API?
They do, they just don't know it.
That's right.
So anyway, there were these 960-odd issues.
Some of them were as old as 2006 or 2007, pretty old.
And so what we decided to do in the meeting is to go through and we marked them all as what we called untriaged,
where we said we just basically didn't know what was going on, what needed to happen, or anything like that.
And we have about 10 people who were in the community meeting that said that they would go through issues and try and triage whether they're a valid issue still,
whether it's something that doesn't exist anymore so we can just close it out, or things along those lines.
And so we've been working on that.
I think we're down to about 800.
So we haven't made a huge amount of progress, but we are making progress on triaging the issues
and seeing, you know, we need to fix these issues.
Some of them that we've triaged, we've fixed as well.
So some of them were very simple fixes to make.
We just had to know that we're still an issue and then go in and fix it.
But we're slowly making our way through those and porting things from the untriage state to either closed or,
yes, this is still an issue, to I don't know what we do with this.
Let's talk about this one further.
Sure.
I think that highlights one of the real big challenges, the unglamorous side of running a large open source project, right?
Like, probably if you could have your dream, whatever you want to do technically for your time, what do you want to dream about?
It's probably not triaging 900 old issues that might not even be relevant, right?
But it's important work.
Yeah.
It can be very satisfying to see that count go down.
Yes, I'm sure.
You know, it's been sitting around this 906 time.
And so seeing it go down is very satisfying.
Sure.
Well, when I look at open source projects, you know, on GitHub or whatever, that's one of the indications of whether or not I want to trust this thing still being around, right?
How old are the issues?
Are they getting responded to?
Also, pull requests.
Like, you'll see projects that have year-old pull requests, which seems just so sad because somebody went to the extra effort of fixing code for you,
and you didn't bother to pull it in or even respond, you know?
Yeah.
I agree completely.
Yeah, it's tough.
You also talked about release schedules.
What's the story there?
How often?
What versions?
Two, three, so on?
Sure.
Well, we're going from having like one release every four years to we'd really like to get on a more regular release schedule.
So we did three beta releases or RC releases, release candidate releases, before we did the most recent 2.7.6.3 release.
That was our final or our most recent final release or stable release.
And so we really want to do that, you know, every couple months, do a full release with the fixes and stuff so people know that we're actively working on it and we're actively fixing issues.
Yeah, okay, cool.
Every couple months, we'd like to do a final release or, you know, either a minor release or a major release.
Yeah, that's way better than every four years.
Yeah.
Nice.
All right.
Then you also talked about continuous integration, IronPython 3, which we touched on a little bit, and then IronCloud or the ability to support C extensions.
And I definitely want to just put my vote in to say, from what I've seen, the challenges that PyPy ran into, if you can support C extensions in a super clear, automatic way, that could seriously unlock the adoption.
Yeah.
Yeah, definitely.
It would be a huge benefit for people using IronPython.
And we wouldn't have to implement as many of the native modules in C# or whatever.
Now, there may be cases where we want to because we can optimize it better without the GIL.
But because the native libraries would assume there's a GIL there.
So there are some things we'd probably still keep in C# or implement in C# because we would want to avoid the GIL.
Yeah, that makes sense.
But it would be nice to let that be a choice and not a necessity.
Definitely.
Yeah, yeah.
Awesome.
All right, Alex.
We're getting near the end of the show.
At the end of the show, I always ask people a couple of questions.
So let me put them to you now.
On PyPI, there's over 80,000 packages, so many out there that you can use and just, you know, so many people probably haven't even heard of.
Like, what's an amazing one that you'd like to sort of shine a light on?
It's not a super, like, glamorous module, I would say.
But my brother and I use Python with the PySerial module.
We actually wrote an application that allowed us to interact with our body bugs.
So I don't know if you're familiar with body bug.
Like, it's an armband that you wear that tracks different things, like your bolts, and it's got a step counter and stuff like that.
Oh, nice.
And you have to have a subscription on their website to interact with it.
And so we kind of looked around on the web and found some information on how to interact with it over the serial port.
And so we use PySerial to interact with our body bug and get the same data that the website would get.
Oh, that's awesome.
It's not a glamorous module, but it was a lot of fun to be able to reverse engineer and do stuff like that with our body bugs.
Sure.
No, but it's a cool story.
And, you know, you have these companies with weird restrictions and business models or whatever.
You're like, you know, that's my data.
It's on my arm.
Come on.
Exactly.
Yeah.
Nice.
I could probably guess what you're going to give me for the next question as an answer.
But what's your favorite editor when you write Python code?
Actually, I use Vim for most of my Pythons.
I know I said Python tools from Visual Studio is awesome, but a lot of times I'm doing some quick edits to the Python code or something like that.
So I got introduced to Vim years ago in college, and I use that quite a bit.
I've tried using SpaceMax, which has a Vim mode for Emacs.
But plain old vanilla Vim is kind of my go-to editor.
Oh, right on.
Very cool.
All right.
Well, any final call to action?
Are you looking for people to help out on the project, people to try it out?
What do you guys need?
Oh, absolutely.
We'd love to have anybody who wants to.
You don't even need to, you know, write C#.
There's all sorts of documentation we need to figure out.
We do reuse a lot of the Python docs, but there are some things specific to Iron Python.
Testing things out, see if there's still issues.
We're still in that issue disposition time.
So anybody's on to GitHub and look at the issues and see if they can reproduce it or give us a little bit more information.
They'll kind of push us towards getting a fix faster.
So anybody who wants to get involved, we'd love to have them on there.
They can add on the mailing list, which we have through Python.org.
It's Iron Python users.
Yeah, we would welcome anybody who wants to help out.
That sounds great.
All right.
If it sounds interesting to you, get out there and check it out.
Alex, it's been fun to talk about Iron Python.
I'm excited to see this coming back to life.
It plays an interesting role in the ecosystem.
So nice work and keep it up.
Hey, thanks for having me on.
It's been a blast.
You bet.
Talk to you later.
This has been another episode of Talk Python to Me.
Today's guest was Alex Earl.
And this episode has been sponsored by Hired and SnapCI.
Thank you both for supporting the show.
Hired wants to help you find your next big thing.
Visit Hired.com slash Talk Python to Me to get five or more offers with salary and equity presented right up front.
And a special listener signing bonus of $2,000.
SnapCI is modern, continuous integration and delivery.
Build, test, and deploy your code directly from GitHub, all in your browser with debugging, Docker, and parallels included.
Try them for free at snap.ci slash Talk Python.
Are you or a colleague trying to learn Python?
Have you tried books and videos that just left you bored by covering topics point by point?
Well, check out my online course, Python Jumpstart by Building 10 Apps at talkpython.fm/course to experience a more engaging way to learn Python.
And if you're looking for something a little more advanced, try my WritePythonic code course at talkpython.fm/Pythonic.
You can find the links from this episode at talkpython.fm/episodes slash show slash 74.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
Corey just recently started selling his tracks on iTunes, so I recommend you check it out at talkpython.fm/music.
You can browse his tracks he has for sale on iTunes and listen to the full-length version of the theme song.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Smix, let's get out of here.
Outro Music.
*outro music*