Skip to content

Investigate usage of java collections instead of ImmutableList #400

@mvanaken

Description

@mvanaken

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions