Added: C# Language Design Notes for Jul 5, 2017 #789
Replies: 20 comments
-
Would like to vote for
In general I am in favor of expanding type system and type system based safety with exception of landing C# syntax in Java and Scala position where in both cases type system was proven unsound: Some of C# soundness proofs were based on syntax used in Java proofs and due to it's limitations and limited scope of proofs (limited subsets of the language syntax) it would be quite interesting if C# syntax has a sound type system verified as whole. Perhaps this same question can be asked for F# and VB as well. |
Beta Was this translation helpful? Give feedback.
-
Could you elaborate on this "unsoundness" that C# (and the CLR suffers) from? That paper seems to largely deal with JVM generics and wildcards. Anyone can tell you how fragile that entire system is. It was designed that way on purpose. Generics on the CLR are significantly different and the same problems can't be exploited due to the generic type arguments being reified and verified at runtime, not just by the compiler. Unless you can demonstrate some specific examples I don't see how the generics arguments apply. As for the "billion dollar mistake", the C# team working on that problem, and literally just published a discussion issue based on their work. But that's not a problem that will fit in the 7.x timeframe, which is why it is not mentioned here. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Looks like winners and losers for everyone there. Appreciate the update on the team's current plans for 7.2. The only oddity is |
Beta Was this translation helpful? Give feedback.
-
A bit sad to see readonly locals and params get pushed out of 7.2. This change would greatly improve programming hygiene. |
Beta Was this translation helpful? Give feedback.
-
That was the one that disappointed me too. Not so much that it's pushed out of 7.2, but that it's pushed to "X.X", rather than keeping it as "7.X" like slicing. |
Beta Was this translation helpful? Give feedback.
-
@orthoxerox @DavidArno IMO it should be 7.2 as this would eliminate a whole class of bugs. |
Beta Was this translation helpful? Give feedback.
-
Most of the However, Static delegates in particular I'm sad won't be available until 8.0 as there doesn't exist a "reasonable" workaround to use this "feature" today. In my existing interop code, I currently have to call This basically means that for every VTBL entry in my interop code I have a minimum 600% memory overhead and a large increased startup cost. For D3D12 interop, the Static delegates, at least for me, cannot come fast enough. |
Beta Was this translation helpful? Give feedback.
-
I assume X here means "probably after 7.2", unless there is a slim chance you're considering it for 7.1. Regardless, this feature is super important to me for interop code where arithmetic on |
Beta Was this translation helpful? Give feedback.
-
Yep, v7.X means after 7.2, if there's 7.3+ releases, otherwise 8.0. What's going to be in 7.1 is now fixed as far as I know (and available for use in the VS2017 Update 3 preview releases).
The issue the team has is that every feature is super important to someone. They'll never please all the people and all that. |
Beta Was this translation helpful? Give feedback.
-
Yep. I understand. Just trying to voice my needs to try and make that X closer to a "3" and not a "8" if possible :-). |
Beta Was this translation helpful? Give feedback.
-
It's better to release more frequently, which necessarily means less in each release. If 8 comes fast I won't mind if stuff is pushed to 8. |
Beta Was this translation helpful? Give feedback.
-
Regarding static delegates, I think introducing |
Beta Was this translation helpful? Give feedback.
-
@alrz, why does Consumers of static delegates, in general, can benefit in their own APIs regardless of whether CoreFX exports types. Having CoreFX provide a set of standard definitions, so you don't have to have new internal types in your own library, is just a bonus (even Desktop Framework didn't get most of the |
Beta Was this translation helpful? Give feedback.
-
It sad that we can't return ref struct on tuple. But can we did it somehow with other syntax?
What we really want is to return multiple reference of struct. It not necessary be tuple |
Beta Was this translation helpful? Give feedback.
-
Most imporant for me are these:
Somewhat important, but I've never had the feeling of "I NEED THIS":
Why were Readonly locals and params pushed to X.X? They are imo a great improvement to the language in terms of self-documenting code and maintainability. |
Beta Was this translation helpful? Give feedback.
-
When I read this list I hope that C# does not become overloaded. None of these things seem to matter in day-to-day programming very much. They seem to be targeted at library authors mostly. I trust that the C# team will not overload the language with niche concepts thereby reducing the total value of the ecosystem. (They have done a great job in the past!) It seems to me that records are far more important than all of these features combined. Records have the potential to significantly change the style we code in. When it becomes easier to declare DTO types (using records) some functional programming ideas become far more attractive. F# feels so fluid in part because abstractions such as functions and DTOs are so easy to produce. C# has gotten more of that over the years which has been fantastic. |
Beta Was this translation helpful? Give feedback.
-
@GSPP, I think that targeting library authors, as well as application authors, is a good thing. C# has introduced a lot of features over the years that make programming things easy, but that doesn't mean that doing it is performant or memory-efficient. For example, LINQ is generally more readable, concise, and maintainable but can quickly lead to perf issues if not used properly. There are a few features here that are niche, but almost all of them are oriented towards writing performant code or towards reducing the number of heap (GC tracked) allocations. These things probably don't matter for LOB apps, but they definitely matter and will make a significant difference for things like CoreFX, desktop/user applications, and even the compiler itself. |
Beta Was this translation helpful? Give feedback.
-
@4creators In answer to your questions: the C# type system is both undecidable and unsound. See the first answer at https://stackoverflow.com/questions/23939168/is-c-sharp-type-system-sound-and-decidable |
Beta Was this translation helpful? Give feedback.
-
@gafter Thanks for the link and answer. Are there any formal models/proofs comprising larger part of C# than those from cited articles? |
Beta Was this translation helpful? Give feedback.
-
C# Language Design Notes for Jul 5, 2017
Triage of features in the C# 7.2 milestone. They don't all fit: which should be dropped, which should be kept, and which should be pushed out?
Please discuss!
Beta Was this translation helpful? Give feedback.
All reactions