#kdl

Kat Marchán 🐈zkat@toot.cat
2025-05-30

so this is happening.

All my #Rust #RustLang repos are moved over. Now I just need to figure out CI, republish to crates.io, and archive the github side (and document a tombstone in their readmes).

I have a bunch of other repos I'll either archive or delete as well.

#KDL and #orogene will remain github-side for now because they're a bit more dependent on github services, but I would like to at least move orogene over eventually. KDL might be stuck, though, unfortunately, but I might move only kdl-rs.

#bevy #miette

screenshot of zkat's profile page on codeberg.org showing a number of Rust projects, including miette.
Blake Leonardblake@infosec.town
2025-05-14

semi-cursed idea: a #KDL representation of _every #XMPP stanza_, mostly for denser raw storage.

Most clients decide very-lossy data storage is good enough, but that doesn't satisfy me. The current storage mechanism for Spades is based on the XML stanzas (in MAM form) and the size of the XML in bytes represented as an ASCII number, wrapped in ASCII record/field separator characters. (Actually, the XML might be gzipped, I can't remember.) To condense it further, I could try to write a dense KDL representation and convert at store and read time. I could also try Brotli instead of gzip or xz.

I'm also thinking I'll want to split the history into multiple files (possibly by file size), and figure out how I'm going to page through that. Also it's all stored unencrypted at rest right now. (I think when I tried to do E2EE last, I had to have it save the unencrypted version because I had no direct access to the original encryption module to re-decrypt it; it's more or less embedded in the SDK and decrypted before I get it.)

2025-05-10

@pid_eins
In many components of #systemd inluding mainly #systemd-userdb , JSON is used for configuration and serialization.
Although this is fine, #kdl could be a better format for that purpose...
kdl.dev
What are your opinions?

Aram (imsnif)imsnif@hachyderm.io
2025-05-09

#kdl file formatter! Check it out:

github.com/hougesen/kdlfmt

Blake Leonardblake@infosec.town
2025-05-01

secretly genius #xmpp idea: #KDL representation of Data Forms.

So this beast:


      Bot Configuration
      Fill out this form to configure your new bot!
      
        jabber:bot
      
      Section 1: Bot Info
      
      
      
        
      
      
      Section 2: Features
      
        contests
        news
        polls
        reminders
        search
        news
        search
      
      Section 3: Subscriber List
      
        20
        10
        20
        30
        50
        100
        none
      
      Section 4: Invitations
      
        Tell all your friends about your new bot!
      
    

becomes something more like:
(form)meta {
  title "Bot Configuration"
  instructions "Fill out this form to configure your new bot."
}
(hidden)FORM_TYPE jabber:bot

(fixed)"" "Section 1: Bot Info"
(text-single)botname label="The name of your bot"
(text-multi)description label="Helpful description of your bot"
(boolean)public label="Public bot?" required=#true
(text-private)password label="Password for special access"

(fixed)"" "Section 2: Features"
(list-multi)features label="What features will the bot support?" {
  (option)contests label="Contests"
  (option)news label="News"
  (option)polls label="Polls"
  (option)reminders label="Reminders"
  (option)search label="Search"
  news
  search
}

(fixed)"" "Section 3: Subscriber List"
(list-single)maxsubs label="Maximum number of subscribers" {
  20
  (option)10
  (option)20
  (option)30
  (option)50
  (option)100
  (option)none label=None
}

(fixed)"" "Section 4: Invitations"
(jid-multi)invitelist label="People to invite" desc="Tell all your friends about your new bot!"

Less bytes, somewhat more readable. Probably just for docs and dev-tools, but, still cool, right?

Kat Marchán 🐈zkat@toot.cat
2025-04-18

Still looking for some help from an extra set of eyeballs or such for some #KDL consistency checking

From: @zkat
toot.cat/@zkat/114359709628259

Kat Marchán 🐈zkat@toot.cat
2025-04-18

A request for folks interested in language grammar stuff who might look at the newest #KDL feature and try to poke holes in it: github.com/kdl-org/kdl/issues/

Kat Marchán 🐈zkat@toot.cat
2025-04-18

Finally managed to go back to my #KDL suffix type annotations PR, and I'm pretty happy with where I've landed so far with the usage criteria, which had gotten a bit hairy. These rules are MUCH more straightforward, and focus on preventing accidentally parsing something successfully as unexpected data, as opposed to yielding a parse error and telling you to use a different syntax.

What do y'all think? Does this make sense?

PR: github.com/kdl-org/kdl/pull/513

3.8.3.1. Bare Suffix Type Annotation

When a Value (Section 3.7) is a Number (Section 3.14) that meets certain criteria, it's possible to append an Identifier String (Section 3.10), and ONLY an Identifier String, as a suffix directly to the Number, as its Type Annotation (Section 3.8). The criteria are as follows:

The Number MUST be a Decimal (that is, it MUST NOT start with 0b, 0o, or 0x). Additionally, the tokens 0b, 0o, and 0x MUST be treated as syntax errors (incomplete non-decimal numbers).

It MUST NOT have an exponent part (e.g. 5.2e+3).

The Identifier String used for the type itself MUST NOT start with either . or ,.

As part of the exponential restriction, the suffix MUST NOT match [eE]([-+]|[0-9]) (e.g. 5.2e+ SHOULD be considered a "bad exponential", and MUST NOT parse as (e+)5.2).
For example, the following are all illegal:

10,000 (suffix would start with ,)

10e0n (suffix on an exponential)

0xyz (starts with reserved hexadecimal prefix)

0b (starts with reserved binary prefix)

5e+oops (looks too close to an exponential)
Kat Marchán 🐈zkat@toot.cat
2025-04-03

The PR to add bare suffixes to #KDL numbers is ready, if anyone wants to eyeball it and give their 2c: github.com/kdl-org/kdl/pull/513

This means that you’ll be able to write things like 20px, 10.5%, and 512GiB as numbers in KDL and have those suffixes interpreted as type annotations.

Kat Marchán 🐈zkat@toot.cat
2025-03-30

FINALLY got around to speccing out the new suffix type annotation feature for #KDL: github.com/kdl-org/kdl/pull/513 Commentary welcome! It's very exciting!

I believe right now that the complexity cost, especially taking into account that there's a serviceable escape hatch, and fairly good ambiguity/typo protection, is well worth the value of people being able to write DSLs that use this feature.

I am, by the way, mostly writing out the grammar/spec itself after a much longer discussion by a bunch of people who poked all sorts of holes in a silly idea I threw over the fence: github.com/kdl-org/kdl/issues/

I am immensely thankful to the KDL spec and implementer community for everything they do! We're really all making an amazing language here.

bare-suffix 123px 10.5%
explicit 30#u8 0o777#my-user
Hemera :nixos: :ms_snow_leopard:Hemera@meow.social
2025-03-28

Some example testcase errors, thanks to the awesome #miette crate from @zkat (who also authored #KDL btw!)

A screenshot of a testcase error. The content is not important. It shows a snippet of the testcase and underlines `foobar` with an annotation saying "this node is missing an argument".A screenshot of a failing testcase. The content is not important. It shows the testcase and a node with one argument. The node and the argument are both highlighted, each with an annotation saying: "This node has an argument of a wrong kind." and "this one" on the wrong parameter.
Hemera :nixos: :ms_snow_leopard:Hemera@meow.social
2025-03-28

Alright!

I just released a first functional version of a new crate:

🔧 test-dsl at 0.1.0

🦀 github.com/TheNeikos/test-dsl/

To paraphrase the readme: test-dsl allows you to easily author tests by decoupling between the 'test harness', 'verbs' and 'conditions'.

It's role in your testing infra would be as boilerplate reduction, so that you can focus on just writing tests around the behaviour of your system. I'm using this pattern for example in a client-server context. So I have verbs like start_server 1, start_client 2, connect_client 2 1 etc...

Of course the meaning of these verbs is highly project-specific.

If a verb does fail, either by panicking or returning an error, you get a nice error output telling you exactly which file and which verb caused the error. Allowing you to more easily pin-point directly what went wrong, rather than potentially searching through a log.

It works great together with datatest-stable from the nextest project, but it works just as fine standalone.

It uses #KDL as the language to write your testcases in, so its fairly nice to read.

It's still missing more comprehensive documentation, but as a prototype it should work just fine!

It actually sprung out from having used this pattern a few times, and I didn't want to re-write the boilerplate around it, and maybe re-use some code between projects.

#rust #rustlang

Kat Marchán 🐈zkat@toot.cat
2025-03-25

GitHub is now officially highlighting #KDL docs!! On the app, too!

Screenshot of GitHub on mobile, showing syntax highlighted KDL textScreenshot of the iOS GitHub app, showing syntax highlighted KDL text
Kat Marchán 🐈zkat@toot.cat
2025-03-06

Realistically, would #KDL being officially standardized by one of the major international standards organizations influence your interest and/or ability to use KDL, especially at work?

Kat Marchán 🐈zkat@toot.cat
2025-02-27

There is a proposal for #KDL to extend it such that you can have things like 10% or 20px and have that mostly Just Work in terms of existing KDL features

But, t’s not as perfectly clean as I would’ve liked, and so I’m hoping others (you?) will help 👀 for other issues

github.com/kdl-org/kdl/issues/

Kat Marchán 🐈zkat@toot.cat
2025-02-25

lol turns out that when you base a language on xml/s-exp and you give it a really lightweight syntax, it just kinda turns into a really really nice DSL format #KDL

I think that might be what actually sets apart node-based formats from JSON-semantic “map and array” formats. It’s much less convoluted, usually, to make the former look and feel like an executable language

Kat Marchán 🐈zkat@toot.cat
2025-02-24

github.com/kdl-org/kdl/issues/ what do y’all think of this? I know I promised not to change stuff anymore but it’s… a reasonable ask, and I think this might be an elegant solution? #KDL

2025-02-22

Is someone already working on a rust adapter that implements json-in-kdl to serde compatibility?

#kdl cc: @zkat

Kat Marchán 🐈zkat@toot.cat
2025-02-09

I should probably figure out a way to put this on the site but honestly, it's not the cutesy+professional vibe #KDL is really trying to give off so maybe I'll just post it here and be done with it.

Chat message that says "KDL looks like JSON, XML and YAML had threesome lol"
Kat Marchán 🐈zkat@toot.cat
2025-01-26

how do y'all feel about this hypothetical package.kdl?

#KDL

name "@bgotink/kdl"
version "0.3.1"
author "Bram Gotink" url="https://github.com/bgotink"
license MIT
repository "https://github.com/bgotink/kdl" type=git
homepage "https://github.bram.dev/kdl/"
description "Modification-friendly KDL parser and serializer."
keywords kdl parser serializer
type module
private
no-side-effects
package-manager yarn@4.0.2
exports {
    "." "./src/index.js"
    "./json" "./src/json.js"
    "./v1-compat" "./src/v1-compat.js"
    "./dessert" "./src/dessert.js"
    "./package.json" "/package.json"
}
imports { "#v1" "@bgotink/kdl-v1" }
scripts {
    postinstall is-ci || husky
    build node "scripts/build.js"
    test uvu test
    bench node "scripts/bench.js"
    book "scripts/book.sh"
}
dev-dependencies {
    "@bgotink/kdl-v1" "=0.1.7" package="@bgotink/kdl" workspace="./legacy"
    "@types/benchmark" ^2.1.5
    "@types/node" ^22
    benchmark ^2.1.4
    esbuild ^0.24.2
    express-check-in ^0.2.0
    husky "9.1.7-dotconfig.0.1.0" package="@dot-config/husky"
    is-ci ^3.0.1
    kdljs ^0.2.0
    marked ^14.1.2
    prettier "3.4.2-dotconfig.0.1.0" package="@dot-config/prettier"
    typedoc ^0.27.6
    typedoc-plugin-markdown ^4.3.3
    typescript ~5.6.2
    uvu ^0.5.6
}

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst