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

Add FromJSONE instances for Value, Env, and related types #2213

Open
byorgey opened this issue Nov 22, 2024 · 0 comments
Open

Add FromJSONE instances for Value, Env, and related types #2213

byorgey opened this issue Nov 22, 2024 · 0 comments
Labels
C-Project A larger project, more suitable for experienced contributors. S-Moderate The fix or feature would substantially improve user experience. Z-Feature A new feature to be added to the game.

Comments

@byorgey
Copy link
Member

byorgey commented Nov 22, 2024

Once we merge #2202, contexts (such as those contained in an Env) will be serialized to JSON as a single hash value. The only way to read such things back in will be to provide a mapping from hash values to pieces of a context tree, i.e. CtxMap CtxTree t for some t, which can be consulted when encountering a hash. In other words, we need instances of the form instance FromJSONE (CtxMap CtxTree t) ... as the next step towards #2107 and ultimately #50.

Some commented-out code which is an early experiment towards producing such an instance for Value can be found in Swarm.Language.JSON. Unfortunately there doesn't seem to be a way to leverage currently existing automatic code generation to help write these. We might consider actually writing some instances based on Generic instead of hand-crafting instances for each type we need.

@byorgey byorgey added Z-Feature A new feature to be added to the game. C-Project A larger project, more suitable for experienced contributors. S-Moderate The fix or feature would substantially improve user experience. labels Nov 22, 2024
byorgey added a commit that referenced this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Project A larger project, more suitable for experienced contributors. S-Moderate The fix or feature would substantially improve user experience. Z-Feature A new feature to be added to the game.
Projects
None yet
Development

No branches or pull requests

1 participant