Compiler
Create ready to use binary from source files
Installation
With NPM:
$ npm i @rapid-lang/compiler -gRapid Compiler and Rapid CLI works on OS X, Windows and Linux.
Example usage
Compiles file.rapid and outputs app.wasm with sourcemaps ready to be run in browser.
$ rapid-compiler file.rapid -o app.wasm -sfunction main(): int {
return 12
}(module
(type $none_=>_i32 (func (result i32)))
(export "main" (func $main))
(func $main (; 0 ;) (; has Stack IR ;) (result i32)
;;@ file.rapid:2:1
(i32.const 12)
)
)func (result i32)
i32.const 12
endAPI
Commands:
index.js source Path to source file to be compiled
Options:
-o, --output Path to result file to be saved [string] [required]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
-s, --sourceMaps Generate sourceMaps for debugging [boolean]
-t, --textFormat Generate WebAssembly Text Format (wat) file [string]
-p, --port Sourcemaps default port [number]Last updated
Was this helpful?