mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
a4f551547b
* Adds a RISC0 backend which generates Rust code that can be compiled with the official RISC0 toolchain. * The RISC0 backend is a wrapper around the Rust backend. * Adds the `risc0-rust` to the `compile` CLI command, which creates a directory containing host and guest Rust sources for the RISC0 zkVM. The generated code can be compiled/run using `cargo` from inside the created directory (requires having RISC0 installed: https://dev.risczero.com/api/zkvm/install).
17 lines
259 B
Plaintext
17 lines
259 B
Plaintext
-- lists
|
|
module test022;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
gen : Nat → List Nat
|
|
| zero := nil
|
|
| n@(suc m) := n :: gen m;
|
|
|
|
sum : Nat → Nat
|
|
| n := foldl (+) 0 (gen n);
|
|
|
|
sum' : Nat → Nat
|
|
| n := foldr (+) 0 (gen n);
|
|
|
|
main : Nat := sum 1000 + sum' 1000;
|