Wi is a small, fast, embeddable, prototype-based scripting language
obj_hunter := object { pounce: |self| => std::puts("${self.name} pounces on the yarn!"); }; obj_sleeper := object { nap: |self| => std::puts("${self.name} takes a nap in the sun."); }; obj_cat := new obj_hunter, obj_sleeper { name: "Kitty"; meow: |self| => std::puts("${self.name} says meow! (=^・ω・^=)"); }; whiskers := new obj_cat { name: "Whiskers"; }; whiskers->pounce(); %% Whiskers pounces on the yarn! whiskers->nap(); %% Whiskers takes a nap in the sun. whiskers->meow(); %% Whiskers says meow! (=^・ω・^=)
- Wi is small. The entire implementation is under 15,000 lines of code.
- Wi is fast. Single-pass compilation to bytecode with compact value representation. You can check out the benchmarks.
- Wi is simple. You can pick up the syntax and standard library in under a week from the documentation.
- Wi is prototype-based. No classes – just objects. You can clone or merge them to build new ones.
Supported platforms
| Platform | Toolchain | Support |
|---|---|---|
| Linux | GCC, Clang, MinGW | Full |
| Windows | MSVC, MinGW | Full |
| WASM | Emscripten | Partial, only wi_wasm_init/wi_wasm_run, no foreign libraries |
WASM support is, as you can see, pretty minimal. Since it's only used by that little Wi playground.
Other platforms (macOS, BSD, etc.) are not officially supported. Wi may build there, but it is not tested and foreign libraries are unavailable.
Contributions towards the support of different platforms can be done via pull requests!
Notes
This programming language was created by me, and only me – a single person. It's in beta, because I'm still designing it and breaking syntax changes can happen, though right now – very unlikely; the project is finally gaining some stability both in syntax and in FFI/API. The standard library is designed to be minimal, but useful. Other than the FFI/API, the code is not heavily commented. Some parts may still need polish, and I'm very open to suggestions – if you have one, open an issue!No AI was used in the development of Wi – I'm all by myself.
