Comment by russellbeattie

9 months ago

So, does everything he said about C# sound about right? I have no real desire to use it, but I'm curious if his opinion was more or less accurate.

Not looking for a flame war, just knowledge

Yes, C# has had low-level primitives since 1.0 and it has only gotten better in this regard. This means that it's worse than Java at things like devirtualizing calls, but you can write allocation-free hot loops in C# these days.

It's also cross-platform and has multiple deployment modes: you can ship the runtime and the program separately (good when you control the end-user machines, like in an enterprise settings), you can tree-shake the runtime and ship it with the program, or you can tree-shake the runtime and use the AOT compiler to ship a go-like native binary.

The JIT compiler is still better for long-running processes like servers, but for one-shot programs where the startup time is critical, like CLI tools and FaaS, the AOT compiler is really great.

  • > you can tree-shake the runtime and use the AOT compiler to ship a go-like native binary.

    The OP talks about doing this for mobile platforms, but could I take e.g. the OP's source code (he co-wrote Celeste) and trivially compile an AOT native binary for x86_64, or would more work be required to make that possible?

    (Interestingly, Celeste on Linux doesn't use the dotnet runtime, but instead a portable Mono runtime which I believe is based on MonoKickstart. [1])

    [1] https://github.com/flibitijibibo/MonoKickstart