1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 05:42:26 +03:00
juvix/tests
Paul Cadman 3b34f6e4ff
Support random API from the Anoma stdlib (#3129)
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
2024-10-29 18:23:37 +00:00
..
Anoma/Compilation Support random API from the Anoma stdlib (#3129) 2024-10-29 18:23:37 +00:00
Asm Remove copy propagation from the native/WASM and Rust pipelines (#2846) 2024-06-20 12:44:15 +02:00
benchmark Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Casm Run Nockma in an Anoma node (#3128) 2024-10-29 17:32:59 +01:00
Compilation Allow trailing semicolons everywhere (#3123) 2024-10-29 18:25:06 +01:00
Core Add frontend support for Anoma stdlib sha256 (#3109) 2024-10-17 19:11:26 +02:00
examplesExpected Add a test suite for milestone examples (#1920) 2023-03-24 13:16:26 +00:00
Internal Update standard library coding style according to the guidelines (#3092) 2024-10-14 15:56:54 +02:00
negative Fix named application bug (#3075) 2024-10-03 16:26:59 +01:00
nockma/positive Fix bugs in the Nockma prettyprinter and parser (#2632) 2024-02-09 14:59:42 +01:00
positive Allow trailing semicolons everywhere (#3123) 2024-10-29 18:25:06 +01:00
Reg/positive Copy propagation in JuvixReg (#2828) 2024-06-18 21:38:02 +02:00
runtime/positive Add an if instruction to JuvixReg (#2855) 2024-06-26 19:08:33 +02:00
Rust/Compilation/positive Run Nockma in an Anoma node (#3128) 2024-10-29 17:32:59 +01:00
smoke Improve Set and Map modules in the standard library (#3120) 2024-10-24 12:29:33 +01:00
Tree Fix JuvixTree unification (#3087) 2024-10-09 15:33:42 +02:00
VampIR Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
WithoutPackageFile Fix #2510 (#2512) 2023-11-17 16:10:38 +01:00
.gitattributes Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00