Skip to content

Keep a semi-colon expression terminator please. #5

Open

Description

I like to be able to put multiple expressions on one line.

Activity

  1. qwertie commented on May 24, 2016

    @qwertie

    Agreed. That's mentioned in my PR.

  2. sunfishcode commented on May 24, 2016

    @sunfishcode
    Owner

    Please motivate this from the perspective of a "view source" language for a compilation target.

  3. qwertie commented on May 24, 2016

    @qwertie

    @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.

  4. qwertie commented on May 24, 2016

    @qwertie

    @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.

  5. qwertie commented on May 24, 2016

    @qwertie

    [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.

  6. sunfishcode commented on May 24, 2016

    @sunfishcode
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions