I currently have Go/Kotlin/Java/JS/C in my stack and I’m looking to expand it… considering using C++ for certain things but C# may be interesting to replace Java
Discussion
Yeah I mean if you are serious and not trying to be a language maxi, I think there are some really high performance things you can do with highly optimized C#. Specifically you can see in my core lib, its largely composed of C libraries which I link at runtime into C#. Almost all dynamic or short-lived allocations are done on an unmanaged heap. I vendor mimalloc, and rpmalloc, but mostly use rpmalloc for pre-build distributions like vncache here.
rpmalloc is a bit outdated and I'm going to have to revamp it myself but it's still a great allocator. I already have some work converting the memcache backend in vncache over to C.
I personally like the .NET sophisticated async + threadpool, good windows support with async callbacks/upcall support, windows kernel features like socket-accept buffering among others. It's also highly runtime configurable. I know many other languages at this point do similar things in similar ways, but being able to use ELF libraries or .NET assemblies at runtime like dlopen() does is super neat. It's also been 5 years in the making.
VNCache is actually just a plugin for VNLib.Webserver (part of core) which is essentially a runtime. It loads plugin assembly files (and can unload them) dynamically.
I could spend hours talking about my arhcitecture, but really it's been about only use what you need, and a lego style modular framework where the application housekeeping code is isolated from the application code.
I guess my main question is compatibility with non-MS systems.
Good to hear you can easily use C libraries
I CI test and deploy on bare metal debian and fedora systems without issue. It just has less of those performance tuning things in comparison. Like socket structure reuse in the kernel. just because they have a totally different kernel model, which is partially why polling is highly used on Linux in comparison.
I think it's worth pointing out that technically C# and .NET are separate. Using ms tools generally target .NET.
You can use any ELF library, and even C# + .NET supports mixed managed C++ code as well. Meaning you can use a few pragmas and link against the .NET runtime library and now you can intermix C++ and C# classes without any Pinvoke overhead. I had been told that mono (an alterntaive to .NET) that can run C# actually supports calling native code without any pinvoke overhead, but it has too many shortcomings for my work that I haven't switched to mono. Pinvoke has gotten much more performant in that past releases.
So technically it supports rust or whatever supports dlopen();
Downsides though, if you want to write aforementioned mixed C# and C++ code, it's not really documented well. Generally .NET wants you to use pinvoke instead.
May stick with Go and Java for now but sounds interesting.
I also like java, I just found tooling and C-ish syntax more appealing when starting out. Ring me up if you ever want to try some fun things out like breaking the GC guarantees with unmanaged code ;)
visual studio build tools also supports mixed code debugging, so if you need to jump into a dll or read assembly as your debugging your managed code, you can step through it as long as debug symbols are available.