GithubHelp home page GithubHelp logo

thaliaarchi / wsjq Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 1.0 139 KB

Whitespace interpreter and debugger in jq

License: Mozilla Public License 2.0

jq 87.69% Shell 12.31%
whitespace-language interpreter debugger

wsjq's Introduction

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

To run it with jqjq, checkout the jqjq-compat branch and use wsjqjq instead of wsjq.

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.

jqjq by Mattias Wadman is a jq interpreter in jq. I have contributed features to help wsjq run in jqjq.

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.

wsjq's People

Contributors

thaliaarchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

esovm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.