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
Keep a semi-colon expression terminator please. #5
@sunfishcode The text format should be designed for writing as well as reading, even though the latter is much more common (JSStats beat me to this comment)
If the text format is LES-based, the local variable declarations should probably be expressed as a semicolon-separated list like $0:i32; $1:i32; $2:f64, rather than splitting them across lines which would reduce information density.
@JSStats again, I suggested in my PR to not treat newline as a terminator when directly inside parentheses. This is workable, since you can always add parens to an expression, and it should be easy to implement since it can be done in the lexer alone, unlike more elaborate rules that might also involve the parser.
[Edit: yes, I support allowing; as a terminator, but] I'm don't care that much whether newline is a terminator or not. If it is a terminator, the rule about whether an expr continues on the next line should be simple to parse and simple to explain.
I don't want to make it hard to write by hand, but I don't see the lack of ability to pack multiple statements onto a single line as being a significant obstacle.
I also draw inspiration from gofmt and other tools, which in recent years have demonstrated that while it's easy for humans to become attached to any one particular formatting style, it is possible to adapt, and there are significant advantages to having consistency at larger scales. And since this format puts a greater weight on readability, it seems worthwhile to give consistency even greater weight.
Activity
qwertie commentedon May 24, 2016
Agreed. That's mentioned in my PR.
sunfishcode commentedon May 24, 2016
Please motivate this from the perspective of a "view source" language for a compilation target.
qwertie commentedon May 24, 2016
@sunfishcode The text format should be designed for writing as well as reading, even though the latter is much more common (JSStats beat me to this comment)
If the text format is LES-based, the local variable declarations should probably be expressed as a semicolon-separated list like
$0:i32; $1:i32; $2:f64, rather than splitting them across lines which would reduce information density.qwertie commentedon May 24, 2016
@JSStats again, I suggested in my PR to not treat newline as a terminator when directly inside parentheses. This is workable, since you can always add parens to an expression, and it should be easy to implement since it can be done in the lexer alone, unlike more elaborate rules that might also involve the parser.
qwertie commentedon May 24, 2016
[Edit: yes, I support allowing
;as a terminator, but] I'm don't care that much whether newline is a terminator or not. If it is a terminator, the rule about whether an expr continues on the next line should be simple to parse and simple to explain.sunfishcode commentedon May 24, 2016
I don't want to make it hard to write by hand, but I don't see the lack of ability to pack multiple statements onto a single line as being a significant obstacle.
I also draw inspiration from gofmt and other tools, which in recent years have demonstrated that while it's easy for humans to become attached to any one particular formatting style, it is possible to adapt, and there are significant advantages to having consistency at larger scales. And since this format puts a greater weight on readability, it seems worthwhile to give consistency even greater weight.