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.1.tar.gz
(29.0 kB
view hashes)
Built Distribution
Close
Hashes for scrapscript-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5da62aa2700edcb479a1c17e22d38d5823ddae6a8dd1feaf56ba253d3b4527 |
|
MD5 | f7e826c1ee8d07da15da5dd31d555821 |
|
BLAKE2b-256 | e2e8ac8328947b1317be041aea5c82101984b803a464973476632c6c38b999b8 |