wsjq is an interpreter and debugger for the Whitespace programming language, written in jq.
wsjq --help
wsjq hworld.ws
wsjq run hworld.ws
whoami > name.txt
wsjq debug --in-file=name.txt --no-prompt name.ws
wsjq disasm fact.ws
wsjq --jq=gojq hworld.ws
wsjq requires at least jq 1.6 or gojq 0.12.9 (for gojq#186).
wsjq prints to stdout by generating a stream of strings that are immediately
emitted, rather than by appending to a buffer. wsjq sets the main input source
to be stdin so that user input is streamed line-by-line with input
. The
contents of the Whitespace source file are then bound to the $src
variable
with --rawfile
.
When running with jq, integers have 53 bits of precision, because jq uses 64-bit
floating point numbers, and readc
collapses CRLF to LF on Windows, because
input
strips line endings according to the current OS.
Run with gojq (--jq=gojq
) to use arbitrary-precision integers and preserve
line endings.
bf.jq by itchyny
(blog post)
and bf.jq by
MakeNowJust are Brainfuck interpreters written in jq, though neither support the
,
read operator and both display .
output on program termination.
The jq standard library filters defined in builtin.jq are a helpful reference for learning advanced usage.
This project is made available under the Mozilla Public License, v. 2.0.