{"action":"created","issue":{"url":"https://api.github.com/repos/Marwes/gluon/issues/92","repository_url":"https://api.github.com/repos/Marwes/gluon","labels_url":"https://api.github.com/repos/Marwes/gluon/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/Marwes/gluon/issues/92/comments","events_url":"https://api.github.com/repos/Marwes/gluon/issues/92/events","html_url":"https://github.com/Marwes/gluon/issues/92","id":168506529,"number":92,"title":"Add row polymorphism (aka. extensible records) to type system","user":{"login":"brendanzab","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanzab","html_url":"https://github.com/brendanzab","followers_url":"https://api.github.com/users/brendanzab/followers","following_url":"https://api.github.com/users/brendanzab/following{/other_user}","gists_url":"https://api.github.com/users/brendanzab/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanzab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanzab/subscriptions","organizations_url":"https://api.github.com/users/brendanzab/orgs","repos_url":"https://api.github.com/users/brendanzab/repos","events_url":"https://api.github.com/users/brendanzab/events{/privacy}","received_events_url":"https://api.github.com/users/brendanzab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Marwes/gluon/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-31T07:42:09Z","updated_at":"2016-08-12T20:51:31Z","closed_at":null,"body":"This could be useful for adding a more powerful effect system, or perhaps for adding default implementations for interfaces/traits/modules/typeclasses (whatever we call them?).\r\n\r\n## Resources\r\n\r\nFeel free to add more if you like!\r\n\r\n- [willtim/row-polymorphism](https://github.com/willtim/row-polymorphism) - Example row-polymorphism implementations \r\n- [Extensible records with scoped labels](https://www.microsoft.com/en-us/research/publication/extensible-records-with-scoped-labels/)\r\n- [Koka: Programming with Row Polymorphic Effect Types](https://www.microsoft.com/en-us/research/publication/koka-programming-with-row-polymorphic-effect-types-2/)\r\n- [Elm: Records](http://elm-lang.org/docs/records)\r\n- [Elm: Simplified Records](http://elm-lang.org/blog/compilers-as-assistants#simplified-records)\r\n- [PureScript: Handling Native Effects with the Eff Monad](http://www.purescript.org/learn/eff/)\r\n- [PureScript Language Guide: Kind System](https://github.com/purescript/purescript/wiki/Language-Guide#kind-system) \r\n- [PureScript Language Guide: Kinds](https://github.com/purescript/purescript/wiki/Language-Guide#kinds) "},"comment":{"url":"https://api.github.com/repos/Marwes/gluon/issues/comments/239556628","html_url":"https://github.com/Marwes/gluon/issues/92#issuecomment-239556628","issue_url":"https://api.github.com/repos/Marwes/gluon/issues/92","id":239556628,"user":{"login":"Marwes","id":957312,"avatar_url":"https://avatars.githubusercontent.com/u/957312?v=3","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T20:51:31Z","updated_at":"2016-08-12T20:51:31Z","body":"Just adding a some thoughts about implementation details.\r\n\r\nCurrently records are represented in vm as a flat array of values which ensures very fast access but in return this means that `{ x : Int, y : String } != { y : String, x : Int }`. With a row polymorphic type the representation of `{ x : Int, y : String | r }` would presumably be some kind of hashmap or tree (or `x` and `y` field could be laid out first on memory with the rest of fields to follow, but that is probably to restrictive).\r\n\r\nPossibly the representation of non-polymorphic records could still be stored as compactly as they are now but could be enhanced with a `Map<Field, FieldOffset>` to retrieve fields when it is accessed in polymorphic context?\r\n\r\nAlternatively storing them as hashmaps always is possible, dynamic languages seem to do alright with that representation.\r\n\r\nShould `{ x : Int, y : String }` unify with `{ y : String, x : Int }` to produce `{ x : Int, y : String | r }`? (Might be subtyping problems?)"}}
{"actor":{"display_login":"Marwes"}}