Re:Why Lisp Syntax Works
by kazinator on Monday June 05, 2023 @06:01PM
(#36204562)
But JSON is somewhat impoverished in that only has floating-point numbers, strings and a handful of symbols (true, false, null, ... ?).
The most obvious thing lacking from the point of view of interpreting in a Lisp-like way is an ergonomic syntax for symbols.
People have experimented with computation in JSON, pretty much like how you have it; but it's lame to work with. Nobody wants to write quotes around basic identifiers like "+". And it is inefficient, to boot.
Interning of symbols is a key advantage of Lisp, and it was there in 1958 already; so by using JSON this way, you're regressing before that.
Lisp converts symbols into small values, which are atoms. Two or more occurrences of the same symbol are the same atom. An atom is a small word-sized quantity. Often a pointer, but not necessarily so; it could be a numeric index into a table of objects. Anyway, it is very efficient to test whether two atoms are the same object.
The most obvious thing lacking from the point of view of interpreting in a Lisp-like way is an ergonomic syntax for symbols.
People have experimented with computation in JSON, pretty much like how you have it; but it's lame to work with. Nobody wants to write quotes around basic identifiers like "+". And it is inefficient, to boot.
Interning of symbols is a key advantage of Lisp, and it was there in 1958 already; so by using JSON this way, you're regressing before that.
Lisp converts symbols into small values, which are atoms. Two or more occurrences of the same symbol are the same atom. An atom is a small word-sized quantity. Often a pointer, but not necessarily so; it could be a numeric index into a table of objects. Anyway, it is very efficient to test whether two atoms are the same object.