Sigil is the official compiler for the Silicon programming language. Sigil compiles Silicon to WebAssembly (WASM). View the Silicon language specification.
Sigil is currently in early alpha. To build and install:
# Clone the repository
git clone https://github.com/your-org/sigil.git
cd sigil
bun install
# Compile and Run
## Run the compiler
bun run index.ts
## Convert WAT (WASM Text) to WASM binary
wat2wasm main.wat -o main.wasm
## Run the WASM via wazmer
wasmer run main.wasm --invoke add 9 7
Create a simple Silicon program (hello.sil
):
@fn main = {
&print("Hello, Silicon!");
};
Compile it to WASM:
sigil compile hello.sil -o hello.wasm
Run it in a JavaScript environment:
const fs = require("fs");
const wasmBuffer = fs.readFileSync("hello.wasm");
WebAssembly.instantiate(wasmBuffer).then(({ instance }) => {
instance.exports.main();
});
Contributions are welcome! Please follow the contribution guidelines and open an issue or pull request.
Sigil is licensed under the MIT License. See LICENSE for details.
For discussions and updates, join the Silicon community:
- Discord: [Invite Link]
- GitHub Issues: Report bugs or suggest features
- Website: [Coming soon]
To install dependencies:
bun install
To run:
bun run index.ts
This project was created using bun init
in bun v1.0.29. Bun is a fast all-in-one JavaScript runtime.
Currently, Sigil only compiles to WAT (Web Assembly text format)
To convert use wat2wasm
CLI.
brew install binaryen
brew install wabt
wat2wasm main.wat -o main.wasm
const wasmInstance =
new WebAssembly.Instance(wasmModule, {});
const { main } = wasmInstance.exports;
console.log(main());
bun run index.ts
wat2wasm main.wat -o main.wasm
wasmer run main.wasm --invoke add 9 7
wasmer run main.wasm --invoke foo