In metal we use ImmutableList and ParseGraph as data structures. This has the following drawbacks:
- difficult to understand when processing the parse result
- difficult to use when creating custom expressions
- ordering problems when processing an
ImmutableList (switches order)
- performance issues
It was implemented to keep metal as immutable as possible to avoid threading issues. Performance was not a prioritized concern.
The following ideas to improve the problems:
- Use
capsule, which has implemented immutable data structures using java collection interfaces: https://github.com/usethesource/capsule/ (a List is a Map with integer keys?)
- Implement streaming-ish methods to ImmutableList and improve code that iterate over the immutable list
- Replace direct usage of
head and tail with ... ? Goal: phase out the usage of our custom ImmutableList
TODO:
- Try this collections brute force: this requires some days to really discover what the challenges are and best approach is.
In metal we use
ImmutableListandParseGraphas data structures. This has the following drawbacks:ImmutableList(switches order)It was implemented to keep metal as immutable as possible to avoid threading issues. Performance was not a prioritized concern.
The following ideas to improve the problems:
capsule, which has implemented immutable data structures using java collection interfaces: https://github.com/usethesource/capsule/ (aListis aMapwith integer keys?)headandtailwith ... ? Goal: phase out the usage of our customImmutableListTODO: