💾 Archived View for drewdevault.com › 2021 › 07 › 28 › The-next-YAML.gmi captured on 2022-04-29 at 12:25:35. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

My wish-list for the next YAML

YAML is both universally used, and universally reviled. It has a lot of problems, but it also is so useful in solving specific tasks that it’s hard to replace. Some new kids on the block (such as TOML) have successfully taken over a portion of its market share, but it remains in force in places where those alternatives show their weaknesses.

I think it’s clear to most that YAML is in dire need of replacement, which is why many have tried. But many have also failed. So what are the key features of YAML which demonstrate its strengths, and key weaknesses that could be improved upon?

Let’s start with some things that YAML does well, which will have to be preserved.

tasks:
- configure: |
jit_flags=""
if [ "$(uname -m)" != "x86_64" ]
then
    jit_flags=--without-jit
fi
./configure \
    --prefix=/usr \
    $jit_flags
- build: |
make
- test: |
make check

What needs to be improved upon?

Consider the following YAML list:

items:
- hello
- 24
- world

Two of these are strings, and one is a number. Representing numbers and strings plainly like this makes it easier for humans to write, though requiring humans to write their values in a format which provides an unambiguous type is not so inconvenient as to save this trait from the cutting room floor. Leaving the ambiguity in place, without any redress, provides a major source of bugs in programs that consume YAML.

Someday I may design something like this myself, but I’m really hoping that someone else does it instead. Good luck!

   \ \_____
###[==_____>
   /_/

“My wish-list for the next YAML” was published on July 28, 2021.

Back to the home page

View “My wish-list for the next YAML” on the WWW

The content for this site is CC-BY-SA. The code for this site is MIT.