Skip to content

Is JSON expression just LISP in JSON format? #674

Answered by streamich
danielo515 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, it has the LISP-like syntax! I was actually also thinking to create LISP-like bracket grammar for is. So instead of JSON:

[".", "a", "b"] // 'ab'

One could also write/read LISP-like debugging format:

(. "a" "b")

What I had in mind is to make it portable, compact, and fast.

  • Portable — all modern programming languages support JSON.
  • Compact — it consumes little space, can be embedded into JWT tokens, for example, for any authorization logic.
  • Fast — json-joy complies JSON Expression to native JavaScript. For example, ['+', 1, 2] complies directly to () => 3. If there is an external input in the expression, say ['+', 1, ['$', '/data']], it still complies to something fast like () => 1 …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@streamich
Comment options

@danielo515
Comment options

Answer selected by streamich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants