1. 26
  1.  

  2. 7

    I wrote a “pure Perl” JSON parser for TTYtter. I put that in quotes because it abuses the Perl interpreter to do it (essentially does sanity checks to make sure it’s not being given actual code to execute, and then does an eval on it), and as such it inherits Perl irregularities such as how it handles barewords like true and false (which didn’t matter for that application). However, it was fast and did the job, and required no external libraries. This one is cleaner. Thumbs up.

    EDIT: Just tested it on my AIX 6 machine with IBM awk and it seems to work basically there too, no gawk extensions needed. Jolly good. It didn’t work right on the amazonaws example but that might have been the size of the input set.

    1. 3

      Imma let you finish but I just wanna say TTYtter was the best Twitter client out there and the replacement Oysttyer is almost as good. Thanks for creating TTYtter!

      1. 1

        Aww, thanks, man!

      2. 1

        I wrote a “pure Perl” JSON parser for TTYtter. I put that in quotes because it abuses the Perl interpreter to do it (essentially does sanity checks to make sure it’s not being given actual code to execute, and then does an eval on it), and as such it inherits Perl irregularities such as how it handles barewords like true and false (which didn’t matter for that application).

        Wouldn’t it be a pure Perl “JSON” parser, rather than a “pure Perl” JSON parser?

        1. 1

          Well, I guess you should put both of them in quotes, because the parser abuses the interpreter - it isn’t actually written in the language. So it’s a “pure Perl” “JSON” parser.

          Ah, heck, put “parser” in quotes too. 8-D

          1. 1

            Is Perl even a language in that sense? There’s no specification so who’s to say if certain code constitutes “abuse”? Maybe “pure Perl” is an oxymoron :P

            1. 2

              Fwiw I ascribe a specific meaning to “pure Perl” which is Perl code you can install and run with just the usual tools, no C extensions, dependencies on external libraries, etc

              Same as “pure python” is python code i can use on any cpu arch and OS as long as cpython or pypy is there.

      3. 4

        This is both an awesome tech demo and something that I have a real use-case for. I really wanted a good way of communicating JSON data into FreeBSD rc scripts and this adds only 8.5 KiB on top of things that are already in the base system.

        1. 3

          I love the dedication of the author to such a niche language. It reminds me of a quality check tool I encountered early in my career, which was basically a 2000 line awk/ksh amalgamation. Scary and awesome at the same time.