compiler-explorer
compiler-explorer copied to clipboard
GameDevs (Unity3D, Godot, CryEngine) would love C# Mono support
Not sure how this would work exactly since compiler explorer uses mostly established toolchains to generate its output. It would be really cool to be able to compare 2 methods of doing the same thing in C# since its such a flexible language.
Specifically, there are instances whereby "new" operator will do stack allocations vs dynamic allocations. Having a quick way to see which the compiler would be great.
Love Compiler Explorer, keep up the great work!
Thanks so much for this request :) As you know from twitter I have a few reservations, though I'd love to find a solution that works for wider communities than those of the traditional compiled languages.
A couple of things -- does Mono output actual asm code? Or do we need to run it with representative data and for long enough that it JITs to to assembly? That has been the problem historically with supporting JITted languages.
I'm wary of adding JITted languages because I feel a naïve implementation -- either dumping the IR itself, or the L1 JITted code only -- casts an unfair light on JITted languages, making them look like they produce far worse code than a statically compiled language. I definitely don't want CE to appear biased against such languages.
As I'm sure you're aware, modern JITs are able to do essentially what LTO and FDO does in C++. One might reasonably say that as CE doesn't support either of these techniques for its compiled languages it's a fair comparison; but these are pretty new to C++, but they are absolutely the main source of optimizations in JITed languages.
It's worth pointing out my experiences here are based on my day-to-day experiences with Java, so may not be appropriate for C# or Mono in particular. I'd love to learn more and hear if you have any suggestions on how best to overcome these concerns.
Cheers, Matt
We've been having .net c# support for a while now, so we can either close this issue or discuss if more variants should be added :)