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
The goal of this would be to simplify the spec of Wyvern, with benefits for implementation, for the understandability of error messages, and for learning the language. The cost is a slightly higher annotation burden.
Right now, anytime there is a random indent, we assume it is a DSL unless a keyword like "type" or "def" or "match" leads us to expect an indent for something else.
Sometimes this leads to weird error messages, where the user indented and hears something about a DSL but they never intended that. There are also strange interactions with comments, particularly /* / style. If you indent and add a comment, the lexer infers a DSL, which then must be heuristically stripped out (see DSLLines() in WyvernParser.jj). Since // may wrap lines, and DSLs can wrap lines but require indentation (which / */ does not), there are weird error cases, like indenting, starting a comment, and continuing the comment without indentation.
It would be better if you can always determine if line X+1 is a DSL by looking at line X. That would require some signal. We could always require a ~, so that if would look like
if (x > 0) ~
something
else
something else
Or we could be pythonic:
if (x > 0):
something
else:
something else
The text was updated successfully, but these errors were encountered:
In my head this is related to the lambdas issue, it is all about what language makes explicit and what it makes implicit as you add more features. The original goal with TSL's was to make them everywhere and thus it is "normal" to expect DSL errors everywhere because everything is TSL of some sort - almost every kind of expression. Surely making DSL's explicit will detract from this goal of Wyvern (the goal of composable language)?
The goal of this would be to simplify the spec of Wyvern, with benefits for implementation, for the understandability of error messages, and for learning the language. The cost is a slightly higher annotation burden.
Right now, anytime there is a random indent, we assume it is a DSL unless a keyword like "type" or "def" or "match" leads us to expect an indent for something else.
Sometimes this leads to weird error messages, where the user indented and hears something about a DSL but they never intended that. There are also strange interactions with comments, particularly /* / style. If you indent and add a comment, the lexer infers a DSL, which then must be heuristically stripped out (see DSLLines() in WyvernParser.jj). Since / / may wrap lines, and DSLs can wrap lines but require indentation (which / */ does not), there are weird error cases, like indenting, starting a comment, and continuing the comment without indentation.
It would be better if you can always determine if line X+1 is a DSL by looking at line X. That would require some signal. We could always require a ~, so that
if
would look likeOr we could be pythonic:
The text was updated successfully, but these errors were encountered: