3 ms·
> C# 9 is at the same level as D and Nim What do you mean? How does one reach D/Nim levels of performance (or did you mean expressivity) in C#? I'm experimenti
by generichuman 6y ago
> C# 9 is at the same level as D and Nim
What do you mean? How does one reach D/Nim levels of performance (or did you mean expressivity) in C#? I'm experimenting with Nim for gamedev these days, I might be persuaded to take another look at C# depending on your answer.
Also, what is the HPC# subset? Any resources to read about that?
- pjmlp 6y agoAs of .NET 5 and C# 9 (also applies partially to F# and VB) you can: - use structs like in C - do safe stack allocations for arrays - use GC free heap allocations and map them to memory slices - GC free code regions - static lambdas - machine numeric types - static lambdas - native function pointers - native sized numeric types - more control over structs layout and usage - using available in any type that implements Dispose pattern even if the interface isn't adopted - you can make use of Roslyn to ensure using is not forgotten - unsafe and native pointers - vector types for SIMD, NEON and AVX - you can generate MSIL on the fly similarly to what C++/CLI compiler would have done. Naturally this trick requires unsafe Assemblies. HPC# is a C# subset created by Unity with the long term roadmap goal to replace C++ on Unity. Although it looks like a C# subset and plain .NET types, there is a new compiler, Burst, that is aware of those special types. There is also an ECS framework that goes alongside it, DOTS. The founding members of the projects are ex Psygnosis employees well known in the C++ community. https://docs.unity3d.com/Packages/com.unity.burst@1.5/manual/index.html https://docs.unity3d.com/Packages/com.unity.burst@1.5/manual... https://youtu.be/BpwvXkoFcp8 https://youtu.be/BpwvXkoFcp8 https://youtube.com/playlist?list=PLX2vGYjWbI0QRLkvupULwSZCPkLyHs-UX https://youtube.com/playlist?list=PLX2vGYjWbI0QRLkvupULwSZCP...