{"action":"reopened","issue":{"url":"https://api.github.com/repos/ox-lang/ox/issues/19","labels_url":"https://api.github.com/repos/ox-lang/ox/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/ox-lang/ox/issues/19/comments","events_url":"https://api.github.com/repos/ox-lang/ox/issues/19/events","html_url":"https://github.com/ox-lang/ox/issues/19","id":109654737,"number":19,"title":"Java implementation style","user":{"login":"arrdem","id":704767,"avatar_url":"https://avatars.githubusercontent.com/u/704767?v=3","gravatar_id":"","url":"https://api.github.com/users/arrdem","html_url":"https://github.com/arrdem","followers_url":"https://api.github.com/users/arrdem/followers","following_url":"https://api.github.com/users/arrdem/following{/other_user}","gists_url":"https://api.github.com/users/arrdem/gists{/gist_id}","starred_url":"https://api.github.com/users/arrdem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arrdem/subscriptions","organizations_url":"https://api.github.com/users/arrdem/orgs","repos_url":"https://api.github.com/users/arrdem/repos","events_url":"https://api.github.com/users/arrdem/events{/privacy}","received_events_url":"https://api.github.com/users/arrdem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-04T00:50:03Z","updated_at":"2015-10-06T02:48:42Z","closed_at":null,"body":"At present I'm playing with using Google Guava and the builder pattern for the underpinnings of Ox. Guava's datastructures are really good (more performant than Clojure's in some use cases) and this is an opportunity to not do a whole bunch more work implementing array mapped tries again.\r\n\r\nHowever since they aren't based on array mapped tries, Guava maps, sets and soforth don't have remotely reasonable single entry update performance. There are many cases where this is acceptable. For instance the common idioms `update-vals` and `update-keys` involve rewriting all the entries of a map. In this \"whole new structure\" use case Guava maps are more performant even than transients in my benchmarking attempts. However for random access collections where new values may be inserted at any time the Guava maps really don't work.\r\n\r\nThis choice is pretty performance critical for the interpreter, since the entire immutable environment stack is build on the presumptions that: local bindings and dynamic bindings will be built and discarded, never mutated while the base bindings will never be updated and the global bindings will routinely be randomly altered via inter. So for the root bindings, a Guava map or a Clojure map would be fine. For local bindings again a Guava map will serve, but in order to make inter performant it would seem that a structurally shared map type is in order.\r\n\r\nThis propagates to the rest of the Java implementation in that I can either design around Clojure's constructor + random access update fn style, or I can take Guava's builder pattern and then deal with it style.\r\n\r\nFor some things like keywords and symbols it totally doesn't matter because there is no random access update. For the environment stack I'm working on it totally matters because random access updates are called for. Meh."}}