Question

I've always had this dream of creating a 'real exe' from a scripting language. With the available of DLR-based implementations of Python and Ruby, is this getting any closer to reality?

I'd like to create a 'real application':

  • A Windows Forms App
  • A Console App
  • A Windows Service

And have the unit of distribution be a compiled exe.

Is this possible? Or has MS just created script file interpreters based on .NET?

If you are doing this, how are you structuring your applications / projects? Are you using a hybrid of C# and DLR code?

Was it helpful?

Solution

An IronPython or IronRuby project can be compiled to a dll or executable just fine and will be 'real' executables in every way with the proviso that the person running them must have the relevant .Net framework and dependencies installed (dependencies may be present in the same directory by default instead but the framework must be installed). The integration with Visual Studio is still not there but projects like IronPythonStudio use the free VS Shell to good effect. The existence of the DLR as a dependency for c# dynamic in VS 2010 should mean that integration with VS from the Iron* groups becomes an easier goal and a higher priority.

The result is in no way interpreted (the CIL is jitted into machine code at runtime or via ngen if desired) and certain aspects of the DLR mean some actions are deferred in a similar fashion to latebinding but more powerfully and crucially with some sophisticated caching mechanisms to allow this to be relatively fast compared with naive interpreters.

Many traditionally interpreted scripting languages are creating their own VM based compilation strategies or leverage existing ones (like the JVM, the .Net CLR or open ones like the LLVM) since this leads to significant performance increases in many common cases.

In the case of the Iron* languages the benefit of the MS CLR as a basis is that the resulting executables 'Just Work' on the vast majority of installations of the most common OS family. Contrast to Java where a jar file is not 'runnable' by directly clicking / or 'executing' via the shell in many operating systems. The flipside from this is that this reduces interoperability compared to say a JVM or LLVM based solution where the platform support is broader but, inevitably, more diverse in OS integration.

OTHER TIPS

You can create exe's from regular python using Py2Exe. But there shouldn't be anything preventing you from creating exes with IronPython using Visual Studio or SharpDevelop

although not directly related to iron* question, might be interesting for someone wanting binaries from python scripts: pyinstaller

works under Windows (32-bit and 64-bit), Linux (32-bit and 64-bit) and Mac OS X (32-bit only)

works under any version of Python from 1.5 up to 2.7

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top