Ruby, Python and PHP on .NET
I’m curious about Ruby and Python because they look like neat languages, and PHP because it’s so widely used on the web. I am, however, quite comfortable using C#, .NET and JavaScript, so I haven’t quite figured out how I’d be able to integrate any of those languages into the technology stack that I’m currently invested in. In this post I thought that I’d write about a couple of ways that Ruby, Python and PHP could be integrated into a .NET based technology stack.
Ruby on .NET — IronRuby
IronRuby is an open-source implementation of the Ruby programming language which is tightly integrated with the .NET Framework. IronRuby can use the .NET Framework and Ruby libraries, and other .NET languages can use Ruby code just as easily.
The quote above comes from IronRuby’s website.
Scott Allen has a short Pluralsight course that show you how to get up and running with IronRuby. You’ll find the course here.
When we’re talking about Ruby: I found a course that teaches Ruby on Rails for .NET developers, which I’ve watched through. The course is available here on Pluralsight.
Python on .NET — IronPython
IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily.
The quote above is from IronPython’s website.
So IronPython is the project that has brought Python to the .NET platform, and it’s been around for a while longer than IronRuby, so it might be a safer choice than IronRuby.
Unfortunately I haven’t found any Pluralsight course for IronPython, but this 1 hour and 45 minutes long video on YouTube might be worth a look.
PHP on .NET — Phalanger & Peachpie
Phalanger
Phalanger is an open source implementation of PHP that compiles to .NET. Phalanger’s GitHub page describes it like:
Full-featured PHP runtime & compiler for .NET/Mono frameworks. Phalanger is modern open-source implementation of PHP, compatible with the vast array of existing PHP code. In addition Phalanger gives PHP-application developers lot of new possibilities; like improving the performance, allowing to use modern environments and seamless .NET integration.
Phalanger’s Codeplex page has information about the project, but the project is now managed from its GitHub page.
Peachpie
Besides granting PHP programmers access to cross-platform development, Peachpie allows for a full compatibility with .NET, which enables the development of hybrid applications, where part of the code is written in C# and part in PHP. The parts will be entirely compatible and can communicate seamlessly, all within the .NET framework.
From the project description on GitHub.
Advanced Interoperability Between PHP and C# with Peachpie [Blog post]
Using Peachpie with Docker to Run PHP on .NET Core [Blog post]
Video interview with the creators of Peachpie. The first video interview is available here.
The guys also returned a second time and showed off support for .NET Core. The video is available here on Channel9.