Skip to content

Towards immutable BindingsMap in Java #13315

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

Merged
merged 9 commits into from
Jun 22, 2025
Merged

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Jun 18, 2025

Pull Request Description

Initial rewrite of BindingsMap to:

  • minimize the moving parts by having immutable State that can be replaced at once in the best tradition of TransactionalDataStructures
  • move the implementation towards Java by adding a BindingsMapBase superclass

The goal is:

Later also:

  • make sure updateState calls are really "pure functions"

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

@JaroslavTulach JaroslavTulach self-assigned this Jun 18, 2025
@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Jun 18, 2025
Copy link

github-actions bot commented Jun 18, 2025

✨ GUI Checks Results

Summary

  • 🧹 Prettier: ✅ Passed
  • 🧰 GUI Checks: ❌ Failed
  • 📚 Storybook: ❌ Failed

⚠️ Action Required: Please review the failed checks and fix them before merging.

See individual check results for more details.

@JaroslavTulach
Copy link
Member Author

  • the 37293c7 version
  • seems to be relatively green in engine jobs
  • as well as IDE jobs
  • let's try another step
  • let's "move all the immutable getters into the base class"

}
}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the getState() method and the updateState(...) methods turn
  • the BindingsMapBase into fully transactional data structure
  • if the updator function passed into updateState is pure function from State to State then:
    • no state update can be lost
    • the final state includes all performed updates
  • no matter how many threads is trying to update the binding map

Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

JaroslavTulach and others added 2 commits June 22, 2025 09:05
Co-authored-by: Pavel Marek <pavel.marek@enso.org>
@JaroslavTulach JaroslavTulach added the CI: Ready to merge This PR is eligible for automatic merge label Jun 22, 2025
@mergify mergify bot merged commit 5845e6c into develop Jun 22, 2025
79 of 81 checks passed
@mergify mergify bot deleted the wip/jtulach/BindingsMapInJava branch June 22, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants