{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4330","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4330/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4330/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4330/events","html_url":"https://github.com/jashkenas/coffeescript/pull/4330","id":180618432,"number":4330,"title":"[wip] Compile classes to ES2015","user":{"login":"connec","id":160652,"avatar_url":"https://avatars.githubusercontent.com/u/160652?v=3","gravatar_id":"","url":"https://api.github.com/users/connec","html_url":"https://github.com/connec","followers_url":"https://api.github.com/users/connec/followers","following_url":"https://api.github.com/users/connec/following{/other_user}","gists_url":"https://api.github.com/users/connec/gists{/gist_id}","starred_url":"https://api.github.com/users/connec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connec/subscriptions","organizations_url":"https://api.github.com/users/connec/orgs","repos_url":"https://api.github.com/users/connec/repos","events_url":"https://api.github.com/users/connec/events{/privacy}","received_events_url":"https://api.github.com/users/connec/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/coffeescript/labels/change","name":"change","color":"178c3c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":28,"created_at":"2016-10-03T11:31:04Z","updated_at":"2016-10-19T20:55:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jashkenas/coffeescript/pulls/4330","html_url":"https://github.com/jashkenas/coffeescript/pull/4330","diff_url":"https://github.com/jashkenas/coffeescript/pull/4330.diff","patch_url":"https://github.com/jashkenas/coffeescript/pull/4330.patch"},"body":"I started looking at adding some tests for executable class bodies to check for regressions when we begin to compile ES2015 classes, and I ended up writing an implementation. Sorry if this clashes with anyone else's work for https://github.com/coffeescript6/discuss/issues/22.\r\n\r\nThis is some unfinished, work in progress changes to compile CoffeeScript classes into ES2015 classes. I've only committed the source files, so if y ou want to run it you'll need to `cake build && cake build:parser`.\r\n\r\nThe compiler successfully self hosts, however **THERE ARE DEFINITELY A LOT OF BUGS AND THE CODE IS NOT PRETTY**. It might be useful as prior art and/or to resolve some discussions on how CS should proceed with ES2015 classes.\r\n\r\nI tried not to remove any CS functionality, including executable class bodies, soaked super invocations, etc. Quite a bit of code could be removed/cleaned up if they were removed.\r\n\r\nI'll add some comments in-line, and later update this with a TL;DR of the significant issues.\r\n\r\nSee https://github.com/coffeescript6/discuss/issues/22 for more context.\r\n\r\nTop issues:\r\n\r\n- Dynamic method names referencing variables that change in the class body is broken.\r\n- Dynamic method names need to be cached.\r\n- Super referencing is convoluted.\r\n- Class method hoisting is hacky."},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/254938136","html_url":"https://github.com/jashkenas/coffeescript/pull/4330#issuecomment-254938136","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4330","id":254938136,"user":{"login":"GeoffreyBooth","id":456802,"avatar_url":"https://avatars.githubusercontent.com/u/456802?v=3","gravatar_id":"","url":"https://api.github.com/users/GeoffreyBooth","html_url":"https://github.com/GeoffreyBooth","followers_url":"https://api.github.com/users/GeoffreyBooth/followers","following_url":"https://api.github.com/users/GeoffreyBooth/following{/other_user}","gists_url":"https://api.github.com/users/GeoffreyBooth/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoffreyBooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoffreyBooth/subscriptions","organizations_url":"https://api.github.com/users/GeoffreyBooth/orgs","repos_url":"https://api.github.com/users/GeoffreyBooth/repos","events_url":"https://api.github.com/users/GeoffreyBooth/events{/privacy}","received_events_url":"https://api.github.com/users/GeoffreyBooth/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T20:55:52Z","updated_at":"2016-10-19T20:55:52Z","body":"@carlmathisen aside from the ugliness, how do public class fields compare with the implementation in this PR? What does Babel compile public class fields into?\r\n\r\nWe don’t have Babel as part of the CoffeeScript compiler or tester, and I don’t think we want to add it. That means anything we output needs to be runnable at least in the Node runtime, at least via Node nightly `--harmony`. Modules are the great exception, but I’m okay with that because I think of `import` and `export` as more of a build step than something I would expect to be evaluated by a runtime. The philosophy behind not implementing any features before runtimes support them is that we don’t want to add support for something that could change when runtimes actually implement the feature."}}
{"actor":{"display_login":"GeoffreyBooth"}}