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

Use pow2 function from Anoma/Nock stdlib #2629

Merged
merged 2 commits into from
Feb 8, 2024
Merged

Conversation

paulcadman
Copy link
Collaborator

This PR introduces the pow2 function from the Anoma/Nock stdlib, replacing the 'Builtin function' version we wrote in the Tree->Nockma translation. This will be more efficient because it will be jetted in Anoma.

New Anoma/nockma stdlib locations

The Nock stdlib now has multiple layers. We now use a Nock term to
to fetch each stdlib symbol's code because this can be obtained from
Urbit's dojo,

for example:

> =>  anoma  !=(add)
[9 20 0 15]

where anoma is the symbol where the anoma stdlib is loaded.

The stdlib is the Nock code associated with https://github.com/anoma/anoma/blob/6a4e15fe9c356225034f38445ce0eace2b43ab5e/hoon/anoma.hoon

Tests

This commit also adds unit tests for the stdlib / appendRights
functions. The tests use the evaluator with 'interceptStdlibCalls' both
enabled and disabled.

@paulcadman paulcadman added this to the 0.6.0 milestone Feb 8, 2024
@lukaszcz lukaszcz self-requested a review February 8, 2024 09:54
The Nock stdlib now has multiple layers. We now use a Nock term to
to fetch each stdlib symbol's code because this can be obtained from
Urbit's dojo,

for example:

    > =>  anoma  !=(add)
    [9 20 0 15]

where `anoma` is the symbol where the anoma stdlib is loaded.

The stdlib is the Nock code associated with https://github.com/anoma/anoma/blob/6a4e15fe9c356225034f38445ce0eace2b43ab5e/hoon/anoma.hoon

The new stdlib contains the pow2 function, so we can replace our own
implementation.

The append rights function has been inlined.

This commit also adds unit tests for the stdlib / appendRights
functions. The tests use the evaluator with 'interceptStdlibCalls' both
enabled and disabled.
@paulcadman paulcadman merged commit 1edddfb into main Feb 8, 2024
4 checks passed
@paulcadman paulcadman deleted the nockma-stdlib-test branch February 8, 2024 11:22
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.

3 participants