deno install -A -n whistle https://deno.land/x/whistle/cli.ts
Usage
whistle -h
Examples
Module Usage
import{Whistle, load }from"https://deno.land/x/whistle/mod.ts";const bits =awaitnewWhistle("export fn add(a: i32, b: i32): i32 { return a + b }").compile();const{ add }=awaitload(bits);console.log(add(40,2));
Hello World
import{Whistle, load }from"https://deno.land/x/whistle/mod.ts";const bits =awaitnewWhistle(`
// optional main function which runs by default
export fn main(): i32 {
// prints Hello World to the console
printString("Hello World!")
return 0
}
`).compile();awaitload(bits)