Consider this: it’s much easier to parse S-Expressions than JSON! Plus, in statically typed languages, this script could excel, because it declares the type first. Remember that you can always use my S-Expression parser in C to parse them:

https://gist.github.com/Chubek/d2f0ac9067521716d2ab31c93948e885

PS: Is it just me, or ‘JSON to Sexp’ sounds like ‘Jason 2: Sex Pest’?

  • abbadon420@lemm.ee
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    10 months ago

    Is an s expression easier to parse? Maybe if you have to do it from scratch and you only have minimal memory capacity, like how it used to be when lisp was first designed.

    Those aren’t real issues now, we can easily transfer data in objects and use a convenient json parsen to parse it without worrying too much about memory usage.

    • Shareni@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      Sexp parser: looks for open and closed parens

      Json parser: looks for delimiters, separators, keys, and values

      Maybe it’s slightly more efficient and so can make sense at scale?