sKDL, a "Cuddly Description Language", is a [[CC BY-SA 4.0]] licensed data and configuration language specification with implementations in various languages.
- [Website](https://kdl.dev/)
- [Specification](https://github.com/kdl-org/kdl)
> KDL is a node-oriented document language. Its niche and purpose overlaps with XML, and as do many of its semantics. You can use KDL both as a configuration language, and a data exchange or storage format, if you so choose.
# Notability
It manages to take XML semantics and map them onto a syntax that is damn near reasonable.
May be usable as a format to compile down to XML or otherwise as an example of a language which can do so.
# Philosophy
# Platform Support
- Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs), [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro), and [kaydle](https://github.com/Lucretiel/kaydle) (serde-based)
- JavaScript: [kdljs](https://github.com/kdl-org/kdljs), [@virtualstate/kdl](https://github.com/virtualstate/kdl) (query only, JSX based)
- Ruby: [kdl-rb](https://github.com/danini-the-panini/kdl-rb)
- Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart)
- Java: [kdl4j](https://github.com/hkolbeck/kdl4j)
- PHP: [kdl-php](https://github.com/kdl-org/kdl-php)
- Python: [kdl-py](https://github.com/tabatkins/kdlpy), [cuddle](https://github.com/djmattyg007/python-cuddle), [ckdl](https://github.com/tjol/ckdl)
- Elixir: [kuddle](https://github.com/IceDragon200/kuddle)
- XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL)
- Haskell: [Hustle](https://github.com/fuzzypixelz/Hustle)
- .NET: [Kadlet](https://github.com/oledfish/Kadlet)
- C: [ckdl](https://github.com/tjol/ckdl)
- C++: [kdlpp](https://github.com/tjol/ckdl) (part of ckdl, requires C++20)
- OCaml: [ocaml-kdl](https://github.com/Bannerets/ocaml-kdl)
- Nim: [kdl-nim](https://github.com/Patitotective/kdl-nim)
- Common Lisp: [kdlcl](https://github.com/chee/kdlcl)
- Go: [gokdl](https://github.com/lunjon/gokdl), [kdl-go](https://github.com/sblinch/kdl-go)
# Features
# Syntax
The syntax of KDL is very close to [[Go]].
```go
package {
name "my-pkg"
version "1.2.3"
dependencies {
// Nodes can have standalone values as well as
// key/value pairs.
lodash "^3.2.1" optional=true alias="underscore"
}
scripts {
// "Raw" and multi-line strings are supported.
build r#"
echo "foo"
node -c "console.log('hello, world!');"
echo "foo" > some-file.txt
"#
}
// `\` breaks up a single node across multiple lines.
the-matrix 1 2 3 \
4 5 6 \
7 8 9
// "Slashdash" comments operate at the node level,
// with just `/-`.
/-this-is-commented {
this "entire" "node" {
"is" "gone"
}
}
}
```
# Tips
# References