{"action":"created","comment":{"url":"https://api.github.com/repos/dart-lang/language/pulls/comments/238017668","pull_request_review_id":180469145,"id":238017668,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODAxNzY2OA==","diff_hunk":"@@ -0,0 +1,874 @@\n+# Sound non-nullable (by default) types with incremental migration \n+\n+Author: leafp@google.com\n+\n+This document proposes a roadmap for implementing a sound null tracking type\n+system in Dart similar to what has been\n+explored [previously](https://github.com/dart-lang/sdk/pull/28619/files).  The\n+purpose of this document is not to describe the technical details of a proposal,\n+but instead to argue for a specific set of high-level goals and design choices\n+that define the key properties of the final system, and of the migration path to\n+get there.  Specifically, we propose to aim for a system which allows for an\n+incremental opt-in migration, and which is fully sound once all code in a\n+compilation target has opted-in.\n+\n+## Motivation for non-nullability in Dart.\n+\n+This has been fairly well explored previously, so just in brief.  This is one of\n+the most requested features in developer surveys, and one of the thing that\n+developers most frequently mention missing from other languages.  Kotlin, Swift,\n+C#, Typescript, and numerous other languages now have support for\n+non-nullability.  Since Dart also has no primitive types or value types, it is\n+possible that non-nullability could provide performance benefits as well.\n+\n+## Summary of proposed goals\n+\n+We propose to set the following goals for nullability tracking in Dart.\n+\n+- The type system should be incrementally sound.  That is, compilation should be\n+possible with a mix of opted-in and non-opted-in code, but when all code in a\n+compile has opted in, the compiler should be able to trust what the type system\n+says about nullability.  When not all code has opted-in, it is possible that a\n+non-nullably typed value will receive null.\n+- During the migration, packages should be able to opt in without breaking\n+  non-opted-in clients.\n+- During the migration, packages should be able to opt in before packages that\n+  they depend on have opted in.\n+- During the migration, if a package opts in after all of its dependencies have\n+already opted in (or if it correctly predicts and codes against the\n+post-migration API of its dependencies) it only migrates once.\n+\n+## Proposal roadmap\n+\n+### Opting in\n+\n+Non-nullable types will be controlled by a language opt-in as deal with\n+elsewhere.  In short, a library may opt-in via syntax in the code, or a package\n+may opt-in in entirety.  Opting-in applies only to the library or package so\n+marked.\n+\n+Within an opted-in library, unmarked types are interpreted as non-nullable, and\n+only types suffixed with `?` are considered nullable.  Additional syntax and\n+semantics are enabled for null assertions, definite assignment analysis, type\n+promotion.  Additional static errors and warnings are enabled.  If we choose to\n+move forward according this roadmap the details of this will be worked out in\n+detail by the language team over the next quarter, drawing heavily on previous\n+proposals.\n+\n+### Reification\n+\n+Nullable (and non-nullable) types are reified, and hence have a runtime effect.\n+So for example, casts and instance checks can distinguish between `List<int>`\n+and `List<int?>`.  Without runtime reification, nullability is relegated to an\n+odd and inconsistent state with respect to the rest of the Dart type system,\n+which is uniformly reified.  Null-soundness is also almost certainly impossible\n+to achieve in Dart without reification.\n+\n+### Soundness\n+\n+When all libraries in a compile have opted-in to non-nullability, the type\n+system is sound and both compilers and programmers can benefit from a robust\n+guarantee that no non-nullably typed value may be observed to be null.  We","path":"working/0110-incremental-sound-nnbd/roadmap.md","position":71,"original_position":71,"commit_id":"065e2a74e45554d66c08c614eeca7f97231464cc","original_commit_id":"065e2a74e45554d66c08c614eeca7f97231464cc","user":{"login":"leafpetersen","id":8484504,"node_id":"MDQ6VXNlcjg0ODQ1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8484504?v=4","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false},"body":"Added.","created_at":"2018-11-30T22:08:19Z","updated_at":"2018-11-30T22:08:20Z","html_url":"https://github.com/dart-lang/language/pull/111#discussion_r238017668","pull_request_url":"https://api.github.com/repos/dart-lang/language/pulls/111","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dart-lang/language/pulls/comments/238017668"},"html":{"href":"https://github.com/dart-lang/language/pull/111#discussion_r238017668"},"pull_request":{"href":"https://api.github.com/repos/dart-lang/language/pulls/111"}},"in_reply_to_id":237314477},"pull_request":{"url":"https://api.github.com/repos/dart-lang/language/pulls/111","id":234128353,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MTI4MzUz","html_url":"https://github.com/dart-lang/language/pull/111","diff_url":"https://github.com/dart-lang/language/pull/111.diff","patch_url":"https://github.com/dart-lang/language/pull/111.patch","issue_url":"https://api.github.com/repos/dart-lang/language/issues/111","number":111,"state":"open","locked":false,"title":"Add roadmap proposal for incremental sound nnbd","user":{"login":"leafpetersen","id":8484504,"node_id":"MDQ6VXNlcjg0ODQ1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8484504?v=4","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false},"body":"@lrhn @eernstg @mit-mit @munificent @vsmenon \r\n\r\nI've been hacking on a writeup of our discussions about an incremental  path to NNBD, and I think it's at a state where some broader feedback would be useful.  I'm putting this up as a PR for now just to make it easy to comment on, but I will probably land it and iterate on it tomorrow.  Please take a look, comments and feedback welcome (on the PR or via email).  This is still very much a high level roadmap, but If we broadly still think this is in line with what we want to propose to do, we should get this out in draft form to leads for discussion next week.","created_at":"2018-11-28T02:38:07Z","updated_at":"2018-11-30T22:08:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6728dd8d2292abf02e5fccf524dfe2c2017d9cd8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dart-lang/language/pulls/111/commits","review_comments_url":"https://api.github.com/repos/dart-lang/language/pulls/111/comments","review_comment_url":"https://api.github.com/repos/dart-lang/language/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dart-lang/language/issues/111/comments","statuses_url":"https://api.github.com/repos/dart-lang/language/statuses/065e2a74e45554d66c08c614eeca7f97231464cc","head":{"label":"dart-lang:non-nullability","ref":"non-nullability","sha":"065e2a74e45554d66c08c614eeca7f97231464cc","user":{"login":"dart-lang","id":1609975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk5NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1609975?v=4","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":137279731,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNzk3MzE=","name":"language","full_name":"dart-lang/language","private":false,"owner":{"login":"dart-lang","id":1609975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk5NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1609975?v=4","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dart-lang/language","description":null,"fork":false,"url":"https://api.github.com/repos/dart-lang/language","forks_url":"https://api.github.com/repos/dart-lang/language/forks","keys_url":"https://api.github.com/repos/dart-lang/language/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dart-lang/language/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dart-lang/language/teams","hooks_url":"https://api.github.com/repos/dart-lang/language/hooks","issue_events_url":"https://api.github.com/repos/dart-lang/language/issues/events{/number}","events_url":"https://api.github.com/repos/dart-lang/language/events","assignees_url":"https://api.github.com/repos/dart-lang/language/assignees{/user}","branches_url":"https://api.github.com/repos/dart-lang/language/branches{/branch}","tags_url":"https://api.github.com/repos/dart-lang/language/tags","blobs_url":"https://api.github.com/repos/dart-lang/language/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dart-lang/language/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dart-lang/language/git/refs{/sha}","trees_url":"https://api.github.com/repos/dart-lang/language/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dart-lang/language/statuses/{sha}","languages_url":"https://api.github.com/repos/dart-lang/language/languages","stargazers_url":"https://api.github.com/repos/dart-lang/language/stargazers","contributors_url":"https://api.github.com/repos/dart-lang/language/contributors","subscribers_url":"https://api.github.com/repos/dart-lang/language/subscribers","subscription_url":"https://api.github.com/repos/dart-lang/language/subscription","commits_url":"https://api.github.com/repos/dart-lang/language/commits{/sha}","git_commits_url":"https://api.github.com/repos/dart-lang/language/git/commits{/sha}","comments_url":"https://api.github.com/repos/dart-lang/language/comments{/number}","issue_comment_url":"https://api.github.com/repos/dart-lang/language/issues/comments{/number}","contents_url":"https://api.github.com/repos/dart-lang/language/contents/{+path}","compare_url":"https://api.github.com/repos/dart-lang/language/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dart-lang/language/merges","archive_url":"https://api.github.com/repos/dart-lang/language/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dart-lang/language/downloads","issues_url":"https://api.github.com/repos/dart-lang/language/issues{/number}","pulls_url":"https://api.github.com/repos/dart-lang/language/pulls{/number}","milestones_url":"https://api.github.com/repos/dart-lang/language/milestones{/number}","notifications_url":"https://api.github.com/repos/dart-lang/language/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dart-lang/language/labels{/name}","releases_url":"https://api.github.com/repos/dart-lang/language/releases{/id}","deployments_url":"https://api.github.com/repos/dart-lang/language/deployments","created_at":"2018-06-13T22:49:18Z","updated_at":"2018-11-30T20:14:10Z","pushed_at":"2018-11-30T20:14:08Z","git_url":"git://github.com/dart-lang/language.git","ssh_url":"git@github.com:dart-lang/language.git","clone_url":"https://github.com/dart-lang/language.git","svn_url":"https://github.com/dart-lang/language","homepage":null,"size":806,"stargazers_count":62,"watchers_count":62,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5,"open_issues":74,"watchers":62,"default_branch":"master"}},"base":{"label":"dart-lang:master","ref":"master","sha":"95336f1cac4529ae85730a17c88f6698eec7d80e","user":{"login":"dart-lang","id":1609975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk5NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1609975?v=4","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":137279731,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNzk3MzE=","name":"language","full_name":"dart-lang/language","private":false,"owner":{"login":"dart-lang","id":1609975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk5NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1609975?v=4","gravatar_id":"","url":"https://api.github.com/users/dart-lang","html_url":"https://github.com/dart-lang","followers_url":"https://api.github.com/users/dart-lang/followers","following_url":"https://api.github.com/users/dart-lang/following{/other_user}","gists_url":"https://api.github.com/users/dart-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/dart-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dart-lang/subscriptions","organizations_url":"https://api.github.com/users/dart-lang/orgs","repos_url":"https://api.github.com/users/dart-lang/repos","events_url":"https://api.github.com/users/dart-lang/events{/privacy}","received_events_url":"https://api.github.com/users/dart-lang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dart-lang/language","description":null,"fork":false,"url":"https://api.github.com/repos/dart-lang/language","forks_url":"https://api.github.com/repos/dart-lang/language/forks","keys_url":"https://api.github.com/repos/dart-lang/language/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dart-lang/language/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dart-lang/language/teams","hooks_url":"https://api.github.com/repos/dart-lang/language/hooks","issue_events_url":"https://api.github.com/repos/dart-lang/language/issues/events{/number}","events_url":"https://api.github.com/repos/dart-lang/language/events","assignees_url":"https://api.github.com/repos/dart-lang/language/assignees{/user}","branches_url":"https://api.github.com/repos/dart-lang/language/branches{/branch}","tags_url":"https://api.github.com/repos/dart-lang/language/tags","blobs_url":"https://api.github.com/repos/dart-lang/language/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dart-lang/language/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dart-lang/language/git/refs{/sha}","trees_url":"https://api.github.com/repos/dart-lang/language/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dart-lang/language/statuses/{sha}","languages_url":"https://api.github.com/repos/dart-lang/language/languages","stargazers_url":"https://api.github.com/repos/dart-lang/language/stargazers","contributors_url":"https://api.github.com/repos/dart-lang/language/contributors","subscribers_url":"https://api.github.com/repos/dart-lang/language/subscribers","subscription_url":"https://api.github.com/repos/dart-lang/language/subscription","commits_url":"https://api.github.com/repos/dart-lang/language/commits{/sha}","git_commits_url":"https://api.github.com/repos/dart-lang/language/git/commits{/sha}","comments_url":"https://api.github.com/repos/dart-lang/language/comments{/number}","issue_comment_url":"https://api.github.com/repos/dart-lang/language/issues/comments{/number}","contents_url":"https://api.github.com/repos/dart-lang/language/contents/{+path}","compare_url":"https://api.github.com/repos/dart-lang/language/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dart-lang/language/merges","archive_url":"https://api.github.com/repos/dart-lang/language/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dart-lang/language/downloads","issues_url":"https://api.github.com/repos/dart-lang/language/issues{/number}","pulls_url":"https://api.github.com/repos/dart-lang/language/pulls{/number}","milestones_url":"https://api.github.com/repos/dart-lang/language/milestones{/number}","notifications_url":"https://api.github.com/repos/dart-lang/language/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dart-lang/language/labels{/name}","releases_url":"https://api.github.com/repos/dart-lang/language/releases{/id}","deployments_url":"https://api.github.com/repos/dart-lang/language/deployments","created_at":"2018-06-13T22:49:18Z","updated_at":"2018-11-30T20:14:10Z","pushed_at":"2018-11-30T20:14:08Z","git_url":"git://github.com/dart-lang/language.git","ssh_url":"git@github.com:dart-lang/language.git","clone_url":"https://github.com/dart-lang/language.git","svn_url":"https://github.com/dart-lang/language","homepage":null,"size":806,"stargazers_count":62,"watchers_count":62,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5,"open_issues":74,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dart-lang/language/pulls/111"},"html":{"href":"https://github.com/dart-lang/language/pull/111"},"issue":{"href":"https://api.github.com/repos/dart-lang/language/issues/111"},"comments":{"href":"https://api.github.com/repos/dart-lang/language/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/dart-lang/language/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/dart-lang/language/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dart-lang/language/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/dart-lang/language/statuses/065e2a74e45554d66c08c614eeca7f97231464cc"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"leafpetersen"}}