You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Require standard library guppy.std.wasm with functions:
@guppy.structclassWASMContext:
"""Affine type representing state of environment."""defnew_wasm_checked() ->Option[WASMContext]:
"""Returns a new WASM environment if available else None."""defnew_wasm() ->WASMContext:
"""Panicking version of `new_wasm_checked`""".
new=new_wasm_checked()
ifnew.is_some():
returnnew.unwrap()
panic("No more WASM environments available")
Example:
# all declared wasm signatures are treated as belonging to single wasm module@guppy.wasmdefadd_one(x: int) ->int: ...
@guppy.wasmdefadd_syndrome(syndrome: array[bool, 3]) ->None: ...
@guppy.wasmdefdecode() ->int: ...
@guppydefmain() ->None:
wasm1=new_wasm()
wasm2=new_wasm()
y=wasm1.add_one(x) # all methods take WASMContext as inoutwasm2.add_syndrome(array(True, False, False))
decoded=wasm2.decode()
The text was updated successfully, but these errors were encountered:
See CQCL/tket2#737 for proposed extension spec.
Require standard library
guppy.std.wasm
with functions:Example:
The text was updated successfully, but these errors were encountered: