mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
3b34f6e4ff
This PR adds frontend support for the Anoma Random API: The frontend builtin APIs are: ``` builtin anoma-random-generator axiom RandomGenerator : Type; builtin anoma-random-generator-init axiom randomGeneratorInit : Nat -> RandomGenerator; builtin anoma-random-generator-split axiom randomGeneratorSplit : RandomGenerator -> Pair RandomGenerator RandomGenerator; builtin anoma-random-next-bytes axiom randomNextBytes : Nat -> RandomGenerator -> Pair ByteArray RandomGenerator; ``` ### Nockma Evaluator The Nockma evaluator intercepts the corresponding Anoma random stdlib calls using the [System.Random](https://hackage.haskell.org/package/random-1.2.1.2/docs/System-Random.html) API. The implementation uses the [splitmix](https://hackage.haskell.org/package/splitmix-0.1.0.5/docs/System-Random-SplitMix.html) generator directly because it has an API to destructure the generator into a pair of integers. We can use this to serialise the generator. * Closes https://github.com/anoma/juvix/issues/2902 |
||
---|---|---|
.. | ||
Anoma/Compilation | ||
Asm | ||
benchmark | ||
Casm | ||
Compilation | ||
Core | ||
examplesExpected | ||
Internal | ||
negative | ||
nockma/positive | ||
positive | ||
Reg/positive | ||
runtime/positive | ||
Rust/Compilation/positive | ||
smoke | ||
Tree | ||
VampIR | ||
WithoutPackageFile | ||
.gitattributes |