- Notifications
You must be signed in to change notification settings - Fork16
A functional, content-addressable programming language.
License
tekknolagi/scrapscript
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Seescrapscript.org for some more information. Keepin mind that the syntax on the website will change a little bit in the comingweeks to match this repository.
Take a look insidescrapscript.py and all of its tests to getan idea for how the language works.
We support python3.8+.
# With a filepython3 scrapscript.pyeval examples/0_home/factorial.scrap# With a string literalpython3 scrapscript.py apply"1 + 2"# With a REPLpython3 scrapscript.py repl
or withCosmopolitan:
./util/build-com# With a file./scrapscript.comeval 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 prefixwithsh)
or with Docker:
# With a file (mount your local directory)docker run --mount type=bind,source="$(pwd)",target=/mnt -i -t ghcr.io/tekknolagi/scrapscript:trunkeval /mnt/examples/0_home/factorial.scrap# With a string literaldocker run -i -t ghcr.io/tekknolagi/scrapscript:trunk apply"1 + 2"# With a REPLdocker run -i -t ghcr.io/tekknolagi/scrapscript:trunk repl
./scrapscript.py compile some.scrap# produces output.c./scrapscript.py compile some.scrap --compile# produces a.out
CC=~/Downloads/cosmos/bin/cosmocc ./scrapscript.py compile some.scrap --compile# produces a.out
CC=/opt/wasi-sdk/bin/clang \CFLAGS=-D_WASI_EMULATED_MMAN \LDFLAGS=-lwasi-emulated-mman \./scrapscript.py compile some.scrap --compile# produces a.outpython scrapscript_tests.py
mypy --strict scrapscript.py
ruff format scrapscript.py
ruff check scrapscript.py
If you choose to useuv to manage development dependencies, you can run any of the previous four commands by prefixing them withuv run, e.g.:
uv run python scrapscript_tests.py
About
A functional, content-addressable programming language.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.