a small, stack-based DSL for bit art exploration
Find a file
2026-02-26 19:03:14 -03:00
bin remove tigre and use fenster library for graphical stuff 2024-09-14 01:29:51 +00:00
cmd remove tigre and use fenster library for graphical stuff 2024-09-14 01:29:51 +00:00
docs add wiki pages with documentation to the tree 2025-06-19 17:30:54 +00:00
examples reorganize stuff (again!) 2024-09-04 00:18:20 +00:00
lib nvm 2024-09-04 00:30:20 +00:00
util reorganize stuff (again!) 2024-09-04 00:18:20 +00:00
vendor remove tigre and use fenster library for graphical stuff 2024-09-14 01:29:51 +00:00
.clang-format nvm 2024-09-04 00:30:20 +00:00
.dir-locals.el add dir-locals.el and remove mentions of Tup in ignore-glob 2024-05-11 15:07:19 +00:00
.gitignore add .gitignore 2026-02-26 19:03:14 -03:00
GNUmakefile remove tigre and use fenster library for graphical stuff 2024-09-14 01:29:51 +00:00
LICENSE add license 2024-03-10 04:05:16 +00:00
README.md update README 2026-02-26 19:00:40 -03:00

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