News for hackers. Stuff that matters.
Re:Why Lisp Syntax Works by shrimpx on Monday June 05, 2023 @04:04PM (#36202735)
Correct me if I'm wrong but it seems you roughly get "lisp-ness" by taking any textual data format and defining a programming language syntax in terms of that data format. I could make a JSON-based language that looks like:

    [
      // define some_fun(x) => let y=2;let z=y*3;return x+z
      {"some_fun": [["x"], [
        {"y": 2,
         "z": ["*", "y", 3]},
        ["+", "x", "z"]
      ]},
      // call it
      ["some_fun", 100]
    ]
Here I'm using JSON dictionaries to bind variables, and lists for everything else (instruction sequences, argument lists, etc.). Now I can quote stuff to define JSON data, or otherwise define programs.

I'm not a lisper but it seems what's special about lisp is it defines its programs in a generic data format.

Re:Why Lisp Syntax Works by Jtsummers on Monday June 05, 2023 @04:12PM (#36202878)
> I'm not a lisper but it seems what's special about lisp is it defines its programs in a generic data format.

One of the things that still makes Lisp special. It makes metaprogramming "easy" in contrast to metaprogramming in almost every other language out there.

The other big thing is its high degree of interactivity and dynamic capabilities.

Re:Why Lisp Syntax Works by zdragnar on Monday June 05, 2023 @04:10PM (#36202843)
You're essentially describing homoiconicity: https://en.wikipedia.org/wiki/Homoiconicity
Re:Why Lisp Syntax Works by shrimpx on Monday June 05, 2023 @04:38PM (#36203256)
Thanks!
Re:Why Lisp Syntax Works by matthewn on Monday June 05, 2023 @05:48PM (#36204346)
Similar argument from this lengthy but enjoyable essay: https://stopa.io/post/265
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.