Next: REPL commands, Previous: Invoking the compiler, Up: Compiling to Wasm [Contents][Index]
The (hoot reflect)
module provides an interface for inspecting
and manipulating Scheme values that live within Wasm modules. This is
the primary interface for testing compiler output directly from Guile.
Instantiate and return a new Hoot module using the compiled Scheme Wasm module scheme-wasm and the reflection module reflector. If reflector is not specified, a new reflector instance will be created.
Optionally, imports may contain a 2-tier association list structure of imported functions, globals, tables, and memories:
`(("math" . (("random" . ,(lambda (x) (random x))))))
Invoke the load thunk of module and return the reflected result values.
The following procedures, compile-value
and
compile-call
, are convenience procedures for when you just want
to quickly compile something and see the result and you don’t care
about the intermediary Wasm binary.
Compile exp and return the result.
Optionally, imports may specify a list of Scheme module names to import. If unspecified, a default set of modules providing a basic Scheme environment will be imported. load-path is a list of file system directories to search for additional user modules.
Optionally, wasm-imports may contain a 2-tier association list
structure of imported Wasm functions, globals, tables, and memories.
See hoot-instantiate
for an example of such a structure.
Compile proc-exp and all arg-exps, call the procedure with the arguments, then return the results.
See compile-value
for an explanation of the keyword arguments.
Return #t
if obj is a Hoot module.
Return the reflection module for module.
Return the Wasm instance for module.
Return #t
if obj is a reflector.
Return the Wasm instance of reflector.
Return the association list of ABI imports for reflector.
Below are the predicates and accessors for various Hoot heap types:
Return #t
if obj is a Hoot object.
Return #t
if obj is a Hoot complex number.
Return the real part of complex.
Return the imaginary part of complex.
Return #t
if obj is a Hoot fraction.
Return the numerator of fraction
Return the denominator of fraction.
Return #t
if obj is a Hoot pair.
Return #t
if obj is a mutable Hoot pair.
Return the first element of pair.
Return the second element of pair.
Return #t
if obj is a Hoot vector.
Return #t
if obj is a mutable Hoot vector.
Return the length of vec.
Return the ith element of vec.
Return #t
if obj is a Hoot bytevector.
Return #t
if obj is a mutable Hoot bytevector.
Return the length of bv.
Return the ith byte of bv.
Return #t
if obj is a Hoot bitvector.
Return #t
if obj is a mutable Hoot bitvector.
Return the length of bv.
Return the ith bit of bv.
Return #t
if obj is a Hoot symbol.
Return the string name of sym.
Return #t
if obj is a Hoot keyword.
Return the name string of keyword.
Return #t
if obj is a mutable Hoot string.
Return the underlying string for str.
Return #t
if obj is a Hoot procedure.
Apply the Hoot procedure proc with args.
Apply the Hoot procedure proc in an asynchronous context.
proc should be a procedure that accepts two additional arguments (arguments 0 and 1) in addition to args:
resolved
:
An opaque external value representing the successful completion of the
async operation.
rejected
:
An opaque external value representing the failure of the async
operation.
You almost certainly want to be using this procedure with
call-with-async-result
in the (fibers promises)
module.
Return #t
if obj is a Hoot variable.
Return #t
if obj is a Hoot atomic box.
Return #t
if obj is a Hoot hash table.
Return #t
if obj is a Hoot weak table.
Return #t
if obj is a Hoot fluid.
Return #t
if obj is a Hoot dynamic state.
Return #t
if obj is a Hoot syntax object.
Return #t
if obj is a Hoot port.
Return #t
if obj is a Hoot struct.
Next: REPL commands, Previous: Invoking the compiler, Up: Compiling to Wasm [Contents][Index]