From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: Which package is your goto package for pretty-printing javascript? Date: Wed, 27 Feb 2019 02:06:28 +0800 Message-ID: <87pnrefmqj.fsf@gmail.com> References: <87r2bwpd2h.fsf@gmail.com> <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:58297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyhLc-0002mZ-UW for help-guix@gnu.org; Tue, 26 Feb 2019 13:20:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyh8C-0000hU-9S for help-guix@gnu.org; Tue, 26 Feb 2019 13:07:05 -0500 In-Reply-To: <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com> (Vladimir Sedach's message of "Mon, 25 Feb 2019 23:34:11 -0800") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Vladimir Sedach Cc: guile-user@gnu.org, help-guix@gnu.org, alexvong1995@gmail.com --=-=-= Content-Type: text/plain [I'm CC'ing guile-user because what I'm about to say might be more relevant there...] Vladimir Sedach writes: > I use json-reformat.el in Emacs, and the jq program (which does > pretty-printing, among many other things) when I have to shell > script. > Isn't both programs work with json instead of javascript? Anyway, after thinking more careful, it seems I need something more powerful than a pretty-printer. I'll ask in guix-devel about this later. However, thanks for letting me know about jq! In the homepage, it is mentioned that "jq is like sed for JSON data". This sounds very interesting: *nix filters typically work with string line by line. Data-structure-wise, we are working with list. More precisely, it's stream (aka lazy list) because we may not get the whole thing during piping and redirection. On the other hand, in lisp, we work with s-expression (tree). I've been wondering if it's possible to create *nix filters that work with tree. It seems it's exactly what jq is doing! One application I've long dreamt about: create a variant of grep which works with context free grammar instead of regular expression. I've even decided to name it cfgrep... > Vladimir --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQwb8uPLAHCXSnTBVZh71Au9gJS8gUCXHWAJAAKCRBh71Au9gJS 8u/XAPsHsQVfjMiZVK5JhTSyyyit+XiAb0XpkjaiRJhIyJnrJAEA6j+nm4v/IDje QRQnmF51gKEvJ/m8tTdVCOs3n829yQ0= =Flnr -----END PGP SIGNATURE----- --=-=-=--