Get Started





npm install -g lichenscript

Quick Start

Make a new directory, and create a file named in it.

Coding in this file:

function main() {
print("Hello World");

Execute the command to run:

lsc run ./


You can use the flag --platform to tell the compiler to compile to JavaScript:

lsc run --platform js ./


Make sure you have installed Emscripten. And make sure emcc is available in your shell.

Execute the command:

lsc run --platform wasm32 ./

Standalone WebAssembly

By default, the compiler generate the wasm files along with a JavaScript file to load the WebAssembly file.

But if you want to compile LichenScript to a standalone wasm and load with a runtime, you can use the flag --standalone-wasm.

For example, if you want use WasmEdge to execute the wasm file, execute the command:

lsc run --platform wasm32 --standalone-wasm wasmedge ./

A standalone wasm will be generated and the compiler will spawn wasmedge to execute the wasm.

Before you execute this above command, make sure you have install WasmEdge.