You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
What ECMA-334 is and why it doesn't correspond to C# versions? #1390
Right now on the official site I see that latest version of the ECMA-334 standard is 7 released on December 2023. When I open the PDF file and look into Keywords section, I don't see, for example, and keyword which has been added in C# 9 on November 2020 (by the way, now we have C# 13). More than that, there is no such keyword even in draft-v9 branch of your repo.
My questions are:
Why text of the standard differs so much from latest C# versions used many years in production around the world?
I suppose the language standard should follow C# versions. So in fact we should have much more revisions of the document, right?
If not, what purpose of the ECMA-334 standard? It looks very outdated.
By the way, where we can find full C# 9, 10, 11, 12, 13 language grammar? I suppose it should be public information. But I have no idea where I can see it.
Look in the admin directory in this repository. There are lists of language features that have been approved for C# 8 or 9 but have not been added to the standard yet.
As for why this is lagging. I think it's a matter of different goals. Microsoft defines new features, implements them in their Roslyn compiler, and documents them sufficiently to let programmers use them on .NET. Whereas here the specification tries to define the language in sufficient detail to let any vendor implement it in their own compiler, or in a compliance test suite, and does not require .NET. And I assume the projects do not get the same amount of funding.
(Personally, I use C# in my work and would like to have a standard from which I could check how things are supposed to work, as opposed to how a single vendor implements them. I have been commenting here occasionally as I find errors in the drafts. Although perhaps those comments delayed the C# 7 standard even more.)
@KalleOlaviNiemitalo But we have C# 13 now and we write code with C# 13. How such a big lag can exist between standard and actual language?
Whereas here the specification tries to define the language in sufficient detail to let any vendor implement it in their own compiler
Yes, I understand that. But by this logic, right now vendors can create their own compiler only for C# 7. This version is released almost 8 years ago. Which sounds extremely strange and wrong from the perspective of respect to those vendors.
Maybe I'm wrong but ECMA-334 looks useless right now :-( Who drives publishing of the standard? Microsoft or just .NET Foundation (as far as I know it doesn't related to MS)?
@melanchall The intent of the committee producing the official C# standard (ECMA-TC49/TG2) is that standard versions match product versions of the same number (except that Ecma V7 matched the cumulative result of all product V7.x versions).
The draft-v9 branch was copied from an early version of draft-v8, and has only some of the V8 features and none of the V9 features. Once V8 is completed (which will hopefully be in the next 6 months), draft-v9 will be rebased to include all the V8 features. And then as V9 PRs are merged into that new base, draft-v9 will grow to reflect that.
If you look at PRs having Milestone C# 9.0, you will see PRs for each V9 feature, all separate from each other. PR #1026 adds the conditional keywords and, or, and not.
Once V8 is completed, draft-v10 will be created as an exact copy of the then-current draft-v9, and against that I will create one PR for each V10 feature, with a C# V10 milestone. (And as new standard versions are completed, that approach will be repeated for V11, V12, and so on.)
Regarding the grammar for V9-and-above features, see https://github.com/dotnet/csharplang/tree/main/proposals. Note, however, that there may be small and/or large changes to what is on those MS specs and what finally goes into the Standard. For example, some of the MS specs contain more than a little information about how their implementation works , which may well be omitted from the standard. (V8's Index/Range proposal is one such example.) The grammar changes for each feature in the final standard might also be different from the MS proposals.
Finally, ECMA-TC49/TG2 has a small number of active members working on the V8 standard, and around half of them are (unpaid) volunteers. We only meet as a group for 2 hours each month, and rely on members doing work between meetings.
Once V8 is completed (which will hopefully be in the next 6 months)
By this time C# 14 will be released...
I have a couple more questions just to clarify the situation:
Does Microsoft participate or interested in development of the standard?
Why MS can't provide human resources to keep standard in sync with actual C# versions? Your work directly related with making C# more popular language.
I'm pretty sure MS internally have the grammar described for each version of C#. Why they can't just provide it to you?
The intent of the committee producing the official C# standard (ECMA-TC49/TG2) is that standard versions match product versions of the same number (except that Ecma V7 matched the cumulative result of all product V7.x versions).
From what version of the standard this is true? Because on the official site I see this:
ECMA-334, 1st edition, December 2001. But C# 1.0 has been released on January 2002;
ECMA-334, 2nd edition, December 2002. But C# 2.0 has been released on November 2005;
ECMA-334, 3rd edition, June 2005. But C# 3.0 has been released on November 2007;
and so on;
there is also a big pause after ECMA-334, 4th edition: 11 years.
I think I'm wrong, but in my opinion the most important part of the standard of a programming language is its grammar. You and MS can provide such a grammar for public usage. For example, in ANTLR format. It will allow other people to build compilers automatically. Or MS is against third-party build tools?
I respect all your work, but if the things will go the same way, the standard looks pretty useless since it always will be very outdated...
Yes, this is true. The only good news is that C# 8 is that last release that was mutiple years in development. We believe we can move faster starting with C# 9 (more justification for that belief below).
Does Microsoft participate or interested in development of the standard?
Yes, I'm on the committee, and a member of C# LDM. I also consult regularly with Mads and other LDM members when we have questions. This doesn't exclude any other members from reaching out directly, but to say I generally act as liasion when needed.
Why MS can't provide human resources to keep standard in sync with actual C# versions? Your work directly related with making C# more popular language.
It's a balance. I also can't spend all my time on the standard. The more I spend on this project, the less I can spend on the C# guide, which is more conversational and more approachable.
I'm pretty sure MS internally have the grammar described for each version of C#. Why they can't just provide it to you?
They do, and that's our starting point for each new feature PR. Furthermore, as you look at the newer releases, the feature speclets define both grammar and textual changes to the standard. This is another reason we hope to accelerate our pace on the newer versions in the standard.
The intent of the committee producing the official C# standard (ECMA-TC49/TG2) is that standard versions match product versions of the same number (except that Ecma V7 matched the cumulative result of all product V7.x versions).> >
From what version of the standard this is true? Because on the official site I see this:
ECMA-334, 1st edition, December 2001. But C# 1.0 has been released on January 2002;
ECMA-334, 2nd edition, December 2002. But C# 2.0 has been released on November 2005;
ECMA-334, 3rd edition, June 2005. But C# 3.0 has been released on November 2007;
and so on;
there is also a big pause after ECMA-334, 4th edition: 11 years.
Starting with 6, this is generally true. The reality is that the committee was dormant for many years, before being reinvigorated for the C# 6 effort. That was very time consuming, because the ECMA spec and the Microsoft spec had diverged. This is another reason we believe we can accelerate progress. There's now only one published standard: The ECMA standard.
I think I'm wrong, but in my opinion the most important part of the standard of a programming language is its grammar. You and MS can provide such a grammar for public usage. For example, in ANTLR format. It will allow other people to build
compilers automatically. Or MS is against third-party build tools?
One of the most important parts of the work on the committee is to produce the grammar and the accompanying normative text that describes the semantics of the language. There are locations where the grammar only can't describe a feature fully. The work of the committee is to crate that normative language.
@BillWagner Thank you for such detailed answer! By the way, I've asked for the grammar in the dotnet/roslyn repo and they helped me to discover Syntax.xml file which describes rules for the language (it's just internal XML file, not ANTLR grammar, but that's good too).
Activity
KalleOlaviNiemitalo commentedon Aug 10, 2025
Look in the
admindirectory in this repository. There are lists of language features that have been approved for C# 8 or 9 but have not been added to the standard yet.KalleOlaviNiemitalo commentedon Aug 10, 2025
As for why this is lagging. I think it's a matter of different goals. Microsoft defines new features, implements them in their Roslyn compiler, and documents them sufficiently to let programmers use them on .NET. Whereas here the specification tries to define the language in sufficient detail to let any vendor implement it in their own compiler, or in a compliance test suite, and does not require .NET. And I assume the projects do not get the same amount of funding.
(Personally, I use C# in my work and would like to have a standard from which I could check how things are supposed to work, as opposed to how a single vendor implements them. I have been commenting here occasionally as I find errors in the drafts. Although perhaps those comments delayed the C# 7 standard even more.)
melanchall commentedon Aug 10, 2025
@KalleOlaviNiemitalo But we have C# 13 now and we write code with C# 13. How such a big lag can exist between standard and actual language?
Yes, I understand that. But by this logic, right now vendors can create their own compiler only for C# 7. This version is released almost 8 years ago. Which sounds extremely strange and wrong from the perspective of respect to those vendors.
Maybe I'm wrong but ECMA-334 looks useless right now :-( Who drives publishing of the standard? Microsoft or just .NET Foundation (as far as I know it doesn't related to MS)?
KalleOlaviNiemitalo commentedon Aug 10, 2025
There is a lot of work to be done in the drafting of new versions, and it isn't getting done quickly enough to catch up.
I think there are several ways it can proceed from here:
RexJaeschke commentedon Aug 10, 2025
@melanchall The intent of the committee producing the official C# standard (ECMA-TC49/TG2) is that standard versions match product versions of the same number (except that Ecma V7 matched the cumulative result of all product V7.x versions).
The draft-v9 branch was copied from an early version of draft-v8, and has only some of the V8 features and none of the V9 features. Once V8 is completed (which will hopefully be in the next 6 months), draft-v9 will be rebased to include all the V8 features. And then as V9 PRs are merged into that new base, draft-v9 will grow to reflect that.
If you look at PRs having Milestone C# 9.0, you will see PRs for each V9 feature, all separate from each other. PR #1026 adds the conditional keywords
and,or, andnot.Once V8 is completed, draft-v10 will be created as an exact copy of the then-current draft-v9, and against that I will create one PR for each V10 feature, with a C# V10 milestone. (And as new standard versions are completed, that approach will be repeated for V11, V12, and so on.)
Regarding the grammar for V9-and-above features, see https://github.com/dotnet/csharplang/tree/main/proposals. Note, however, that there may be small and/or large changes to what is on those MS specs and what finally goes into the Standard. For example, some of the MS specs contain more than a little information about how their implementation works , which may well be omitted from the standard. (V8's Index/Range proposal is one such example.) The grammar changes for each feature in the final standard might also be different from the MS proposals.
Finally, ECMA-TC49/TG2 has a small number of active members working on the V8 standard, and around half of them are (unpaid) volunteers. We only meet as a group for 2 hours each month, and rely on members doing work between meetings.
melanchall commentedon Aug 11, 2025
@KalleOlaviNiemitalo @RexJaeschke Thank you for your answers!
By this time C# 14 will be released...
I have a couple more questions just to clarify the situation:
Does Microsoft participate or interested in development of the standard?
Why MS can't provide human resources to keep standard in sync with actual C# versions? Your work directly related with making C# more popular language.
I'm pretty sure MS internally have the grammar described for each version of C#. Why they can't just provide it to you?
From what version of the standard this is true? Because on the official site I see this:
I think I'm wrong, but in my opinion the most important part of the standard of a programming language is its grammar. You and MS can provide such a grammar for public usage. For example, in ANTLR format. It will allow other people to build compilers automatically. Or MS is against third-party build tools?
I respect all your work, but if the things will go the same way, the standard looks pretty useless since it always will be very outdated...
BillWagner commentedon Aug 11, 2025
@melanchall
Yes, this is true. The only good news is that C# 8 is that last release that was mutiple years in development. We believe we can move faster starting with C# 9 (more justification for that belief below).
Yes, I'm on the committee, and a member of C# LDM. I also consult regularly with Mads and other LDM members when we have questions. This doesn't exclude any other members from reaching out directly, but to say I generally act as liasion when needed.
It's a balance. I also can't spend all my time on the standard. The more I spend on this project, the less I can spend on the C# guide, which is more conversational and more approachable.
They do, and that's our starting point for each new feature PR. Furthermore, as you look at the newer releases, the feature speclets define both grammar and textual changes to the standard. This is another reason we hope to accelerate our pace on the newer versions in the standard.
Starting with 6, this is generally true. The reality is that the committee was dormant for many years, before being reinvigorated for the C# 6 effort. That was very time consuming, because the ECMA spec and the Microsoft spec had diverged. This is another reason we believe we can accelerate progress. There's now only one published standard: The ECMA standard.
One of the most important parts of the work on the committee is to produce the grammar and the accompanying normative text that describes the semantics of the language. There are locations where the grammar only can't describe a feature fully. The work of the committee is to crate that normative language.
melanchall commentedon Aug 12, 2025
@BillWagner Thank you for such detailed answer! By the way, I've asked for the grammar in the dotnet/roslyn repo and they helped me to discover Syntax.xml file which describes rules for the language (it's just internal XML file, not ANTLR grammar, but that's good too).
RexJaeschke commentedon Aug 12, 2025
@melanchall As it appears we have completed this discussion and no TG2 action is required, I'm closing this issue.