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

Immutable structures without storage identity #338

Open
jclark opened this issue Sep 19, 2019 · 2 comments
Open

Immutable structures without storage identity #338

jclark opened this issue Sep 19, 2019 · 2 comments
Assignees
Labels
enhancement Enhancement to language design incompatible Resolving issue may not be backwards compatible lang Relates to the Ballerina language specification Type/Proposal Lang spec proposals

Comments

@jclark
Copy link
Collaborator

jclark commented Sep 19, 2019

Issue #282 is a special case of a more general problem. It is sometimes useful to be able to have structures (both lists and mappings) with pure value semantics. As well as being immutable, they do not have identity distinct from the identity of their members; two such structures are === if their members are ===.

This relates to #47. We want to be able to have structures e.g. for dates and times, that are mapped onto a database engine's native datatypes. But these native datatypes have value semantics.

It also relates to #189.

@jclark jclark added enhancement Enhancement to language design lang Relates to the Ballerina language specification labels Sep 19, 2019
@jclark jclark added this to the 2019R4 milestone Sep 19, 2019
@jclark jclark self-assigned this Sep 19, 2019
@jclark jclark modified the milestones: 2019R5, 2020R1, 2020R2 Dec 21, 2019
This was referenced Feb 3, 2020
@jclark
Copy link
Collaborator Author

jclark commented Feb 28, 2020

There is now a public proposal.

@jclark
Copy link
Collaborator Author

jclark commented Mar 28, 2020

The immutability proposal solves this problem by saying that the construction of read-only types should do interning construction, which effectively means that read-only types do not have storage identity.

@jclark jclark changed the title Immutable structures without identity Immutable structures without storage identity Mar 28, 2020
@jclark jclark added the incompatible Resolving issue may not be backwards compatible label Aug 6, 2020
@jclark jclark modified the milestones: Later, Swan Lake updates Feb 18, 2022
@praneesha praneesha added the Type/Proposal Lang spec proposals label Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to language design incompatible Resolving issue may not be backwards compatible lang Relates to the Ballerina language specification Type/Proposal Lang spec proposals
Projects
None yet
Development

No branches or pull requests

2 participants