Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Issue 2399343002: Change how the language specification describes control flow. (Closed)

Created:
4 years, 2 months ago by Lasse Reichstein Nielsen
Modified:
4 years ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Change how the language specification describes control flow. Changed to compositionally describing how an expression or statement can complete (normally, throw, return, break, continue), and propagating the completion to the surrounding statements handling those behaviors. This should not change the current behavior except in a few cases where the existing specification was vague, misleading or just wrong. Actual changes: - The super call in an initializer list is now always called at the end, even if it is allowed to be written earlier. This matches existing VM behavior. Initialization of initializer expressions are specified as part of constructor execution, not something happening at the `new` operator. - The cancel call to a stream subscription when exiting an async for-in loop is now made explicit, and its returned future is explicitly awaited for. Previously it was unclear what happened with that future. - Pausing a surrounding async-for loop has been added everywhere the body of the loop can suspend, just before the suspension. The loop subscription is not resumed until reaching the end of the body, which is equivalent to resuming it after each suspend and then pausing it again when the synchronous execution reaches the next suspend. So, easier and doesn't change the behavior of the loop itself, but it's a visible change if you check the onPause/onResume of the loop stream. Spec now recognizes that the pause call may throw on an invalid implementation of StreamSubscription. Addresses issues #25859, #25856, #25850, #25848, #25847, #25749, #25634, #25539, #25421, #25412, #25381, #25234, #25005, #24859, #24748, #23779, #23700, #23628, #22908, #21858 (and likely more). BUG= http://dartbug.com/25859 http://dartbug.com/25856 http://dartbug.com/25850 http://dartbug.com/25848 http://dartbug.com/25847 http://dartbug.com/25749 http://dartbug.com/25634 http://dartbug.com/25539 http://dartbug.com/25421 http://dartbug.com/25412 http://dartbug.com/25381 http://dartbug.com/25234 http://dartbug.com/25005 http://dartbug.com/24859 http://dartbug.com/24748 http://dartbug.com/23779 http://dartbug.com/23700 http://dartbug.com/23628 http://dartbug.com/22908 http://dartbug.com/21858 R=eernst@google.com Committed: https://github.com/dart-lang/sdk/commit/843bb96813f9a171c7257fcd5e282ff1d323c53d

Patch Set 1 #

Total comments: 126

Patch Set 2 : Merge to head, fix typos #

Patch Set 3 : Fix description of "stream raising an error". #

Total comments: 107

Patch Set 4 : Address comments from kmillikin. #

Total comments: 82

Patch Set 5 : Merge to head #

Patch Set 6 : First round of comment addresses. #

Patch Set 7 : Address remaining comments #

Patch Set 8 : Merge to head. Fix typos. #

Patch Set 9 : Merge to head #

Patch Set 10 : LaTeX fixes #

Total comments: 72

Patch Set 11 : Address comments. #

Patch Set 12 : Change LMLabel to label for completion and evaluation. #

Patch Set 13 : Without the typo #

Patch Set 14 : Update version number #

Unified diffs Side-by-side diffs Delta from patch set Stats (+479 lines, -360 lines) Patch
M docs/language/dartLangSpec.tex View 1 2 3 4 5 6 7 8 9 10 11 12 13 70 chunks +479 lines, -360 lines 0 comments Download

Messages

Total messages: 21 (6 generated)
Lasse Reichstein Nielsen
WDYT? If reasonable, I'll forward it to implementors too.
4 years, 2 months ago (2016-10-07 08:44:31 UTC) #3
floitsch
DBC. Haven't yet finished the review... https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode1 docs/language/dartLangSpec.tex:1: 4\documentclass{article} typo? https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode1397 ...
4 years, 2 months ago (2016-10-10 18:58:15 UTC) #6
Lasse Reichstein Nielsen
https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode1 docs/language/dartLangSpec.tex:1: 4\documentclass{article} That, or advanced LaTeX magic - who knows? ...
4 years, 2 months ago (2016-10-11 07:52:43 UTC) #7
Kevin Millikin (Google)
https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode2376 docs/language/dartLangSpec.tex:2376: Expressions can also {\em throw} an exception object and ...
4 years, 2 months ago (2016-10-13 08:38:28 UTC) #9
Kevin Millikin (Google)
This approach is definitely simpler. I still haven't read it all closely. https://codereview.chromium.org/2399343002/diff/40001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex ...
4 years, 2 months ago (2016-10-13 12:18:38 UTC) #10
Lasse Reichstein Nielsen
https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode2376 docs/language/dartLangSpec.tex:2376: Expressions can also {\em throw} an exception object and ...
4 years, 2 months ago (2016-10-17 10:08:24 UTC) #11
eernst
OK, I reached line 5800 at this point, and it goes on and on. Here ...
4 years, 2 months ago (2016-10-17 16:44:58 UTC) #12
eernst
Lots of comments. PS, for other reviewers: Finally Lasse an I agree on a terminology ...
4 years, 2 months ago (2016-10-19 13:37:07 UTC) #13
Lasse Reichstein Nielsen
Initial comments https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode1215 docs/language/dartLangSpec.tex:1215: A {\em generative constructor} is executed to ...
4 years, 2 months ago (2016-10-19 14:34:32 UTC) #14
Lasse Reichstein Nielsen
All (I hope) comments addressed, PTAL https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/1/docs/language/dartLangSpec.tex#newcode1215 docs/language/dartLangSpec.tex:1215: A {\em generative ...
4 years, 1 month ago (2016-10-31 16:54:45 UTC) #15
eernst
Reached line 6430, will recover now, and finish the review tomorrow. ;-) https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex ...
4 years ago (2016-11-23 16:26:43 UTC) #16
eernst
Just one typo this time. LGTM!! https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLangSpec.tex#newcode6563 docs/language/dartLangSpec.tex:6563: Otherwise, $x$, or ...
4 years ago (2016-11-24 11:56:28 UTC) #17
Lasse Reichstein Nielsen
https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLangSpec.tex#newcode1218 docs/language/dartLangSpec.tex:1218: A {\em constructor} is a special function that is ...
4 years ago (2016-11-25 08:30:37 UTC) #18
Lasse Reichstein Nielsen
Committed patchset #14 (id:260001) manually as 843bb96813f9a171c7257fcd5e282ff1d323c53d (presubmit successful).
4 years ago (2016-11-25 08:31:16 UTC) #20
eernst
4 years ago (2016-11-25 09:29:00 UTC) #21
Message was sent while issue was closed.
Just acknowledging the final comments.

https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLang...
File docs/language/dartLangSpec.tex (right):

https://codereview.chromium.org/2399343002/diff/180001/docs/language/dartLang...
docs/language/dartLangSpec.tex:5858: loop is unspecified.
On 2016/11/25 08:30:35, Lasse Reichstein Nielsen wrote:
> (1) Sure it does. For example, it doesn't say how "await" waits for a future
to
> complete. It must be done by adding a `then` listener and either an onError
> callback on the then or a catchError call to get the error. It's completely
> unspecified what happens if a badly implemented future calls both callbacks or
> calls one of the callbacks twice.
> The problem is generally with the specification handing out callbacks and
making
> *any* assumption about how they are invoked. 
> 
> It's hard to avoid that problem completely without overspecifying the
semantics
> and adding significant overhead to implementations, and for no practical
reason
> in all but completely borked programs.
> 
> We could say that it's an error to invoke such a callback twice, but that
means
> that all callbacks need extra logic to detect it. For async code compiled into
> CPS style, the same callback may be used more than once (e.g., in a loop). I
> prefer to say what the behavior is for a correct future or stream, and let the
> implementation handle the remainig cases as best-effort. 
> 
> 
> I don't think it's normative. Saying that something isn't specified is wrong
if
> it is actually specified, and it's redundant if it isn't specified anywhere.
> Being redundant, I think it's normative.
> That said, I've updated the wording to be less intimidating.

OK, acknowledged!

Powered by Google App Engine
This is Rietveld 408576698