diff --git a/README.md b/README.md index 4b89d06..5bc0d85 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,106 @@ SLS is a statically-typed, stack-based language with pure postfix notation combining the execution model of HP's RPL, the type system of C and Rust, and modern array operations from Uiua. + +## Build Commands + +**Linux** + +C +```bash +cd SLS_C +python3 build.py build +./bin/sls +``` + +Python Setup +```bash +cd SLS_Python +python -m venv .venv +source .venv/bin/activate +pip install build wheel "setuptools>=61.0" +pip install -e sls_build_backend +``` + +Python +``` +cd SLS_Python +source .venv/bin/activate +python3 -m build --no-isolation +pip install ./dist/sls_python-0.0.2a0-py3-none-any.whl +python3 -m sls_py +python3 -m sls_py.calc +``` + +Rust +```bash +cd SLS_Rust/sls +cargo build +./target/debug/sls_rs +``` + +**Windows** + +C (Using Visual Studio Developer PowerShell) +```shell +cd SLS_C +python build.py build +.\bin\sls.exe +``` + +Python Setup +```bat +cd SLS_Python +python -m venv .venv +.venv\Scripts\activate.bat +pip install build wheel "setuptools>=61.0" +pip install -e sls_build_backend +``` + +Python +```bat +cd SLS_Python +.venv\Scripts\activate.bat +python -m build --no-isolation +pip install .\dist\sls_python-0.0.2a0-py3-none-any.whl +python -m sls_py +python -m sls_py.calc +``` + +Rust +```bat +cd SLS_Rust\sls +cargo build +.\target\debug\sls_rs.exe +``` + +**MacOS** + +Reference Linux build instructions. + +For C there is the `python build.py macos` command, but it is untested as I +didn't test it on a Mac. I also don't know if `python build.py build` would also +work on a Mac. + +Python and Rust should just be the same or similar to Linux. + +**RP2040** + +Only tested on Linux. Only SLS_C supports RP2040. + +Install Pico SDK to `~/pico/pico-sdk`, or set environment variable +`PICO_SDK_PATH` to your installation path. You will also need to install the +appropriate compiler. + +Debian GNU/Linux +```bash +sudo apt install gcc-arm-none-eabi +``` + +```shell +cd SLS_C +python build.py rp2040 +``` + +Flash Raspberry Pi Pico: +Copy `.\build_pico\sls.elf.uf2` to your Pico in BOOTSEL mode