Introduction to IronPython

Cumartesi, 3 Ekim 2009 11:25 by ikivanc
Python + .NET, That takes the cake! Python runs on .NET… that sounds good.  Flexibility and easy coding of Python and powerful platform .NET together. Also on the great development enviroment of Visual Studio. This must be a dream :)


This news took me to my childhood year; Voltron cartoon! :) Powerful heroes  combined with shining then become most powerful hero, Voltron. IronPython sounds like Voltron :)


In a short time Python became popular and absolutly it will be more popular in the future by performance, easy coding and easy prototyping. Microsoft became aware of Python’s power. Microsoft entegrated Python to .NET platform, and very innovative technology revealed. IronPython is a Python complier runs on .NET.

IronPython Project started at 2004  and now Ipy 2.6 RC1 relaesed. There is the last stable release Ipy 2.0.2 version. It’s on ,Microsoft’s open source portal, Codeplex. And you can easily get the latest release and news from link below.

http://IronPython.codeplex.com/

Jim Hugunin demoed IronPython to Microsoft and was hired by them to work on the CLR architecture team. IronPython 1 is top of CLR. But CLR is too bad for dynamic languages. Then decided create Dynamic Language Runtime(DLR) and built IronPython version 2 on top of the DLR. DLR Including interoperation between statically typed and dynamic languages. DLR will be part of C# 4.0 and .NET 4!

I will write more about DLR as soon as possible in next blog entries.

This license IronPython is released under is the OSI approved Microsoft Public License (MS-Pl), which Microsoft’s licience for opensource projects. IronPython was the first project to be released under this license.

Road Map for IronPython;

•    Visual Studio 2010 integration for IPy 2.6
•    IPy 3.0 which works with Python 3000 together.

As you see versions of IronPython same with which Python’s version is built on. IronPython 2.6 is compatibility with Python 2.6 and IronPython 3.0 is compatibility with Python 3000. Now IronPython developers working on IronPython 3.0.

From codeplex page you can get IronPython Console application which is for exploring IronPython world. You can develop application from IronPython Console command prompt without an IDE like Visual Studio.

With IronPython Console, you can explore IronPython world and develop apps.


With IronPython Console you can easily explore whole Python’s code, Access .NET libraries and use this libraries to build an application.

So what can we do for developing applications with an IDE? We can use Microsoft’s Visual Studio. Like developing C#, Visual Basic projects in Visual Studio we can easily develope IronPython Projects .

We have two options for IronPython IDE. We can use IDE, stand alone IronPython Studio or Visual Studio Integration. Both of them are same. Chose one It’s up to you. Based on IronPython 1.0 and also come with IronPython Intellisense.

How Do I Install IronPython?
http://IronPython.codeplex.com/ on project’s home page there is a download section. You can find easily download the latest version of IronPython msi installer.

How Do I Install IronPython Studio?
There are some pre-request for Installing IronPython Studio. First of all download the IronPython Studio entegrations below.
 
http://www.microsoft.com/downloads/details.aspx?FamilyId=ACA38719-F449-4937-9BAC-45A9F8A73822&displaylang=en

http://www.microsoft.com/downloads/details.aspx?FamilyId=40646580-97FA-4698-B65F-620D4B4B1ED7&displaylang=en

Visual Studio 2008 must be installed on your system and for a succesful installiation, you must install VS 2008 SDK 1.0 which is link below.

http://msdn.microsoft.com/en-us/vstudio/bb887604.aspx

After this installiations;

from Start > All Programs > Accessories > Commad Prompt right-click it and choose "run as administrator" then access the user account control prompt.

Then choose the path which is including IronPythonStudio.msi setup from Command Prompt. Then enter this command “msiexec /i C:\ IronPythonStudio.msi”.
If you are missing any pre-request of installing step there will be a problem about your installiation.


ScreenShot from IronPython Studio it is look like Visual Studio
 

ScreenShot of IronPython Studio which is integrated in Visual Studio

As you see there is a Visual Studio based IDE, IronPython Studio. It has also IronPython code intellisense. Now we can easily develop UI applications with IronPython Studio. It is easy as pressing F5 :)

IronPython is Working With
Now Python combined with .Net and let’s see where can we use IPy.
    * Desktop Applications
    * Silverlight
    * WPF
    * ASP.NET
    * The Microsoft Robotics Kit
    * XNA (Desktop – Xbox/Zune has no DLR)
    * Surface
    * SharePoint
    * WCF
    * WF

Silverlight
Silverlight has Dynamic Languages support now and Silverlight applications can be developing with IronRuby and IronPython code. We can develop web applications with Dynamic Languages! Cool!
 
WPF
With XAML, graphical user interface desing and code independent from each other so we can develop one of them independently.  Now we can use IronPython in WPF code behind side!
 
ASP.Net
We can use IronPython with ASP.NET building web applications. With IPy it’s really short coded and easily fast developing web applications..
 
The Microsoft Robotics Studio
Microsoft’s development platform for various hardware and Robot technology. IronPython can be integrated to Robotic Studio.
 
XNA
With IronPython’s Advantages of being Dynamic Language XNA 3D and game development. In the future this will be a shining star!
 
SharePoint
IronPython can be integrated with share point.

Why do I prefer IronPython to C# or Visual Basic?
There is a lot of reasons for for this question. Python is a Dynamic Language! C# and Visual Basic are static Languages. Because of being Dynamic Language there are some advantages to developing applications. There is no Type validation and Type creation in Dynamic Languages. Types are not verified up front. They are verified when they are used - languages like Python and Ruby are strongly typed languages, not weakly typed. Easliy Prototoyping and rapid development of Applications. For python users It runs on .NET wih same code!. It’s also scripting language.

PDF verison of this article >> 1 - Introduction to IronPython

If you have any questions or discover any errors / typos please let me know ik@ibrahimkivanc.com

All The Best!

Yorum ekle


 

  Country flag

biuquote
  • Yorum
  • Canlı önizleme
Loading