Skip to main content

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

Metadata

Release files for scrapscript 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapscript 0.1.1
File Size Uploaded Provenance Actions
scrapscript-0.1.1.tar.gz 29.0 kB Without provenance Details for scrapscript-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapscript 0.1.1
File Interpreter ABI Platform Actions
scrapscript-0.1.1-py3-none-any.whl Python 3 none any Details for scrapscript-0.1.1-py3-none-any.whl

Total release size: 58.1 kB

Release files / scrapscript-0.1.1.tar.gz

Download URL scrapscript-0.1.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
29978d947617968b6031a39a9d8d3c7ee19267b5d0e97261d9844238675327b1
BLAKE2b-256 checksum
How to use checksums
76556e63fbb418055baf34aed4cddf90634a81cdf4b11ac312d620c6c7767899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.19.0-38-generic

Release files / scrapscript-0.1.1-py3-none-any.whl

Download URL scrapscript-0.1.1-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a5da62aa2700edcb479a1c17e22d38d5823ddae6a8dd1feaf56ba253d3b4527
BLAKE2b-256 checksum
How to use checksums
e2e8ac8328947b1317be041aea5c82101984b803a464973476632c6c38b999b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.19.0-38-generic

Security for scrapscript 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page