News for hackers. Stuff that matters.
Re:The YAML Document from Hell by eru on Thursday January 12, 2023 @06:27AM (#34352009)
Use S-Expressions?
Re:The YAML Document from Hell by usrnm on Thursday January 12, 2023 @06:48AM (#34352156)
With each tool using its own macro-based DSL for managing them. That would be fun
Re:The YAML Document from Hell by mixedCase on Thursday January 12, 2023 @08:06AM (#34352889)
S-expressions do not necessarily imply Lisp nor an executable environment, it's a (family of) syntax(es) to build a document format. Like EDN.
Re:The YAML Document from Hell by ilyt on Thursday January 12, 2023 @08:25AM (#34353115)
So even worse as you can't use any prior knowledge of lisp
Re:The YAML Document from Hell by luisapic on Thursday January 12, 2023 @12:30PM (#34357309)
Wanting to wake up together with You, that You may have at least one who notices all of your pains and feels compassion for You, I cling more tightly to your Heart; and feeling your prickings more vividly, I wake up. But, what do I see? What do I hear?
Re:The YAML Document from Hell by jerf on Thursday January 12, 2023 @10:35AM (#34355057)
I know what s-expressions are, vaguely. Vaguely in terms of "I couldn't write a grammar for them off the top of my head.", that is, not "what are they".

Is there a single agreed-upon defined grammar that everyone can use? Preferably one simple enough that like JSON's it is at least capable of being used as a graphic on the home page for the format? https://www.json.org/json-en.html

This is an honest question, because there may well be and I don't know it.

However, I will put this marker down in advance: If multiple people jump up to say "oh, yes, of course, it's right here", and their answers are not 100% compatible with each other, then the answer is no.

The other marker I'll put down is "just use common lisp", I want verification that it really is 100% standardized, no question what any construct means, ever, and I still bet we get people who would rather see Scheme or Clojure, and I bet there's some sort of difference.

Neither of these objections is fatal to the idea. JSON is technically not just "javascript objects", so if someone carved out a defined format from s-expressions, then held it up as a standard, that would be as valid as what Crockford did. But at least as of right now, I'm not aware of anyone having done that standardization work. Replies welcome.

Re:The YAML Document from Hell by lapinot on Thursday January 12, 2023 @11:18AM (#34355821)

  SEXPR := YOUR-CUSTOM-LITERALS
         | "(" SEXPR* ")"
Re:The YAML Document from Hell by jerf on Thursday January 12, 2023 @11:25AM (#34355955)
Along with the many other issues that would have for just straight-up not being a usable grammar, the word "CUSTOM" appearing in a nominal cross language standard is a non-starter.
Re:The YAML Document from Hell by lapinot on Thursday January 12, 2023 @11:39AM (#34356277)
Oh come on. Did you think anybody would write an RFC in the comments? Add arbitrary list of whitespace tokens everywhere and pick whatever favorite grammar you have for literals. Json strings and numbers since you seem to like them.
Re:The YAML Document from Hell by jerf on Thursday January 12, 2023 @02:21PM (#34358957)
Of course not. But you are at least semi-seriously trying to propose something. I promise you it won't be that easy to get any sort of agreement.

This is a classic "oh come on how hard can it be" that, once you get into it, it turns out the answer is very. Arbitrarily so. Agreement is hard. Details are hard. A standard with no details is not terribly different from "just give us some text".

Re:The YAML Document from Hell by zvr on Sunday January 15, 2023 @06:52AM (#34388736)
Ah, no types, no NIL. Every user has to specify how their usage expresses strings, integers, booleans, etc.

Maybe start from one of the already existing standards https://en.wikipedia.org/wiki/S-expression#Standardization ?

Re:The YAML Document from Hell by mirekrusin on Thursday January 12, 2023 @01:17PM (#34358023)
Re:The YAML Document from Hell by jerf on Thursday January 12, 2023 @02:24PM (#34358998)
I don't see a grammar I could use for an external standard there. I could be missing it. And I assume there must be one implied, since it appears to be a read-write format. However such things have a nasty habit of turning out upon further inspection to not be as generic as supposed and have local idioms buried in them, often in surprising places. Even JSON, simple as it is, had that problem, and it is after all a subset in an attempt to squeeze out those localisms.

Is it compatible with Common Lisp, such that all such s-expressions will be compatible with it in some natural way?

Re:The YAML Document from Hell by mirekrusin on Friday January 13, 2023 @01:09AM (#34364487)
Re:The YAML Document from Hell by eru on Thursday January 12, 2023 @09:49PM (#34363389)
Well, I would have suggested Racket. Common Lisp is a bit ugly, both conceptually and syntax-wise.
Re:The YAML Document from Hell by tgbugs on Thursday January 12, 2023 @01:40PM (#34358374)
My distaste for yaml led me to attempt just that. The first piece that was missing for me was a python parser that could produce reasonable error messages and could be transformed into the desired internal representation in python. So I wrote one [0]. It was supposed to be a single file that was less than 100 lines and could be copied and pasted into any project that I needed. Turns out that the issue was a bit more complex.

The issue is that there is sufficient complexity in finding a portable representation for configuration formats that it just kicks the can down the road. On the other hand it means that as soon as you decide what format you are going to support you can quickly implement it. There is more or less a intersectional grammar that works across most if not all lisps, and that is the plist `(:k v :k2 (:k3 v2))`. So I settled on that for my own use.

After all that work I have not dealt with the fact that numbers and chars do not have a portable representation across lisp dialects, which is a key complaint in other threads here. Limited support for let binding constants also seems like a feature that would allow for just enough expressivity to make the format useful without opening up the terror that is `&` and `*` in yaml (cool and useful as it may be).

In summary s-expressions are: 1. missing good parsers in a number of language ecosystems 2. not standard across lisp dialects 3. need additional semantics for binding, multiple expressions, etc. 4. still better than yaml and json

0. https://github.com/tgbugs/sxpyr