3 ms·
I prefer different strategy. I use C++ for encapsulated cases where it makes sense. I compile that C++ into DLLs, and consume these DLLs from C#. C++ is safer
by Const-me 3y ago
I prefer different strategy. I use C++ for encapsulated cases where it makes sense. I compile that C++ into DLLs, and consume these DLLs from C#.
C++ is safer than unsafe Rust. C++ was designed for usability of the unsafe code because the entire ecosystem is unsafe, and have been that way for decades. By now, the tooling is pretty good.
And C# is safer than safe rust due to the VM. Rust compiles to native code. Unlike C# rust requires unsafe to implement any non-trivial data structures.
- nequo 3y agoDo you have an example of C++ being safer than unsafe Rust? As to C# being safer, wouldn’t your comparison need you to take into account unsafe constructs used to implement the C# VM?
- Const-me 3y ago> an example of C++ being safer than unsafe Rust? Not really, that’s just my impression reading stuff about unsafe rust, and programming C++. > wouldn’t your comparison need you to take into account unsafe constructs used to implement the C# VM? Rust compiler depends on LLVM written in C++, kernels for all mainstream OSes are written in C. The probability of bugs in my code I just written is orders of magnitude higher than probability of bugs in these third-party systems.
- nequo 3y ago> Rust compiler depends on LLVM written in C++, kernels for all mainstream OSes are written in C. But this general criticism is just as valid for C# which you say is safer, isn't it? 18.6% of the C# runtime is written in C or C++[1] and you run the runtime on an OS that's largely written in C or C++. [1] https://github.com/dotnet/runtime https://github.com/dotnet/runtime