Skip to content
/ wsjq Public
forked from thaliaarchi/wsjq

Whitespace interpreter and debugger in jq

License

Notifications You must be signed in to change notification settings

esovm/wsjq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wsjq — Whitespace interpreter in jq

wsjq is an interpreter and debugger for the Whitespace programming language, written in jq.

Usage

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).

Real-time I/O

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.

Limitations from jq

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.

See also

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.

License

This project is made available under the Mozilla Public License, v. 2.0.

About

Whitespace interpreter and debugger in jq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • jq 86.3%
  • Shell 13.7%