Skip to content
Fenhl edited this page Oct 25, 2015 · 2 revisions

jqsh is a shell based on jq and sh.

Name

The jq part stands for the jq JSON preprocessor by @stedolan, @nicowilliams, and contributors.

The sh refers to the language being intended for shell scripting in general, as well as the Bourne shell and derived shells (bash and Zsh) specifically.

We're not exactly sure what jq stands for, but we're assuming it means JSON query, which would make jqsh short for JavaScript Object Notation Query Shell.

Language

jqsh's language is based on jq's, but it is not a superset. Some of the most significant differences:

  • There are two new datatypes: exceptions and functions.
  • jqsh filters operate on entire channels insteal of individual values like jq filters.
  • Function arguments are separated from the function and each other by whitespace like in sh, instead of semicolons and parentheses like in jq.
  • The semicolon is an operator which ignores the left side's output, similar to sh's semicolon.
  • Variable assignment uses the syntax $variable = expression instead of expression as $variable.
  • There are new built-ins for calling external programs, importing libraries, raising and handling exceptions, and more.
  • Continuing a convention from JavaScript and JSON, function names are camel cased. Underscores are not permitted in names.
  • The language is more flexible, permitting the definition of new atomic, prefix, suffix, and binary operator symbols and keywords.

Implementation

The first prototype of jqsh was implemented in Python 3, which was easiest for us. The language has significant disadvantages such as the GIL and runtime dependencies, so we are now starting an implementation in Rust, which if all goes well will be the jqsh implementation.

Getting Help

Our main way of communicating is the Slack channel #jqsh on functionalprogramming.slack.com. There is also the IRC channel #jqsh on Freenode.

Clone this wiki locally