dart-lang / dart-lang/language

Make specification of desugaring well-defined.

Open
#227 2 comments 0 reactions 0 assignees View on GitHub
specification
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

The language specification currently uses the phrase 'is equivalent to' in a number of cases involving two syntactic forms. For instance:

```
An \ON{}-\CATCH{} clause of the form
\code{\ON{} $T$ \CATCH{} ($p_1$) $s$}
is equivalent to an \ON{}-\CATCH{} clause
\code{\ON{} $T$ \CATCH{} ($p_1$, $p_2$) $s$}
where $p_2$ is a fresh identifier.
```

The intention is that the language can be slightly simplified by a process which is often designated as "desugaring", by specifying that certain constructs are just syntactic abbreviations of some other constructs (where the unfolding is allowed to go beyond syntax in the sense that static semantic information like types can be used to determine whether and how to unfold). Having said this, we have then specified the sugared form fully, as long as we can find the specification of the desugared form in other parts of the language specification.

The inherent symmetry of the phrase 'is equivalent to' is not appropriate for this purpose, because it blurs the roles. For instance, "which form is sugared and which one is desugared?", "is this a desugaring relationship at all?", "do we enforce that this relationship has no cycles?".

This issue is concerned with a modification of the language specification to use 'is treated as' rather than 'is equivalent to', and at the same time ensure that we have the correct layering (such that the desugared language is well-defined, e.g., by not having any cycles).

Contributor guide

Open the contributing guide

Research direction

Begin by locating every use of “is equivalent to” in the language specification and cataloging the syntactic forms involved. Trace each desugaring dependency to identify the intended direction and any cycles, then update the specification so “is treated as” gives a well-defined layering.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.