4 ms·
This is awesome! I'm really liking the .NET Core. Seems like a really productive platform with no obvious downsides (good performance, and cross-platform compa
by gandreani 6y ago
This is awesome!
I'm really liking the .NET Core. Seems like a really productive platform with no obvious downsides (good performance, and cross-platform compatibility?)
You did a lot in 1.5 months. How much would you contribute your speed to the platform of choice vs your experience vs time available, etc?
- Const-me 6y agoEverything has downsides. ARM Linux support is lacking. To make my library easy enough to use, I had to make the Debian package myself. Wasn’t too hard, here’s a bash script https://github.com/Const-me/Vrmac/blob/master/net-core/package https://github.com/Const-me/Vrmac/blob/master/net-core/packa... but still. The newer .NET Core-introduced features are still not integrated perfectly into the older ecosystem. The new ref structs can’t be generic arguments, resulted in copy-pasting there: https://github.com/Const-me/Vrmac/blob/1.0/Vrmac/Draw/Text/Kompiler.cs#L203-L225 https://github.com/Const-me/Vrmac/blob/1.0/Vrmac/Draw/Text/K... For some use cases, generics are not good enough, again had to copy-paste a few lines: https://github.com/Const-me/Vrmac/blob/1.0/Vrmac/Draw/Main/ImmediateContext.upload.cs#L97-L132 https://github.com/Const-me/Vrmac/blob/1.0/Vrmac/Draw/Main/I... This last one can be trivially solved with OOP stuff, however I didn’t want any virtual calls or heap allocated objects in that particular place of code, for performance reasons. Even in the latest .NET Core 3.1, SIMD support is not good enough. Compiler generates very inefficient code: https://github.com/dotnet/runtime/issues/13811 https://github.com/dotnet/runtime/issues/13811 ARM Neon support is lacking. Even on PCs, in my C++ I needed instructions, both vector like vcvtph2ps and scalar like BSR, not exposed to .NET but readily available as compiler intrinsics in C++, including ARM-targeted gcc on Linux. But overall, .NET is quite good. Sometimes it can even beat C++ performance wise, like I did there https://github.com/Const-me/Vrmac/blob/master/Vrmac/Draw/Text/Kompiler.cs#L9-L15 https://github.com/Const-me/Vrmac/blob/master/Vrmac/Draw/Tex... or there https://github.com/Const-me/Vrmac/blob/master/Vrmac/Input/KeyboardLayout/LayoutBuilder.cs#L10-L12 https://github.com/Const-me/Vrmac/blob/master/Vrmac/Input/Ke... by embedding data into code and passing the code to JIT. The readability suffers, though. I’m equally proficient in C++ and I would estimate it would take me 2x longer to do completely in C++. (1) GC is just too good to ignore for non-performance critical parts. (2) Runtime library is awesome in .NET: I/O, compression, text handling, weak references, async-await, thread pool helped a lot. The C++ equivalents are either nonexistent, or twice as hard to use. At least based on my experience.
- pjmlp 6y agoSame here, already back in 2006 it was clear to me that one could get a long way in Java and .NET, only turning to C++ for critical code paths. And since then, while not perfect, the use cases where it is required deminishes with each platform release. Plus any of the languages are better options than plugging a scripting language. Good job.