|
|
|
|
|
by int_19h
3504 days ago
|
|
Based on what I know about CIL and C++, the entirety of C and C++ can be compiled to [unverifiable] CIL. The sole exception is setjmp/longjmp - this might be doable on top of CLI exceptions, but I'm not sure. And, indeed, VC++ lets you do just that. There are some bits of the standard library, mostly new stuff like threads and atomic, that had some issues, as I recall. But it's more about the amount of effort that's needed to target what's essentially a completely different platform. The thing to know about CIL is that it has: - structs; - unions; - raw data pointers, with pointer arithmetic; - raw function pointers; - dynamic stack allocation (like alloca in C); - tail calls; - exceptions with exception filters (arbitrary expression evaluation when deciding whether to transfer to a given catch-block or not) and finally blocks. I'm actually curious if there's any language that cannot be compiled down to this efficiently. |
|