IL2CPU
IL2CPU copied to clipboard
[Discussion] IL2CPU compilation context
Currently IL2CPU is targeting netcoreapp2.0 and win7-x86, so it can only be run on Windows and it uses the .NET Core 2.0 assemblies that ship as part of the compiler, which are built for 32-bit systems. We should pass all references to IL2CPU, and the assemblies should be loaded in a separate context.
Pros
- IL2CPU will be cross-platform.
- It's almost impossible to fail to load a reference assembly.
- IL2CPU can load 32-bit or 64-bit assemblies according to the target platform.
- Users can target any framework they want.
Cons
- Plugs are implemented for a specific framework (currently
netcoreapp2.0
), and it would be too much work to support all frameworks, so we can either document what is the recommended framework or, as plugs are part of Cosmos, we can prevent the compilation for unsupported frameworks (maybe using an MSBuild ~task~ target).
But isn't the .NET Core available for Linux and macOS?
It's not that simple. IL2CPU loads the assemblies in the normal context, so we can't load assemblies from different runtimes (we want to use win7-x86 runtime assemblies). It would also require us to change some plugs. #66 would be the fix for this issue.