Skip to content

Commit 11b1382

Browse files
committed
fix scry calls for module imports
1 parent 0a5148f commit 11b1382

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ env:
2828
RISC0_VM_VERSION: v1.0.1
2929
# This is the top commit hash in the branch lukasz/juvix-ci-stable
3030
# of the anoma repository.
31-
ANOMA_VERSION: 22168f07dab585f45624da2ca7d5bfb0a388067c
31+
ANOMA_VERSION: cc06bddc6148a46bc7adfefeeda0ea259b0c9ec5
3232
JUST_ARGS: runtimeCcArg=$CC runtimeLibtoolArg=$LIBTOOL
3333
STACK_BUILD_ARGS: --pedantic -j4 --ghc-options=-j
3434

app/Commands/Compile/Anoma/Options.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ parseAnoma = do
4747
)
4848
_anomaNoNockImportDecoding <-
4949
switch
50-
( long "no-import-cue"
51-
<> help "Do not generate code to cue imported modules. Required to run the generated code with the builtin evaluator."
50+
( long "mock-storage"
51+
<> help "Generate import code compatible with simlated storage in the Juvix builtin Nockma evaluator."
5252
)
5353
pure AnomaOptions {..}
5454

src/Juvix/Compiler/Nockma/Translation/FromTree.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ mkScryDecode key = do
329329
bNoDecode <- asks (^. compilerNoImportDecoding)
330330
if
331331
| bNoDecode -> return $ mkScry key
332-
| otherwise -> callStdlib StdlibDecode [mkScry key]
332+
| otherwise -> callStdlib StdlibDecode [mkScry [remakeList ((OpQuote # nockNilTagged "scry-id") : (OpQuote # anomaId) : (OpQuote # blobId) : key)]]
333+
where
334+
anomaId :: Term Natural = TAtom 418447847009
335+
blobId :: Term Natural = TAtom 1651469410
333336

334337
allConstructors :: Tree.Module -> Tree.ConstructorInfo -> NonEmpty Tree.ConstructorInfo
335338
allConstructors md ci =
@@ -361,7 +364,7 @@ supportsNounNockmaRep md ci = fmap NockmaMemRepNoun . run . runFail $ do
361364
where
362365
-- Returns True if all elements of some type are representable with an
363366
-- Atom. There may be false negatives. In that case, a less optimal
364-
-- representation might be chosen, but it shouldn't effect correctness.
367+
-- representation might be chosen, but it shouldn't affect correctness.
365368
typeRepresentedAsAtom :: Tree.Type -> Bool
366369
typeRepresentedAsAtom = \case
367370
Tree.TyInteger {} -> True

0 commit comments

Comments
 (0)