nickel icon indicating copy to clipboard operation
nickel copied to clipboard

KDL support

Open toastal opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe. KDL is a configurations language with compatibility with JSON & XML with a subjectively more terse syntax while supporting nesting unlike TOML. While KDL has type annotations, it doesn’t have advanced types like Nickel such as ADTs. I would like to use Nickel to assert types, or import/export KDL documents.

Describe the solution you'd like nickel export --format kdl, import "document.kdl"

Describe alternatives you've considered Using some KDL→JSON→Nickel pipeline.

Additional context There are Rust libraries for parsing KDL already. Other projects like Zellij have been picking it up as a configuration language (I am considering this too).

toastal avatar Apr 06 '25 19:04 toastal

Hi, thanks for the proposal. We don't have a well-defined policy about adding export format support right now, but I don't think it'd be an issue to add KDL - at least we would gladly accept contributions on this front. Do you expect the export to preserves some of the types though? That might a bit more involved.

yannham avatar May 05 '25 16:05 yannham

Do you expect the export to preserves some of the types though? That might a bit more involved.

The annotations seem to be to help tools with parsing, but don’t need to exist.

For project-adjacent implementations:

  • Rust: https://github.com/kdl-org/kdl-rs
  • OCaml: https://github.com/eilvelia/ocaml-kdl/

toastal avatar Sep 07 '25 17:09 toastal