You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's more complicated than I thought, the traverse algorithm is not easy to understand.
I wanted to use Immutable.js with a tree datastructure.
I don't know what we would do with mutations like: path.node.id.name = "a";, it would have a big perf impact to allow that (since it would bypass the partial copy optimization). Only path.Insert*, path.remove or path.replace* would be possible.
I've looked into OCaml and GHC, both compiler are self-hosted and uses an immutable tree. They are fast enough to not need to merge visitors and only use passPerPreset-like behavior.
Activity
xtuc commentedon Oct 4, 2017
I can work on this tomorrow, I would like to have a quick prototype to measure the perf impact (if any).
Andarist commentedon Oct 4, 2017
closed by accident with a fat finger :<
xtuc commentedon Oct 5, 2017
It's more complicated than I thought, the traverse algorithm is not easy to understand.
I wanted to use Immutable.js with a tree datastructure.
I don't know what we would do with mutations like:
path.node.id.name = "a";, it would have a big perf impact to allow that (since it would bypass the partial copy optimization). Onlypath.Insert*,path.removeorpath.replace*would be possible.I've looked into OCaml and GHC, both compiler are self-hosted and uses an immutable tree. They are fast enough to not need to merge visitors and only use
passPerPreset-like behavior.hzoo commentedon Oct 5, 2017
@loganfsmyth had ideas a long time ago: https://github.com/babel/notes/blob/master/2016/2016-08/august-01.md#potential-api-changes-for-traversal around this.
And yes we would have to prevent assignment and only allow path methods
hzoo commentedon Nov 1, 2017
Happening more so we really need a fix
#6517
#6657
nicolo-ribaudo commentedon Nov 29, 2017
Related: #3428