{"action":"created","issue":{"url":"https://api.github.com/repos/DeedleFake/wdte/issues/53","repository_url":"https://api.github.com/repos/DeedleFake/wdte","labels_url":"https://api.github.com/repos/DeedleFake/wdte/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/DeedleFake/wdte/issues/53/comments","events_url":"https://api.github.com/repos/DeedleFake/wdte/issues/53/events","html_url":"https://github.com/DeedleFake/wdte/issues/53","id":286378530,"number":53,"title":"Language Overhaul","user":{"login":"DeedleFake","id":326750,"avatar_url":"https://avatars0.githubusercontent.com/u/326750?v=4","gravatar_id":"","url":"https://api.github.com/users/DeedleFake","html_url":"https://github.com/DeedleFake","followers_url":"https://api.github.com/users/DeedleFake/followers","following_url":"https://api.github.com/users/DeedleFake/following{/other_user}","gists_url":"https://api.github.com/users/DeedleFake/gists{/gist_id}","starred_url":"https://api.github.com/users/DeedleFake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeedleFake/subscriptions","organizations_url":"https://api.github.com/users/DeedleFake/orgs","repos_url":"https://api.github.com/users/DeedleFake/repos","events_url":"https://api.github.com/users/DeedleFake/events{/privacy}","received_events_url":"https://api.github.com/users/DeedleFake/received_events","type":"User","site_admin":false},"labels":[{"id":586909149,"url":"https://api.github.com/repos/DeedleFake/wdte/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"DeedleFake","id":326750,"avatar_url":"https://avatars0.githubusercontent.com/u/326750?v=4","gravatar_id":"","url":"https://api.github.com/users/DeedleFake","html_url":"https://github.com/DeedleFake","followers_url":"https://api.github.com/users/DeedleFake/followers","following_url":"https://api.github.com/users/DeedleFake/following{/other_user}","gists_url":"https://api.github.com/users/DeedleFake/gists{/gist_id}","starred_url":"https://api.github.com/users/DeedleFake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeedleFake/subscriptions","organizations_url":"https://api.github.com/users/DeedleFake/orgs","repos_url":"https://api.github.com/users/DeedleFake/repos","events_url":"https://api.github.com/users/DeedleFake/events{/privacy}","received_events_url":"https://api.github.com/users/DeedleFake/received_events","type":"User","site_admin":false},"assignees":[{"login":"DeedleFake","id":326750,"avatar_url":"https://avatars0.githubusercontent.com/u/326750?v=4","gravatar_id":"","url":"https://api.github.com/users/DeedleFake","html_url":"https://github.com/DeedleFake","followers_url":"https://api.github.com/users/DeedleFake/followers","following_url":"https://api.github.com/users/DeedleFake/following{/other_user}","gists_url":"https://api.github.com/users/DeedleFake/gists{/gist_id}","starred_url":"https://api.github.com/users/DeedleFake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeedleFake/subscriptions","organizations_url":"https://api.github.com/users/DeedleFake/orgs","repos_url":"https://api.github.com/users/DeedleFake/repos","events_url":"https://api.github.com/users/DeedleFake/events{/privacy}","received_events_url":"https://api.github.com/users/DeedleFake/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-01-05T19:14:44Z","updated_at":"2018-02-28T05:53:37Z","closed_at":null,"author_association":"OWNER","body":"Replaces #28.\r\n\r\nUnder the current system, a module is broken into a list of imports and function declarations. This overhaul consists of several steps:\r\n\r\n- [ ] Introduce `let` expressions. A `let` would look something like `let x => 3`. `let`s can only be used inside compounds. When used, it introduces the variable on the left into the scope for all subsequent statements, shadowing any existing variables with that name. It can also be used as an expression, simply returning the right-hand side when evaluated.\r\n- [ ] Introduce an `import` keyword that takes a string as an argument. Alternatively, make it just a special built-in function. It simply imports and returns the requested module. The recent modules-as-`Func`s overhaul should make this relatively straightforward.\r\n- [ ] Allow compounds to take arguments. When a compound is evaluated, after each expression's evaluation the arguments given are passed to the return of that expression.\r\n- [ ] Replace modules with compounds. This means that expressions would become top-level syntactic items.\r\n- [ ] Remove function declarations and replace them with lambdas. In other words, a function would be defined using `let add => (@ self x y => + x y)`.\r\n\r\nThis would clean up a large number of things, but it introduces one particular problem. Specifically, it breaks imports, as function declarations can't be referenced by name. There are some workarounds, however:\r\n\r\n* Add a special method to compounds that iterates over a compound, collecting only the let expressions and returning them as a `Scope`.\r\n* Collect top-level `let`s during translation, returning a special type that allows access to both those on their own and allows evaluation of the whole module as a compound.\r\n* Use the JavaScript method and add an `export` statement that works like a `let` but doesn't introduce it into the scope, instead adding it to a top-level scope at translation-time. This top-level scope would then be available both to every scope in the module and would be accessible from outside. `export`s would only be available in top-level code. I'm leaning towards this one currently."},"comment":{"url":"https://api.github.com/repos/DeedleFake/wdte/issues/comments/369130491","html_url":"https://github.com/DeedleFake/wdte/issues/53#issuecomment-369130491","issue_url":"https://api.github.com/repos/DeedleFake/wdte/issues/53","id":369130491,"user":{"login":"DeedleFake","id":326750,"avatar_url":"https://avatars0.githubusercontent.com/u/326750?v=4","gravatar_id":"","url":"https://api.github.com/users/DeedleFake","html_url":"https://github.com/DeedleFake","followers_url":"https://api.github.com/users/DeedleFake/followers","following_url":"https://api.github.com/users/DeedleFake/following{/other_user}","gists_url":"https://api.github.com/users/DeedleFake/gists{/gist_id}","starred_url":"https://api.github.com/users/DeedleFake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeedleFake/subscriptions","organizations_url":"https://api.github.com/users/DeedleFake/orgs","repos_url":"https://api.github.com/users/DeedleFake/repos","events_url":"https://api.github.com/users/DeedleFake/events{/privacy}","received_events_url":"https://api.github.com/users/DeedleFake/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T05:53:37Z","updated_at":"2018-02-28T05:53:37Z","author_association":"OWNER","body":"As part of the introduction of `let`s, there should also be a relatively minor overhaul of the implantation of scopes. Specifically, the use of maps should be removed and replaced with a `context`-style linked list system.\n\nAlong with that, the rules around how and when scopes are frozen should be clarified and implemented. The most likely candidate is that they should be frozen anytime a variable is assigned, which is in `let`s, chain slots, and, probably the most complicated, when functions are called. "}}
{"actor":{"display_login":"DeedleFake"}}