{"action":"created","issue":{"url":"https://api.github.com/repos/keean/zenscript/issues/18","repository_url":"https://api.github.com/repos/keean/zenscript","labels_url":"https://api.github.com/repos/keean/zenscript/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/keean/zenscript/issues/18/comments","events_url":"https://api.github.com/repos/keean/zenscript/issues/18/events","html_url":"https://github.com/keean/zenscript/issues/18","id":179470231,"number":18,"title":"Compiler Implementation","user":{"login":"keean","id":508384,"avatar_url":"https://avatars.githubusercontent.com/u/508384?v=3","gravatar_id":"","url":"https://api.github.com/users/keean","html_url":"https://github.com/keean","followers_url":"https://api.github.com/users/keean/followers","following_url":"https://api.github.com/users/keean/following{/other_user}","gists_url":"https://api.github.com/users/keean/gists{/gist_id}","starred_url":"https://api.github.com/users/keean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keean/subscriptions","organizations_url":"https://api.github.com/users/keean/orgs","repos_url":"https://api.github.com/users/keean/repos","events_url":"https://api.github.com/users/keean/events{/privacy}","received_events_url":"https://api.github.com/users/keean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":335,"created_at":"2016-09-27T11:43:37Z","updated_at":"2016-10-21T22:36:22Z","closed_at":null,"body":"Discussion about the ongoing implementation of the compiler."},"comment":{"url":"https://api.github.com/repos/keean/zenscript/issues/comments/255481472","html_url":"https://github.com/keean/zenscript/issues/18#issuecomment-255481472","issue_url":"https://api.github.com/repos/keean/zenscript/issues/18","id":255481472,"user":{"login":"keean","id":508384,"avatar_url":"https://avatars.githubusercontent.com/u/508384?v=3","gravatar_id":"","url":"https://api.github.com/users/keean","html_url":"https://github.com/keean","followers_url":"https://api.github.com/users/keean/followers","following_url":"https://api.github.com/users/keean/following{/other_user}","gists_url":"https://api.github.com/users/keean/gists{/gist_id}","starred_url":"https://api.github.com/users/keean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keean/subscriptions","organizations_url":"https://api.github.com/users/keean/orgs","repos_url":"https://api.github.com/users/keean/repos","events_url":"https://api.github.com/users/keean/events{/privacy}","received_events_url":"https://api.github.com/users/keean/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T22:36:22Z","updated_at":"2016-10-21T22:36:22Z","body":"> Let's see what you can say after you have subsumption and supersumption for unions working every where they can be applied,\r\n\r\nIf it works anywhere it works everywhere, as the only operation in the AST is application of functions.\r\n\r\n> doing it by adding compiler passes to interpret the AST and add rules which the unification equality test has to understand. Those passes are complex spaghetti.\r\n\r\nActually more passes that do less in each pass is considered the easiest way to structure a compiler so that it is easy to read and maintain. See: http://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf and http://andykeep.com/pubs/dissertation.pdf\r\n\r\n> Additionally the equality test will need to understand some complex declarative syntax which is able to instruct the equality test about the meaning of associative property and the recursive inductive construction and coinductive destructuring of infinite union types.\r\n\r\nThis is backwards, the equality test it much simpler, and in fact it is already written here: https://github.com/keean/zenscript/blob/master/src/unification.js and some of that (the `mgu` function) is diagnostic code that @skaller wanted added, but is not part of the actual unification algorithm. The advantage is, no matter what subsumption rules you want in the type system, this equality code does not change, so we have a simple definition of equality we can rely on. Subtyping judgements happen separately. \r\n\r\nThis unification is capable of handling all the associative and recursive inductive construction and coinductive destructuring of infinite union types as it is without further modification.\r\n\r\nThe pre-typechecking compiler pass simply inserts the directional subtyping constraints into the AST, and then type checking proceeds as normal."}}
{"actor":{"display_login":"keean"}}