{"action":"created","issue":{"url":"https://api.github.com/repos/melt-umn/silver/issues/256","repository_url":"https://api.github.com/repos/melt-umn/silver","labels_url":"https://api.github.com/repos/melt-umn/silver/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/melt-umn/silver/issues/256/comments","events_url":"https://api.github.com/repos/melt-umn/silver/issues/256/events","html_url":"https://github.com/melt-umn/silver/issues/256","id":339197774,"node_id":"MDU6SXNzdWUzMzkxOTc3NzQ=","number":256,"title":"Lazy reification","user":{"login":"krame505","id":8467850,"node_id":"MDQ6VXNlcjg0Njc4NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/8467850?v=4","gravatar_id":"","url":"https://api.github.com/users/krame505","html_url":"https://github.com/krame505","followers_url":"https://api.github.com/users/krame505/followers","following_url":"https://api.github.com/users/krame505/following{/other_user}","gists_url":"https://api.github.com/users/krame505/gists{/gist_id}","starred_url":"https://api.github.com/users/krame505/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krame505/subscriptions","organizations_url":"https://api.github.com/users/krame505/orgs","repos_url":"https://api.github.com/users/krame505/repos","events_url":"https://api.github.com/users/krame505/events{/privacy}","received_events_url":"https://api.github.com/users/krame505/received_events","type":"User","site_admin":false},"labels":[{"id":250726237,"node_id":"MDU6TGFiZWwyNTA3MjYyMzc=","url":"https://api.github.com/repos/melt-umn/silver/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-08T05:13:28Z","updated_at":"2018-07-12T22:19:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"One of the biggest downsides to using reify right now is that it is kinda slow for big trees.  However in some uses, such as serializing an environment, we are unlikely to actually use the entire tree.  A solution to this is to make reification lazy, and only reify a node if it is demanded.  \r\n\r\nThe biggest complication here is error checking, since we can no longer use the same exception chaining approach we used previously to trace the position of the error within the reified tree; the exception would now be thrown later from inside some thunk.  We can handle tracing by passing a new `ReifyTrace` object down through the recursion (I have already implemented this - see feature/lazyreify), but the problem still stands of how we report the error to the caller - to ensure that the entire provided `AST` is well-formed, we would need to compute the entire reification eagerly.  \r\n\r\nI propose we add a new `reifyLazy :: (a ::= AST)` construct to the language, in addition to `reify`, but that may raise an exception if given an ill-formed tree.  This variant can be used in cases where a reification error is a fatal internal error anyway (such as for reconstructing the environment in Silver) and we don't really care too much how the exception gets reported.  \r\n\r\nThe implementation of this shouldn't be too complicated, we can simply modify the `Reflection.reify` function in the runtime to take a flag of whether to be lazy.  @tedinski thoughts on this?  I might try implementing it in the meantime.  "},"comment":{"url":"https://api.github.com/repos/melt-umn/silver/issues/comments/404668672","html_url":"https://github.com/melt-umn/silver/issues/256#issuecomment-404668672","issue_url":"https://api.github.com/repos/melt-umn/silver/issues/256","id":404668672,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDY2ODY3Mg==","user":{"login":"tedinski","id":1508333,"node_id":"MDQ6VXNlcjE1MDgzMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1508333?v=4","gravatar_id":"","url":"https://api.github.com/users/tedinski","html_url":"https://github.com/tedinski","followers_url":"https://api.github.com/users/tedinski/followers","following_url":"https://api.github.com/users/tedinski/following{/other_user}","gists_url":"https://api.github.com/users/tedinski/gists{/gist_id}","starred_url":"https://api.github.com/users/tedinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tedinski/subscriptions","organizations_url":"https://api.github.com/users/tedinski/orgs","repos_url":"https://api.github.com/users/tedinski/repos","events_url":"https://api.github.com/users/tedinski/events{/privacy}","received_events_url":"https://api.github.com/users/tedinski/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T22:19:52Z","updated_at":"2018-07-12T22:19:52Z","author_association":"MEMBER","body":"If the benefit is marginal, then we should maybe avoid this. Especially with the error reporting problem, I think strict reification is fine.\r\n\r\nI'll try to take a look at the performance issue next week."}}
{"actor":{"display_login":"tedinski"}}