5 ms·
The JSON crowd is re-inventing LISP. Originally, JSON was a subset of what you could pass to "eval()". Yesterday, state machine programming in JSON. Today, an i
by Animats 10y ago
The JSON crowd is re-inventing LISP. Originally, JSON was a subset of what you could pass to "eval()". Yesterday, state machine programming in JSON. Today, an inspector.
- fiatjaf 10y agoDo you think that is bad? Many people like LISP.
- cle 10y agoI think Lisp folks complain because so much effort has been spent to converge on the same stuff we already had. When it comes to data serialization, over many decades we've invented many formats, and they usually go off on tangents and then converge on essentially the same stuff. Lispers respond: "We told you so."
- vikiomega9 10y agoCan you point me to an example of a serialization that was reinvented?
- adzm 10y agoJSON vs S-expressions
- vikiomega9 10y agoAh I always figured S-expressions were "representations" as opposed to "serializations", but that makes sense. Any others?
- woodruffw 10y agoA new formulation of Greenspun's tenth rule, perhaps. [0] [0]: https://en.wikipedia.org/wiki/Greenspun's_tenth_rule https://en.wikipedia.org/wiki/Greenspun's_tenth_rule
- mypalmike 10y agoIf LISP had a widely-accepted standard, non-turing-complete subset to represent the equivalent persisted data structures JSON does, it would still be less readable than JSON. There are reasons JSON is the lingua franca of modern API interaction and LISP is not.
- Spivak 10y agoWhatever example I give you're just going to complain that it's not widely accepted because it's not JSON/YAML/XML. Since just about every scripting language uses similar syntax to JSON there's an argument to be made that familiarity is the most important characteristic. However, that doesn't mean that LISP is unfit for the job from a technical perspective. If we're going to start evaluating JSON as code then there's a strong argument to be made that a LISP is better suited since that's one of its core principles and is already well developed. '( (first-name john) (last-name smith) (age 23) (parents jane jim) ) { "first name": "john", "last name": "smith", "age": 23, "parents": ["jim", "jane"] }
- falcolas 10y agoMight change that a bit to more accurately represent the same type of objects described in your JSON. '( (first-name "john") (last-name "smith") (age 23) (parents ("jane" "jim")) ) Of course, for a pure set of such simply formatted data (hashes, lists, strings, numbers), you could use almost any data serialization format. S-Exs don't really offer anything special here that can't also be done in XML, MessagePack, SQL, protobuff, bencode, thrift, or any of a dozen other serialization formats. Then again, JSON doesn't really bring much special to the table in this case either (other than having an encoder built into most Javascript intrepreters).
- mypalmike 10y agoHow do I know that ("jane" "jim") is a list (like ["jane", "jim"] in JSON) rather than an associative array (like {"jane": "jim"} in JSON)? S-exs can represent the difference certainly, but not in a way that is as clearly readable by humans. The difference between lists and associative arrays is quite unambiguous and readable in JSON. This helps make the language editable by non-expert users, which is a critical benefit.
- andrewstuart2 10y agoThis is a fairly common occurrence for any declarative data serialization format. Just look at all the crappy imperative XML programs you can write in ant. And plenty of other imperative XML "languages."
- falcolas 10y agoAny data serialization format which could be represented by S-Expressions could be said to be emulating Lisp. Doesn't mean they are. But yes, I agree with the core of your comment, though I usually harken to XML for a more visceral reaction. First there was a self-formatted schema and tooling to verify it. Then an RPC specification. Followed by parsers built to fit special needs (such as comments). Inspectors, transformers, pretty printers, incremental parsers, bash integrations, namespaces... Programming history is definitely cyclical.
- skybrian 10y agoI expect that will eventually happen whenever you have a popular enough data format and stick with it long enough. All the same tools get reinvented. Start over with a new format and the tools all have to be rebuilt from scratch. But this isn't to say that new languages should never be invented. Just that there's a lot more work involved than anyone would expect.
- ehnto 10y agoThat's an interesting way of viewing it, I guess it applies to JavaScript as well. There is a lot of discussion regarding how the Javascript community is re-inventing the wheel, but I guess once enough impetus arives to a language then re-tooling is inevitable.
- ubernostrum 10y agoExcept JSON has a huge advantage Lisp doesn't: it's close to, or in some cases identical to, the data-structure syntax of several popular programming languages. Lisp's particular s-expression syntax is not close to or identical to any programming language other than Lisp. In other words: once you decide you don't want to program in Lisp, Lisp's way of representing data stops being a useful syntax for representing your data. Undervaluing this realization (and worse, reacting smugly when interacting with people who don't share your undervaluing of this) is a big part of the gulf between Lispers and the rest of the world.
- junke 10y ago> In other words: once you decide you don't want to program in Lisp, Lisp's way of representing data stops being a useful syntax for representing your data. Even if you code in C++, you can find Lisp's surface syntax simple enough to read and write. Now, if your language already defines a "read" function, sure, go with it.
- ubernostrum 10y agoAs I said: if I wanted to write Lisp I'd write Lisp. I've already chosen not to write Lisp. I have no incentive to make my language parse Lisp when something much closer to my preferred language's data structure syntax is available. The mere fact that a solution exists for a problem does not mean it is the best possible solution for all possible people in all possible cases, nor that there can never be a reason to develop or prefer another solution.
- junke 10y agoI didn't say it is the best solution in all possible cases. Just that even if you choose not to write Lisp, using a data format that follows Lisp's approach is not a stupid thing to do. > Undervaluing this realization (and worse, reacting smugly when interacting with people who don't share your undervaluing of this) is a big part of the gulf between Lispers and the rest of the world. You are the one setting the tone with your exclusionary rhetoric.