You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a function, the Anoma client / Anoma node replaces the last element of the Nock list in the environment slot of the function with the Anoma library. This corresponds to the AnomaLibrary constructor in AnomaCallablePathId:
The Anoma client / Anoma node will populate this slot for us, so we don't need to include the Anoma library nock code in the compiled output.
The reason why we've deferred this is because the locations of functions in the Anoma library nock code must necessarily be hard coded in the compiler. And so the anoma lib we build and test with must exactly match what is provided by the Anoma node. We do not have tests that run against the Anoma node interpreter so it's safer for now to bundle the Anoma library code in the compiled output. The tradeoff is that the compiled output will be larger, but the size of the Anoma library is small compared to the total compiled output of normal programs.
For this issue:
Populate the AnomaLibrary slot with the nock list nil terminator (i.e 0) instead of populating it with the Anoma library nock code. To do this we adapt the code that populates this slot when constructing the main function:
Following on from:
When executing a function, the Anoma client / Anoma node replaces the last element of the Nock list in the environment slot of the function with the Anoma library. This corresponds to the
AnomaLibrary
constructor inAnomaCallablePathId
:juvix/src/Juvix/Compiler/Nockma/Translation/FromTree.hs
Lines 150 to 160 in d741fbc
During the main function call we populate the
AnomaLibrary
slot with the Nock code of the Anoma library: https://github.com/anoma/juvix/blob/d741fbc9717faa2dc172d1c47a67921f1c8f22a3/runtime/nockma/anomalib.nockmaThe Anoma client / Anoma node will populate this slot for us, so we don't need to include the Anoma library nock code in the compiled output.
The reason why we've deferred this is because the locations of functions in the Anoma library nock code must necessarily be hard coded in the compiler. And so the anoma lib we build and test with must exactly match what is provided by the Anoma node. We do not have tests that run against the Anoma node interpreter so it's safer for now to bundle the Anoma library code in the compiled output. The tradeoff is that the compiled output will be larger, but the size of the Anoma library is small compared to the total compiled output of normal programs.
For this issue:
AnomaLibrary
slot with the nock list nil terminator (i.e0
) instead of populating it with the Anoma library nock code. To do this we adapt the code that populates this slot when constructing the main function:juvix/src/Juvix/Compiler/Nockma/Translation/FromTree.hs
Line 1037 in d741fbc
Update the Anoma / nockma test runner to inject the Anoma library code into the
AnomaLibrary
slot of functions being tested.Make sure there are tests that run the compiled output with the Anoma node nock interpreter.
The text was updated successfully, but these errors were encountered: