Shiika works on Mac, Linux and Windows (with and without WSL2.) Only 64bit environments are supported.
You can develop shiika in a Docker container without configuring your local environment.
See develop-in-docker.md for details.
- eg.
brew install llvm@18on Mac - eg.
sudo apt install llvm-18 clang-18on Ubuntu- Try https://apt.llvm.org/ if llvm-18 not available
- You may need
sudo apt install cmakeon Ubuntu - (TODO)
apt install libgc-devneeded on Ubuntu?
You may need to setup some environment variables. For example, on Mac:
export PATH="$(brew --prefix)/opt/llvm@18/bin":$PATH
export LDFLAGS="-L$(brew --prefix)/opt/llvm@18/lib"
export CPPFLAGS="-I$(brew --prefix)/opt/llvm@18/include"
and on Ubuntu:
export LLC=llc-18
export CLANG=clang-18
You need to compile corelib before running any Shiika programs.
$ git clone https://github.com/shiika-lang/shiika
$ cd shiika
$ cargo build
$ cd lib/skc_rustlib; cargo build; cd ../../
$ cargo run -- build-corelib
The build-corelib subcommand compiles core classes (builtin/*.sk) into ./builtin/builtin.bc and ./builtin/exports.json.
$ cargo run -- run examples/hello.sk
See setup_windows.md
Shiika assumes cargo generates artifacts into ./target. You can change this by SHIIKA_CARGO_TARGET envvar.
By cargo install --path . you can install the compiler as ~/.cargo/bin/shiika.
Then you can run Shiika programs by shiika run foo.sk.
However you may see errors something like
$ shiika run main.sk
Error: ./builtin/exports.json not found
because shiika looks for corelib in the current directory by default. You can configure this by setting SHIIKA_ROOT to point the cloned repository.
export SHIIKA_ROOT=/path/to/repo/of/shiika
error: could not find native static library `Polly`, perhaps an -L flag is missing?
error: could not compile `llvm-sys` due to previous error
=> sudo apt install libpolly-18-dev
This may happen when you install llvm from https://apt.llvm.org/ .
/Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: syntax error near unexpected token `disable-shared'
/Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: `LT_INIT(disable-shared)'
=> brew install libtool