pub fn compile<'s>(source: &'s str) -> Result<Vec<u8>, Error<'s>>Expand description
Compile the given chasm source code in a WebAssembly module.
The created module imports the function "env" "print" that received a f32 and return nothing,
and a memory "env" "memory" with a minimal size of 1, and exports the function "main", that
has no argument or return, which is the code entry point.
At the end of the execution of the created module, the rendered 100x100 output will be in the linear memory, in the range 0..10000.
ยงExample
let source = "
var y = 0
while (y < 100)
var x = 0
while (x < 100)
c = ((y/100)*255)
setpixel (x, y, c)
x = (x + 1)
endwhile
y = (y + 1)
endwhile";
let wasm = chasm_rs::compile(source);
assert!(wasm.is_ok());