{"action":"created","issue":{"url":"https://api.github.com/repos/elves/elvish/issues/15","repository_url":"https://api.github.com/repos/elves/elvish","labels_url":"https://api.github.com/repos/elves/elvish/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/elves/elvish/issues/15/comments","events_url":"https://api.github.com/repos/elves/elvish/issues/15/events","html_url":"https://github.com/elves/elvish/issues/15","id":35895954,"number":15,"title":"Shared variables and functions","user":{"login":"xiaq","id":582021,"avatar_url":"https://avatars.githubusercontent.com/u/582021?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaq","html_url":"https://github.com/xiaq","followers_url":"https://api.github.com/users/xiaq/followers","following_url":"https://api.github.com/users/xiaq/following{/other_user}","gists_url":"https://api.github.com/users/xiaq/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaq/subscriptions","organizations_url":"https://api.github.com/users/xiaq/orgs","repos_url":"https://api.github.com/users/xiaq/repos","events_url":"https://api.github.com/users/xiaq/events{/privacy}","received_events_url":"https://api.github.com/users/xiaq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elves/elvish/labels/enhancement","name":"enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-06-17T14:44:40Z","updated_at":"2016-02-11T23:16:01Z","closed_at":null,"body":"**Persistent** variables and persistent functions are shared across multiple sessions and preserved on shell exits. They are useful for passing data or code between concurrent sessions without (explicit) serialization/deserialization. In particular, they are ideal for configuration variables and functions and may serve as a more advanced clipboard facility.\r\n\r\nThe ideas are taken from fish, which has *universal variable* and *autoload functions*, with quite different implementations. All universal variables are stored into one file, and `fish` instances talk to an agent, `fishd`, to access them. In the case of autoload functions, however, each function is stored into a separate file and there is no agent to coordinate the access. Users are encouraged to manage autoload functions manually.\r\n\r\nOpen questions:\r\n\r\n1. Is unifying persistent variables and functions necessarily a good idea?\r\n\r\n2. How to statically check persistent variables and functions?\r\n\r\n3. Is an agent needed to coordinate access? If so, how should the protocol be? (Note: The `elvished` package already includes a prototype of the agent.)"},"comment":{"url":"https://api.github.com/repos/elves/elvish/issues/comments/183096718","html_url":"https://github.com/elves/elvish/issues/15#issuecomment-183096718","issue_url":"https://api.github.com/repos/elves/elvish/issues/15","id":183096718,"user":{"login":"xiaq","id":582021,"avatar_url":"https://avatars.githubusercontent.com/u/582021?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaq","html_url":"https://github.com/xiaq","followers_url":"https://api.github.com/users/xiaq/followers","following_url":"https://api.github.com/users/xiaq/following{/other_user}","gists_url":"https://api.github.com/users/xiaq/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaq/subscriptions","organizations_url":"https://api.github.com/users/xiaq/orgs","repos_url":"https://api.github.com/users/xiaq/repos","events_url":"https://api.github.com/users/xiaq/events{/privacy}","received_events_url":"https://api.github.com/users/xiaq/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T23:16:01Z","updated_at":"2016-02-11T23:16:01Z","body":"We can implement a predefined `shared` module."}}