DirectMyFile / dep-destructuring

Dart Enhancement Proposal for Destructuring
13 stars 2 forks source link

Write Language Specification Changes #6

Open azenla opened 9 years ago

azenla commented 9 years ago

@lhrn: Is it possible for you to assist me with the language spec? I'm not very good at writing those kind of things, and you seem like somebody who knows what they are doing.

gbracha commented 9 years ago

Hi Kenneth,

Lasse is indeed a good person to consult about spec wording. Precise wording is something I can help with as well. Here is some free advice (possibly worth what you paid for it):

As a first step, you need to move beyond examples and give rules describing what should happen. The rules need to cover every possible case. Typical proposals for PL features fall into the trap of relaying on examples/use cases. The problem is that situations that one did not foresee arise and the compiler and runtime need to handle these somehow.

Even if your initial wording is sloppy, giving rules is an important first step.

Another common trap is focusing on syntax. Most language discussions rathole into syntax, while ignoring semantics, which is much more important.

So try and write up rules for what the proposed new syntax means. Remember that the right hand side of an assignment is an expression, and try and cover all the cases you can imagine.

You need to say what happens at runtime, and remember that in Dart the runtime behavior cannot be impacted by the static types - except for checked mode (see below).

You need to give rules for static checking (warnings) and for dynamic checking (checked mode)

You need to say what is the static type of any expressions you introduce. Are you introducing new expressions? There seems an issue with the proposal wrt to expressions. I'll file a separate issue about that.

azenla commented 9 years ago

@gbracha Thanks for the help :)

azenla commented 9 years ago

@gbracha Are you able to take a look at what I currently have and give me feedback from your perspective? Also, it would be great if you could look at https://github.com/DirectMyFile/dep-spaceship too. I want to get better at writing these so I can put a lot of my ideas into proposals :)

Also, on another note, I highly respect you. I've been looking into a lot of your work, and I am very impressed.