-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Anoma nock stdlib and use pow2 in appendRights
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.
- Loading branch information
1 parent
ca0ba4f
commit 90752c9
Showing
7 changed files
with
89 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Juvix.Compiler.Nockma.StdlibFunction.Base where | ||
|
||
import Juvix.Prelude hiding (Atom, Path) | ||
import Juvix.Prelude.Pretty | ||
|
||
instance Pretty StdlibFunction where | ||
pretty = \case | ||
StdlibDec -> "dec" | ||
StdlibAdd -> "add" | ||
StdlibSub -> "sub" | ||
StdlibMul -> "mul" | ||
StdlibDiv -> "div" | ||
StdlibMod -> "mod" | ||
StdlibLt -> "<" | ||
StdlibLe -> "<=" | ||
StdlibPow2 -> "pow2" | ||
|
||
data StdlibFunction | ||
= StdlibDec | ||
| StdlibAdd | ||
| StdlibSub | ||
| StdlibMul | ||
| StdlibDiv | ||
| StdlibMod | ||
| StdlibLt | ||
| StdlibLe | ||
| StdlibPow2 | ||
deriving stock (Show, Lift, Eq, Bounded, Enum) |
Oops, something went wrong.