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

Capture scry id in the main function and use it when compiling anomaGet #2705

Merged
merged 6 commits into from
Apr 2, 2024

Conversation

paulcadman
Copy link
Collaborator

@paulcadman paulcadman commented Mar 28, 2024

The purpose of this PR is to wrap the compiled main function with Nockma code that captures the argument tuple for use when compiling anomaGet calls.

  • The Anoma system expects to receive a function of type ScryId -> Transaction

  • The ScryId is only used to construct the argument to the Scry operation (i.e the anomaGet builtin in the Juvix frontend),

  • When the Juvix developer writes a function to submit to Anoma they use type () -> Transaction, the main function wrapper is used to capture the ScryId argument into the subject which is then used to construct OpScry arguments when anomaGet is compiled.

  • If the Anoma system expectation changes then the wrapper code must be changed.

We could add a transformation that checks that the main function in the Anoma target has no arguments. However it is convenient to be able to write functions with arguments for testing and debugging (for example compiling directly to a logic function).

@paulcadman paulcadman added this to the 0.6.2 milestone Mar 28, 2024
@paulcadman paulcadman self-assigned this Mar 28, 2024
@paulcadman paulcadman changed the title Use the args tuple from the main function as the id to scry Capture scry id in the main function and use it when compiling anomaGet Mar 28, 2024
@paulcadman paulcadman marked this pull request as ready for review March 28, 2024 11:45
In Storage we want key terms to be compared as if they had no tags. We
achieve this by introucing a newtype for keys and stripping out the tags
as part of the Hashable/Eq instance definitions
@paulcadman paulcadman merged commit 59f9b49 into main Apr 2, 2024
4 checks passed
@paulcadman paulcadman deleted the argtuple-scry-id branch April 2, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants