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 frontend support for Anoma Resource Machine builtins #3113

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

paulcadman
Copy link
Collaborator

@paulcadman paulcadman commented Oct 21, 2024

This PR adds frontend builtin support for the Anoma Resource machine functions provided in resource-machine.hoon, except for the prove-logic function which still needs some discussion.

Users must now mark the Anoma Resource type with builtin-anoma-resource and the Anoma Action type with builtin-anoma-action. This is required because the resource machine functions use these types.

The compiler does not check that the constructors of Resource and Action match the RM spec. I made this decision because the Anoma types are sill in flux and it's easier to change if correctness is delegated to the RM library for now. We can add the constructor checks when the Anoma RM interface is stable.

The test file test085.juvix demonstrates how each builtin should be used.

Core Evaluator

The Core evaluator does not support these builtin functions in normal mode. When used for normalisation (e.g when used in the constant folding pass) the Core evaluator leaves the builtin functions unchanged.

Nock Evaluator

The Nock evaluator does not intercept the Anoma lib functions that the builtins correspond to in the Nock backend. It executes the underlying Nock code instead. This means that several of the functions cannot be tested because they're either too slow (e.g commitment) or do not have an implementation in the Nock code (e.g addDelta).

@paulcadman paulcadman added this to the 0.6.7 milestone Oct 21, 2024
@paulcadman paulcadman self-assigned this Oct 21, 2024
@paulcadman paulcadman force-pushed the nockma-rm-integration-frontend branch from c34c762 to 8218c30 Compare October 21, 2024 22:34
@paulcadman paulcadman force-pushed the nockma-rm-integration-frontend branch from 8218c30 to 4ba97d2 Compare October 21, 2024 22:39
@paulcadman paulcadman marked this pull request as ready for review October 22, 2024 10:22
@janmasrovira janmasrovira merged commit 18cca89 into main Oct 22, 2024
7 of 8 checks passed
@janmasrovira janmasrovira deleted the nockma-rm-integration-frontend branch October 22, 2024 11:10
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.

Support resource machine client library in the nock backend
2 participants