3 ms·
I don't get why they went with ManagedC when Managed C++ aka C++/CLI (which runs on CLR rather than JVM) existed for a decade.
by gruez 11y ago
I don't get why they went with ManagedC when Managed C++ aka C++/CLI (which runs on CLR rather than JVM) existed for a decade.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- zamalek 11y agoC++/CLI uses IJW, which includes native module in the library[1]. It's a different solution than the one presented here. It also only works on Windows. [1]: http://blogs.msdn.com/b/abhinaba/archive/2012/11/14/c-cli-and-mixed-mode-programming.aspx http://blogs.msdn.com/b/abhinaba/archive/2012/11/14/c-cli-an...
- mike_hearn 11y agoIf you read the paper, ManagedC is doing something very different to Managed C++, despite the similarities in name. C++/CLI is a different language where you have to define garbage collected pointers manually. ManagedC is basically the same as C99, albeit a whole lot more strict about things that might work on other compilers whilst being technically undefined. To be more specific, in ManagedC the C code is interpreted, profiled and then JIT compiled just like in Java, where the JIT compiler (Graal) can then do very aggressive profile guided optimisations like inlining huge amounts of code, and using the resulting compile graphs to eliminate the overheads introduced by the sanity checking. It can also do things like eliminate dispatch costs when using function pointers and the like, in the same way it's done for Java. What's also super interesting about this approach is the language interop you get. ManagedC is based on a project called TruffleC, which doesn't have any of the security/safety checks. TruffleC was built to enable Ruby code that's also being compiled by the same compiler to call into Ruby C extensions intended for the MRI interpreter. What's really crazy about this work is, the compiler can merge the C and Ruby code together incredibly tightly, to the extent that running a mix of Ruby and C on this experimental JVM can be much faster than running the Ruby and C together on the original implementation. The JVM can actually optimise out all the interop costs of moving between the Ruby and C worlds, just using compiler optimisations.