Re:SDLang – Simple Declarative Language
by hatf0 on Sunday May 01, 2022 @03:37PM
(#31227977)
As a user of SDLang.. not a huge fan of it, IMO. Dub (the D package manager) uses SDLang as one of the two formats that you can use to configure projects (those two being SDLang and JSON), and I often find myself converting every project to using the JSON format as there is virtually no tooling (in most languages) for parsing SDLang. I've recently started using TOML instead, and I have nothing but good things to say about it.
Re:SDLang – Simple Declarative Language
by spicybright on Sunday May 01, 2022 @07:10PM
(#31229636)
I honestly don't know why people don't adopt a slightly better json at this point if we're going to invent weird new formats anyways. Some kind of macro language with better syntax would be ahead by miles, and able to plug into anywhere that uses JSON very easily.
Re:SDLang – Simple Declarative Language
by layer8 on Sunday May 01, 2022 @03:17PM
(#31227817)
It seems like the date/time format is ambiguous, since a date followed by a time could be interpreted either as a single date-time value or a date value followed by a time value.
Re:SDLang – Simple Declarative Language
by joe_the_user on Sunday May 01, 2022 @03:35PM
(#31227964)
Date/time specification is incredibly hard. However hard you think it is, it's actually a "little" harder.[1]
I'd guess that someone formulating their own date/time format is actually evidence that they don't understand what a problem it is and so their format is wrong.
Re:SDLang – Simple Declarative Language
by layer8 on Sunday May 01, 2022 @03:52PM
(#31228084)
In the present case the problem is solely related to using whitespace both as a value separator and also within a value, where both “halves” of the value are also valid values in their own right. It would have been similar if they defined a complex-number type whose syntax consists of the real and imaginary part just being separated by whitespace. The issue has nothing to do with the conceptual particularities of date and time.
Re:SDLang – Simple Declarative Language
by joe_the_user on Sunday May 01, 2022 @04:48PM
(#31228538)
Sure, I'd just offer the fundamental difficulty is date/time is a sum of "trivial" problems like this. That a date by itself and a time by itself can be "moments in time" is just one of many difficulties around date-time. IE, none of the particularities (other examples being the irregularities of legal month/day combinations) seem "conceptual".
Re:SDLang – Simple Declarative Language
by layer8 on Sunday May 01, 2022 @04:57PM
(#31228603)
The relevant conceptual difficulties are the distinction between calendar dates plus time-of-day on the one hand vs. physical time (number of actual seconds) on the other hand, and the way they relate to each other via time zones, DST and leap seconds. To a lesser degree, also the fact that months have different lengths, and cultural differences like start of the week, week numbers etc., and finally date formatting. Most of these are really conceptually tied to time keeping. How to create an unambiguous syntax really isn’t.
Re:SDLang – Simple Declarative Language
by hamstergene on Sunday May 01, 2022 @07:38PM
(#31229790)
I like this kind of syntax because it is a lot like how my ad-hoc print/log statements have been printing structured data all along.
For a generic data language, SDLang has some oddly specific features: distinction between 32-bit and 64-bit integers, single and double floats, arbitrary strings and base64, 3 single-line comment styles, multiple ways to say booleans.
Smells like leaky abstraction, as if the author has ingrained some requirements of the project they've been working on into SDLang rather implementing them in project-specific code.
Another commenter has linked KDL language which seems to have cleaner design, and can even satisfy more typing use cases than SDLang.
Re:SDLang – Simple Declarative Language
by ebingdom on Sunday May 01, 2022 @12:58PM
(#31226564)
Looks interesting, but does it offer any unique features that set it apart from other such languages like JSON, XML, etc.? I see that matrix example, but is it any different from an array? (I couldn't tell from reading the docs.)
Re:SDLang – Simple Declarative Language
by kjeetgill on Sunday May 01, 2022 @03:59PM
(#31228124)
I hear this not-for-human comment so often, I really have to second mrtweetyhack's now dead comment and this one. When did this meme start making the rounds?
JSON especially is incredibly human read/writeable and its relative lack of ambiguity is nearly unparalleled., and it's syntax is minicule. YAML is particularly bad in this regard. XML is usually pretty humanly readable, editable too, and has many fewer of the issues around ambiguity, but I sympathize with the sentiment since it can get's out of hand much more readily.
Re:SDLang – Simple Declarative Language
by fuzzythinker on Monday May 02, 2022 @03:14AM
(#31232210)
Wow, unbelievable timing. Was just looking for such spec language. Looking at related ones like libucl, dhall, metadesk, edn, toml. This and KDL as pointed out by @quag seem to fit my needs much better. Thank you both!
It may be a fine language, but it seems like it needs a new name. Maybe 'YAYAML' to highlighting its complexity.
Dub would feel slightly (slightly!) more polished if it used a more common package format. TOML would be a good choice.
https://github.com/kdl-org/kdl
I'd guess that someone formulating their own date/time format is actually evidence that they don't understand what a problem it is and so their format is wrong.
[1] https://en.wikipedia.org/wiki/Time_formatting_and_storage_bu...
Rigid definition of time stamps leads to incompatible parsers and risks if you need to update how the timestamp works.
Or, store it as a string and deal with it after parsing.
The latter one always wins, hence json's popularity.
Baking it into the data format isn't going to make people treat timestamps right. Probably will do the opposite, really.
For a generic data language, SDLang has some oddly specific features: distinction between 32-bit and 64-bit integers, single and double floats, arbitrary strings and base64, 3 single-line comment styles, multiple ways to say booleans.
Smells like leaky abstraction, as if the author has ingrained some requirements of the project they've been working on into SDLang rather implementing them in project-specific code.
Another commenter has linked KDL language which seems to have cleaner design, and can even satisfy more typing use cases than SDLang.
JSON especially is incredibly human read/writeable and its relative lack of ambiguity is nearly unparalleled., and it's syntax is minicule. YAML is particularly bad in this regard. XML is usually pretty humanly readable, editable too, and has many fewer of the issues around ambiguity, but I sympathize with the sentiment since it can get's out of hand much more readily.
[1] https://github.com/ekon-org/ekon