Hacker News new | past | comments | ask | show | jobs | submit login

I find the stateless streaming paradigm in jq very pleasing.

Results can be emitted iteratively using generators, which are implemented as tail-recursive streams [0]. Combined with the `input` built-in filter, which yields the next item in the input stream, and jq can handle real-time I/O and function as a more general-purpose programming language.

I built an interpreter for the Whitespace programming language in jq using these concepts and it's easily one of the most complex jq programs out there.

[0]: https://stedolan.github.io/jq/manual/#Generatorsanditerators

[1]: https://github.com/andrewarchi/wsjq




Wow, I've been on the lookout for larger jq programs from which to learn. I'm going to enjoy learning from wsjq, thank you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: