Live data from Hacker News

The KDL Document Language

kdl.dev

11–20 of 64 posts

Re: The KDL Document Language

#11
Hmm... Not really sure I get what problem this schema is the best solution for. It seems like the author was more interested in implementing a model they felt was more conceptually sound than other solutions, but aren't solving any significant problems, and don't seem to have any big functional improvements over more established contenders.

Just going through the section for why they think it beats YAML:

> YAML can be ambiguous about what types the data written into it is.

If you're worried about data types, that sounds like a job for a proper data storage format rather than putting it into a configuration file, no?

> There's also a persistent issue where very large YAML files become unmanageable, especially due to the significant indentation feature.

That sounds like a poorly designed configuration setup. If you've got a nested config that complex, by my reckoning, it should be reorganized into flatter data structures or broken down into more specific configuration files regardless of what the format is.

>YAML is a great, widespread language. Unlike KDL, which is node-based (like XML or HTML), it's based on map and array data structures, which can provide an easier serialization experience in some cases.

Saying that processing node-based formats is more difficult in 'some cases' is a particularly charitable take, especially when they're touting their ability to handle very large, complex configurations.

> KDL is designed to avoid these particular pitfalls by always being explicit about types, and having clearly-delimited scope (and the ability to auto-indent/auto-format). Syntax errors are easier to catch, and large files are (hopefully!) much more manageable.

It seems like it adds significant complexity over YAML to mitigate abuse of YAML... but wouldn't it just be better to do a better job using YAML?

I do tend to be biased towards conforming to the usage practices of existing tools rather than adopting new tools for edge cases or minor conflicts because learning new tools tends to have a slightly higher cognitive toll for me than some others— but as a general rule, I don't see a problem with only switching tools because you have a problem that's significantly more difficult or less efficient to solve with the old tool.

Maybe there's some really clear use cases that aren't obvious to me for whatever reason.

Re: The KDL Document Language

#13
post #4

Obligatory xkcd: https://xkcd.com/927/ Also yes, I'm aware the author states: >Have you seen that one XKCD comic about standards? >Yes. I have. Please stop linking me to it. To which I say: You shouldn't have created a new standard if you didn't want to be linked to the xkcd. Any annoyance is self inflicted, and you've weaponized the internet against yourself.

This isn't a unifying standard, which is what the XKCD comic is about. It's not attempting to take other standards and develop the One To Rule Them All—you know, like the first panel of the comic describes—but rather building a different tool that's a better fit for some specific use-cases. Honestly, if the internet had been around when the screwdriver was invented, the Hacker News commenters of the time would have b…

"A wheel? Don't be silly, how are you going to add wheels to a horse?" (Prehistoric HN commenter)

Re: The KDL Document Language

#14

Hmm... Not really sure I get what problem this schema is the best solution for. It seems like the author was more interested in implementing a model they felt was more conceptually sound than other solutions, but aren't solving any significant problems, and don't seem to have any big functional improvements over more established contenders. Just going through the section for why they think it beats YAML: > YAML can b…

I felt similarly when I first saw it, but I saw that there was no java impl, and I'd been looking for a project, so I wrote one. I've been playing with it for more than 6 months and I think it's better than YAML in a number of ways. The syntax is very clear and mostly simple and the noted ability to autoformat is no small thing. I think it aims for a niche, and hits its target pretty well.

Re: The KDL Document Language

#15
post #4

Obligatory xkcd: https://xkcd.com/927/ Also yes, I'm aware the author states: >Have you seen that one XKCD comic about standards? >Yes. I have. Please stop linking me to it. To which I say: You shouldn't have created a new standard if you didn't want to be linked to the xkcd. Any annoyance is self inflicted, and you've weaponized the internet against yourself.

This isn't a unifying standard, which is what the XKCD comic is about. It's not attempting to take other standards and develop the One To Rule Them All—you know, like the first panel of the comic describes—but rather building a different tool that's a better fit for some specific use-cases. Honestly, if the internet had been around when the screwdriver was invented, the Hacker News commenters of the time would have b…

Hammers, wrenches!

Rolls eyes.

Screwdrivers scale!

Screwdrivers are scalable, idempotent and functional.

Can't believe you are serving 100 villagers with hammers. Hammers make everything look like a nail. And it's impossible to make comments with wrenches.

Re: The KDL Document Language

#16
post #3

Nice doc, but I feel like it's confusing documents like XML/HTML and tree-structured data like JSON. It seems like it would be annoying to write this directly, like how do you make a word bold or italic? How do you make a class of hyperlink that's a different color (e.g. internal links vs. external)? HTML is OK but not fun to write directly -- I'm not sure that KDL is an improvement. You would still want something li…

This isn't meant to replace HTML. I see it as a better language for configs. JSON lacks comments. YAML also has problems: https://noyaml.com/

Re: The KDL Document Language

#18

Hmm... Not really sure I get what problem this schema is the best solution for. It seems like the author was more interested in implementing a model they felt was more conceptually sound than other solutions, but aren't solving any significant problems, and don't seem to have any big functional improvements over more established contenders. Just going through the section for why they think it beats YAML: > YAML can b…

I felt similarly when I first saw it, but I saw that there was no java impl, and I'd been looking for a project, so I wrote one. I've been playing with it for more than 6 months and I think it's better than YAML in a number of ways. The syntax is very clear and mostly simple and the noted ability to autoformat is no small thing. I think it aims for a niche, and hits its target pretty well.

Fair enough— not my niche, I guess.

After dealing with a bunch of really hairy, complex, node-based data processing for a few years, I'd sooner roll around in a dusty sandbox with my eyes taped open than purposefully invite that into my life again... but if I suppose if you're doing something that dumb in your config files then the config format isn't the problem, anyway. Cheers.

Re: The KDL Document Language

#19
I have no idea what people are complaining about in this thread. I find projects like this genius. I love making programming languages and I hate hate hate writing parsers, yet I enjoy experimenting with different syntax. Stuff like this is very convenient because you can just import your code as document, use path language to extract data, and schema language to apply basic checks. Not only is this thing standardized[1], it's implemented in your favorite language (Rust, Python, Java whatever).

[1] EDIT: to be clear here, I meant to say it has a specification. I'm guessing your handbaked language won't have.

Re: The KDL Document Language

#20
post #3

Nice doc, but I feel like it's confusing documents like XML/HTML and tree-structured data like JSON. It seems like it would be annoying to write this directly, like how do you make a word bold or italic? How do you make a class of hyperlink that's a different color (e.g. internal links vs. external)? HTML is OK but not fun to write directly -- I'm not sure that KDL is an improvement. You would still want something li…

This isn't meant to replace HTML. I see it as a better language for configs. JSON lacks comments. YAML also has problems: https://noyaml.com/

The very first example is a document with metadata like title, author, etc. It's called a "document language".

It seems to be straddling documents and configuration, which in my experience makes for a lot of awkwardness.

This part seems to be a symptom of that:

There are two specifications for writing KDL that can be losslessly translated between it and JSON or XML. These specifications define a stricter subset of KDL that, even if NOT entirely idiomatic, is still valid and fits into the data models of the other two languages: (emphasis mine)

Post reply on HN