Microsoft is pushing forward with plans to bring its .NET platform to other operating systems. Part of this plan calls for the replacement of JIT compilation with ahead-of-time compilation through a project the company is calling CoreRT.
While the .NET platform is already well on its way in the open-source community, it still relies on RyuJIT to compile code into machine language. While RyuJIT supports Linux and macOS, Microsoft is now thinking about other operating systems, specifically those in embedded devices and Internet of Things platforms.
To this end, RyuJIT is an ineffective vector: Each platform must be supported by the developers at Microsoft building RyuJIT. While CoreRT has RyuJIT embedded inside of it to ensure backward compatibility, the end goal is to support transpilation to C++ code.
(Related: Visual Studio is prepping for a future beyond Windows)
Transpiling .NET code to C++ would make it easier to run that code on myriad devices. Unfortunately, transpilation is not an easy thing to pull off.
Jeffrey T. Fritz, program manager for ASP.NET Web Forms and part of the community outreach team at Microsoft, described the path to transpilation in a blog entry. “In the CoreRT repository on GitHub you can watch the progress the development team is making on the native compilation tools. In particular, we had an interesting bit of progress over the summer as we completed some tasks that allow our C++ CodeGen to interpret .NET interface usage and properly dispatch it to C++,” he wrote.
There are still many hurdles to overcome for the CoreRT team, however. One major problem is that C++ and .NET do not have one-to-one feature mapping. Additionally, multiple .NET classes may implement the same interface, meaning the transpiler has to be smart enough to figure out which one should be passed around.