| bin | ||
| cmd | ||
| docs | ||
| examples | ||
| lib | ||
| util | ||
| vendor | ||
| .clang-format | ||
| .dir-locals.el | ||
| .gitignore | ||
| GNUmakefile | ||
| LICENSE | ||
| README.md | ||
Blit is a small, stack-based language for bit art exploration.
Building
Currently tested targets are Linux and OpenBSD. Blit should build in any POSIX-compliant target, but most have not been tested. Windows and macOS are not supported, your mileage may vary.
Building is done by running the make command (or gmake if running on *BSD systems, after installing the package), this will build the interpreter and the assembler binaries.
Usage
Command-line interpreter
The blit program is the core interpreter.
$ cmd/blit -h
usage: blit [-h8Pc] [-D <image size>] [-t <value>] file
-h: print this help text
-8: use 8-bit grayscale mode
-P: use paletted mode
-c: accept bytecode input
-D <image size>: set image size (default: 256x256)
-t <value>: set machine's T register (default: 0)
blit outputs Netpbm data, you might want to use a tool like ImageMagick to convert to commonly used image formats:
$ cmd/blit examples/birds.blit | convert - birds.gif
Assembler
The blas program assembles Blit code to bytecode. This can be useful for situations where a program will be evaluated multiple times (see the utils/animate.sh script for an example). It takes both input and output files as arguments.
Animation script
The animation script aids in creating GIF animations of Blit code. It takes all the parameters the blit binary takes, except for -t, and adds two parameters -f and -d for setting the length of the animation in frames and the time each frame takes, respectively.
It requires the Netpbm toolkit and Gifsicle.
$ make
$ util/animate.sh examples/city.blit
...
$ open examples/city.gif