Software Alternatives & Reviews

Solving Advent of Code with Jq

asciinema JQPlay
  1. Record and share your terminal sessions, the right way. Forget screen recording apps and blurry video. Enjoy a lightweight, purely text-based approach to terminal recording.
    Pricing:
    • Open Source

    #Development Tools #Terminal Tools #Terminal Session Sharing 67 social mentions

  2. 2
    Stream editor for JSON live in the browser
    Pricing:
    • Open Source
    Repo author here, let me promote jq a bit – it's much more than a simple command-line JSON processor you know it for: * It is a generator-based language which means you operate streams of values rather than single values. Takes some time to get used to, but you'd never want to go back to traditional model, at least for data processing. See 'Generators and iterators' section of the man page: https://github.com/stedolan/jq/blob/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8/docs/content/manual/manual.yml#L2852 * Designed for CLI, it makes it easy and even pushes you to express your program as a single pipeline. You rarely need variables, functions or any control structure. And pipelines are great to build iteratively, debug and compose (see https://jqplay.org, https://jqterm.com) * Core language is small but powerful with features like slicing, destructuring, complex assignments and error handling. And you are already an expert in it's (immutable) data structures – it is just JSON * Batteries included in the stdlib – regex, path operations, C math/dates, algorithms. Modules are supported, but I did not need any dependencies for solving Advent of Code. * jq is ubiquitous. Often pre-installed, tiny binary, no dependencies, basically single version (ok, awk is better – anything else?) Being a go-to tool for JSON is sort of a double-edged sword – people just don't look past that. But nowadays JSON is <i>the</i> format for data, everything is convertible to it. And you can feed plain text into jq using --raw-input flag. i.e.: <pre><code> jq -nR '[inputs]' /etc/hosts.

    #Productivity #Developer Tools #Software Marketplace 3 social mentions

Discuss: Solving Advent of Code with Jq

Log in or Post with