Scrapscript interpreter
Project description
Scrapscript Interpreter
See scrapscript.org for some more information. Keep in mind that the syntax on the website will change a little bit in the coming weeks to match this repository.
Take a look inside scrapscript.py and all of its tests to get an idea for how the language works.
Usage
We support python3.8+.
# With a file
python3 scrapscript.py eval examples/0_home/factorial.scrap
# With a string literal
python3 scrapscript.py apply "1 + 2"
# With a REPL
python3 scrapscript.py repl
or with Cosmopolitan:
./build-com
# With a file
./scrapscript.com eval examples/0_home/factorial.scrap
# With a string literal
./scrapscript.com apply "1 + 2"
# With a REPL
./scrapscript.com repl
(if you have an exec format error and use Zsh, either upgrade Zsh or prefix
with sh
)
The experimental compiler:
Normal ELF
./scrapscript.py compile some.scrap # produces output.c
./scrapscript.py compile some.scrap --compile # produces a.out
Cosmopolitan
CC=~/Downloads/cosmos/bin/cosmocc ./scrapscript.py compile some.scrap --compile # produces a.out
Wasm
CC=/opt/wasi-sdk/bin/clang \
CFLAGS=-D_WASI_EMULATED_MMAN \
LDFLAGS=-lwasi-emulated-mman \
./scrapscript.py compile some.scrap --compile # produces a.out
Running Tests
python3 scrapscript.py test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scrapscript-0.1.0.tar.gz
(29.0 kB
view hashes)
Built Distribution
Close
Hashes for scrapscript-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4467e72bb2e4edbd164bc66d37951c5a3585c0c568187623f244c90ff9df99b0 |
|
MD5 | 78a98620b9a8a968d697e50b4a98f57d |
|
BLAKE2b-256 | cd9093b0f252d1d89245b46fd58b359b65b26a9a035e3e50032507a41c0c1920 |