Why does CrossNet generate C instead of direct assembly code or JIT?
Let me talk about JIT first. CrossNet has been designed to be used in places where you cannot JIT assemblies. There are multiple reasons where JIT cannot be used or may not be the best choice: • The platform doesn’t allow you to execute code on writeable memory. JITed code is written in memory but some OS prevents you to execute code on this same memory. In those cases, the memory used to execute code is read only. • Your platform has very high memory constraints and as such you cannot afford the overhead of the JIT compiler in memory. CrossNet has a very low memory overhead, as it contains the bare minimum functionalities that you are using, nothing more. Dead code stripping from the C linker takes care of that. So why using C with high level construct instead of replacing IL bytecode by corresponding assembly code? Here are the PROS / CONS: PROS: • Reuse C optimizer / linker for faster / smaller code. No need to do an optimization pass. Better pipeline of the generated code / inlinin