Open ehuss opened 6 years ago
@Centril corrected some of my misunderstanding here. However, I think the general concern still stands. Many language specs include a simple, textual grammar without precedence or disambiguation. In my experience, grammars that include these rules can be quite difficult to follow.
How will the grammar be used with the reference?
The reference has a nearly complete grammar now, but it is in an ad-hoc language, isn't testable, and its goals are different from the grammar for this group. This is an open-ended issue to brainstorm how the two can relate.
I'll spew some thoughts I have related to this:
The reference's audience is a typical Rust programmer, not a language-lawyer or parser writer. Some differences I see:The reference should be easily understood and not complicated with issues like ambiguity and precedence (which are discussed in prose). Can the wg-grammar grammar produce something that is clear enough for that context?Sometimes the reference grammar includes semantic rules and conceptual differences in order to more clearly express what a valid Rust program looks like. How much of an issue is this?I'd be fine with maintaining manual translations if necessary. Perhaps this issue will become clearer once the wg has made some progress.
I posted a similar issue at https://github.com/rust-lang-nursery/reference/issues/443.