Posts

Showing posts with the label compilers

Exploring ActionScript Bytecode with IronPython

OK, so I'm not fully certain what this about - but it certainly looks interesting. AbcExplorationLib is " a library to read and write ActionScript Byte Code (ABC) files. When completed it could be used for compiled program analysis or as part the back end of an experimental compiler. It is written in F# but it could be used from other .NET languages. Inspiration for this library comes from many excellent libraries for bytecode manipulation such as BCEL, ASM, Cecil or System.Reflection.Emit ". The blog entry linked to here, is about experimenting with ActionScript bytecode from IronPython; and in particular with the bytecode for the switch statement. Support for the LookupSwitch opcode in AbcExplorationLib Given the following ActionScript code: var x; for(x = 1;x switch(x) { case 1: print("one"); break; case 2: print("two"); break; case 3: print("three"); break; case...

IronPython 2 and the Fifth Assembly

IronPython 2 uses Dynamic Language Runtime expression trees, which have been merged with LINQ expression trees. These have extension methods and IronPython itself also uses extension methods. These need the .NET 3.5 compiler, but if you provide an ' ExtensionAttribute ' type then the compiled assemblies still work with .NET 2 (extension methods are effectively a compiler trick). Unfortunately the ' ExtensionAttribute ' type supplied with IronPython 2 clashes with the version in .NET 3.5 if your project also references the System.Core assembly. The latest release candidate of IronPython solves this problem by providing a fifth assembly. Harry Pierson (DevHawk) gives us the details: The Fifth Assembly The important details are: In IronPython 2.0 Beta 5, there were four DLLs that implement IronPython: IronPython.dll IronPython.Modules.dll Microsoft.Scripting.dll Microsoft.Scripting.Core.dll In our RC1 release, we’ve added “The Fifth Assembly”: Microsoft.Scripting.Extensio...

Extending Abobe Flash Player and AIR with Python and Ruby

An intriguing blog entry about an Adobe experimental project. It is a C/C++ cross- compiler for the flash player and AIR. This means that you can (will be able to?) cross-compile the Python / Ruby/ lots of other language runtimes and then run them in Flash. The blog entry contrasts this approach to the DLR which requires the re-implementation of dynamic languages - hence IronPython and IronRuby. The project is already beyond proof-of concept, they even have Quake III cross-compiled and running in Flash. Extending Adobe Flash Player and AIR with C/C++ Cross-Compiler Quake 3 has already been ported to managed code , but this is even more impressive. Whether the Python interpreter can be cross-compiled to run on top of another runtime (with completely different basic types), without changing the language semantics at all, has yet to be proved - but it is a very interesting project. (It also means that Python/Ruby will possibly be enabled only by additional optional downloads - but don...

Microsoft Volta: IronPython to Javascript Compiler

Microsoft Live Labs have announced a new project - the Volta Recompiler: Volta on Live Labs As far as I can tell, this allows you to compile IronPython (and other .NET languages) to Javascript: Microsoft Live Labs Volta helps developers who build distributed applications on the .NET platform, using the Microsoft development stack (programming languages, libraries, and Visual Studio). This version of Volta supports applications that run on the Microsoft CLR, a JavaScript-enabled browser, or a combination of the two. ... In essence Volta is a recompiler. Volta works on MSIL rather than on a textual source language. Volta rewrites MSIL into any number of target languages, including, today JavaScript and MSIL itself. ... In summary, Volta confers flexibility in the architecture dimension through: Language-independence . Write Volta code in any language that compiles into MSIL. For example...