implement factorial example

This commit is contained in:
Folkert 2021-09-08 20:05:05 +02:00
parent f40949c64e
commit e802da5f54
3 changed files with 51 additions and 14 deletions

View file

@ -25,6 +25,9 @@ pub fn build_module<'a>(
let mut backend = WasmBackend::new();
let mut layout_ids = LayoutIds::default();
let mut procedures: std::vec::Vec<_> = procedures.into_iter().collect();
procedures.sort_by(|a, b| b.0 .0.cmp(&a.0 .0));
for ((sym, layout), proc) in procedures {
let function_index = backend.build_proc(proc, sym)?;
if env.exposed_to_host.contains(&sym) {