1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-13 11:16:48 +03:00
juvix/test/Anoma
Paul Cadman 59f9b49a77
Capture scry id in the main function and use it when compiling anomaGet (#2705)
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](c7f2d69d1e/lib/anoma/node/executor/worker.ex (L20))
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).

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2024-04-02 16:40:07 +01:00
..
Compilation Capture scry id in the main function and use it when compiling anomaGet (#2705) 2024-04-02 16:40:07 +01:00
Compilation.hs Support compilation of Anoma transactions in nockma backend (#2693) 2024-03-22 23:03:38 +01:00