News for hackers. Stuff that matters.
Re:SDLang – Simple Declarative Language by sinistersnare on Sunday May 01, 2022 @01:56PM (#31227114)
Having `true/false/on/off/null`, 4 different comment styles and 5 numerical types screams anything except for 'Simple' to me.

It may be a fine language, but it seems like it needs a new name. Maybe 'YAYAML' to highlighting its complexity.

Re:SDLang – Simple Declarative Language by duped on Sunday May 01, 2022 @07:38PM (#31229796)
Null is very different than true and false, equivalence is really frustrating to deal with.
Re:SDLang – Simple Declarative Language by avgcorrection on Sunday May 01, 2022 @03:04PM (#31227703)
I guess they mean simple syntax.
Re:SDLang – Simple Declarative Language by disconcision on Sunday May 01, 2022 @09:26PM (#31230446)
k.d. lang, for komplex declarative language
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 bitbckt on Sunday May 01, 2022 @04:32PM (#31228395)
I’m no fan of JSON as a configuration language, but I tried using SDLang with dub and quickly returned to JSON.

Dub would feel slightly (slightly!) more polished if it used a more common package format. TOML would be a good choice.

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 syrrim on Sunday May 01, 2022 @03:57PM (#31228106)
Is just the tooling the problem, or have you run into other issues?
Re:SDLang – Simple Declarative Language by quag on Sunday May 01, 2022 @01:29PM (#31226840)
KDL is a variant of SDLang that’s worth checking out.

https://github.com/kdl-org/kdl

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.

[1] https://en.wikipedia.org/wiki/Time_formatting_and_storage_bu...

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 spicybright on Sunday May 01, 2022 @08:04PM (#31229942)
It doesn't seem worth it to figure out time/date representation at the data layer like this.

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.

Re:SDLang – Simple Declarative Language by dmitriid on Sunday May 01, 2022 @04:30PM (#31228376)
Why people insist on not using ISO 8601 (or a subset of it) is beyond me.
Re:SDLang – Simple Declarative Language by christophilus on Sunday May 01, 2022 @12:43PM (#31226446)
Not bad. I prefer edn, but this is certainly an improvement over, say, JSON.
Re:SDLang – Simple Declarative Language by conaclos on Sunday May 01, 2022 @04:18PM (#31228277)
Some link to share about EDN?
Re:SDLang – Simple Declarative Language by hobo_mark on Sunday May 01, 2022 @05:31PM (#31228878)
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 joshmarinacci on Sunday May 01, 2022 @02:54PM (#31227624)
What’s the story on error handling? This has been the downfall of a lot of structured text formats.
Re:SDLang – Simple Declarative Language by kaetemi on Sunday May 01, 2022 @03:23PM (#31227859)
This looks clean and very readable. How's the experience on the programming side, though?
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 bzxcvbn on Sunday May 01, 2022 @03:18PM (#31227826)
Since when are json or XML not human readable or writable?
Re:SDLang – Simple Declarative Language by ebingdom on Sunday May 01, 2022 @04:20PM (#31228300)
Did you reply to the wrong comment?
Re:SDLang – Simple Declarative Language by bzxcvbn on Sunday May 01, 2022 @04:36PM (#31228425)
Yes, sorry.
Re:SDLang – Simple Declarative Language by akvadrako on Sunday May 01, 2022 @01:34PM (#31226885)
Unlike JSON and XML its designed to be human readable and writable. It's more like a better YAML.
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 dkersten on Sunday May 01, 2022 @02:46PM (#31227565)
So its a competitor to TOML? (or TOML to it, I dunno when this was created)
Re:SDLang – Simple Declarative Language by bzxcvbn on Sunday May 01, 2022 @04:37PM (#31228428)
Since when are json or XML not human readable or writable?
Re:SDLang – Simple Declarative Language by nileshtrivedi on Sunday May 01, 2022 @03:08PM (#31227745)
JSON5 might be a good candidate for these attributes.
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!
Re:SDLang – Simple Declarative Language by conaclos on Sunday May 01, 2022 @04:19PM (#31228285)
For interested readers, EKON [1] proposes yet-another interesting superset for JSON.

[1] https://github.com/ekon-org/ekon