Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate usage of java collections instead of ImmutableList #400

Open
mvanaken opened this issue Oct 24, 2023 · 0 comments
Open

Investigate usage of java collections instead of ImmutableList #400

mvanaken opened this issue Oct 24, 2023 · 0 comments

Comments

@mvanaken
Copy link
Contributor

mvanaken commented Oct 24, 2023

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.
rdvdijk added a commit that referenced this issue Feb 6, 2024
rdvdijk added a commit that referenced this issue Feb 6, 2024
mvanaken added a commit that referenced this issue Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant