Wi Programming Language


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! (=^・ω・^=)
Want to try it? Try it here!

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.