10000 GitHub - natescode/sigil: Compiler and toolchain for Silicon / Sulfur programming languages
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compiler and toolchain for Silicon / Sulfur programming languages

License

Notifications You must be signed in to change notification settings

natescode/sigil

Repository files navigation

Sigil: The Silicon Compiler

Sigil is the official compiler for the Silicon programming language. Sigil compiles Silicon to WebAssembly (WASM). View the Silicon language specification.

Installation / Setup

Sigil is currently in early alpha. To build and install:

Tools

# 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

Getting Started

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();
});

Contributing

Contributions are welcome! Please follow the contribution guidelines and open an issue or pull request.

License

Sigil is licensed under the MIT License. See LICENSE for details.

Contact

For discussions and updates, join the Silicon community:

sigil

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.

Tools

WAT 2 WASM

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

Use in JavaScript

const wasmInstance =
      new WebAssembly.Instance(wasmModule, <
5B45
span class="pl-kos">{});
const { main } = wasmInstance.exports;
console.log(main());

Compile, Build, Run

bun run index.ts
wat2wasm main.wat -o main.wasm
wasmer run main.wasm --invoke add 9 7

View WASM Binary

wasmer run main.wasm --invoke foo

About

Compiler and toolchain for Silicon / Sulfur programming languages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0