4 ms·
You need some way of managing ownership, but it doesn't necessarily need to bubble up to the user level. For instance Swift is going in the direction of leanin
by skohan 5y ago
You need some way of managing ownership, but it doesn't necessarily need to bubble up to the user level. For instance Swift is going in the direction of leaning heavily on value semantics, plus the actor model to wrap concurrent data, to create a safe environment where the user doesn't have to think about ownership at all.
Of course there's tradeoffs involved, but I think there are multiple approaches to achieve safety and user-space ownership constraints are only one of them.
- pjmlp 5y agoMost GC languages invented before Java went mainstream had value semantics as well actually, and this is one of language defects that .NET improved over Java. Many forget that MSIL is like LLVM, having all semantics to compile C++, alongside GC. Some of those capabilities weren't exposed to other .NET languages, however since C# 7 they have been improving it. As of C#10, there is little left to do versus Modula-3 or D.
- int_19h 5y agoLow-level C# could still use https://github.com/dotnet/csharplang/issues/1060 https://github.com/dotnet/csharplang/issues/1060 - then we could steal all the high-perf generic algorithms from the C++ guys, and call it good.
- pjmlp 5y agoYeah, although maybe with native function pointers and static lambdas one could try to work around it.