frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The YAML Document from Hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
51•agvxov•3h ago

Comments

al_borland•2h ago
The Norway problem drives me a bit nuts.

In a lot of the Ansible documentation, yes/no are used instead of true/false. When seeing this in the official docs, I used it, figuring this was the preferred convention in Ansible. These days it now throws warnings or lint errors, so I’m updating it all over the places as I find it. Yet the Ansible documentation still commonly uses it.

tgv•43m ago
It depends on how they parse/decode/unmarshal the file. If they use a "generic" yaml parser, no will be translated to false. But if the parser knows the types of the data structure, or can be instructed not to replace certain strings, or has hooks, it can treat no as a string. So it might be that the linter doesn't operate like the parser.
gchamonlive•4m ago
[delayed]
xenator•1h ago
This one is amazing, I almost pissed myself laughing reading it. So true about YAML. Another caveat is using --- as section separator in the file. It will starts new file inside your existing file.

Still love it.

BobbyTables2•1h ago
I’m amazed how sane the “document from hell” looks.

The author didn’t even get into the weird stuff GitLab does with YAML too!

twelvechairs•1h ago
Almost all of this is solved by basically putting quotes around strings.

Yaml has its uses cases where you want things json doesnt do like recursion or anchors/aliases/tags. Or at least it has had - perhaps cue/dhall/hcl solves things better. Jsonnet is another. I havent tried enough to test how much better they are.

lillesvin•19m ago
> Almost all of this is solved by basically putting quotes around strings.

Yeah, that was my first thought as well. I personally don't mind YAML, but I've also made a habit out of quoting strings. And, I mean, you're quoting both keys and strings in JSON, so you're still saving approx. 2 double quotes per key/value pair in YAML if that's a metric that's important to you.

everforward•5m ago
JSON doesn’t do them as part of the spec, but there’s nothing stopping you from doing them as post-processing. Eg OpenAPI does it by using a special $ref key where the post processor swaps in the value referenced there.

That’s effectively what jsonnet/cue/hcl do, though as a preprocessor instead of a postprocessor.

raincole•1h ago
The n, no, off thing is just sad. It's a 100% avoidable issue. But whoever put that into spec was just so clever that they overflew and became stupid.
__alexs•1h ago
This is basically every problem in YAML. Someone couldn't resist adding more stuff and either didn't realise or didn't care about the ambiguities it created.
rossant•1h ago
Wow, I wasn't aware there was so much magic and arcane features in yaml. Great post. Thanks.
bertman•53m ago
Discussion from 3 years ago, when this was originally posted:

https://news.ycombinator.com/item?id=34351503 , 566 points, 358 comments

h1fra•35m ago
not only is YAML a pain but JSON has native parser in major languages, while not yaml. I find it crazy some people are still actively choosing this over JSON (or alternatives)
secondcoming•34m ago
It's honestly absurd how prevalent YAML is. It's clearly dumb.
Kostarrr•34m ago
So... what are the good alternatives to yaml?

For quite some time I thought toml, but the way you can spread e.g. lists all over the document can also cause some headaches.

Dhall is exactly my kind of type fest but you can hit a hard brick wall because the type system is not as strong as you think.

endgame•27m ago
I wish I had a good answer for you. I've been dissatisfied with Dhall, Nickle, Cue, and possibly others. Dhall's type system is both too strong (you have to plumb type variables by hand if you want to do any kind of routine FP idioms) and too weak (you can't really _do_ much with record types - it's really hard to swizzle and rearrange deeply nested records).

On top of that, the grammar is quite difficult to parse. You need a parser that can keep several candidate parses running in parallel (like the classic `Parser a = Parser (String -> [(a, String)])` type) to disambiguate some of the gnarlier constructs (maybe around file paths, URLs, and record accesses? I forget). The problem with this is that it makes the parse errors downright inscrutable, because it's hard to know when the parse you actually intended was rejected by the parser when the only error you get was "Unexpected ','".

Oh, and you can't multiply integers together, only naturals.

Maybe Nix in pure eval mode, absurd as that sounds?

I think the best thing for tools to do is to take and return JSON (possible exception: tools whose format is simple enough for old-school UNIX-style stdin/stdout file formats). Someone will come up with a good functional abstraction over JSON eventually, and until then you can make do with Dhall, YAML, or whatever else.

kzrdude•33m ago
Yaml is an interesting case study that we can (and have) learned a lot about. Mistakes to avoid. :)
thomasfl•23m ago
Not many know that the inventor of the YAML specification built a fully working pendulum clock as a teenager. With Lego bricks. YAML is a good standard for simple settings files. For more complex data structures, use JSON.
vivzkestrel•20m ago
stupid question: why dont they announce a newer version of YAML that is not backwards compatible and allow only quoted strings in their parser?
maweki•15m ago
We found yaml to be a great exchange format for electronic exam data. It allows us to put student submitted answers and source code into a yaml file and there is no weird escaping. It's very readable with a text editor. And then we just add notes and a score as a list below and then there's the next submission.

For readability of large blocks of texts that may or may not contain various special characters and newlines the only other alternative we have seen was XML, but that is very verbose.

So what the author finds as a negative, the many string formats, are exactly what drew us to yaml in the first place.

Go has added Valgrind support

https://go-review.googlesource.com/c/go/+/674077
132•cirelli94•3h ago•23 comments

Structured Outputs in LLMs

https://parthsareen.com/blog.html#sampling.md
36•SamLeBarbare•1h ago•4 comments

Nine Things I Learned in Ninety Years

http://edwardpackard.com/wp-content/uploads/2025/09/Nine-Things-I-Learned-in-Ninety-Years.pdf
482•coderintherye•9h ago•194 comments

Indoor surfaces act as sponges for harmful chemicals

https://news.uci.edu/2025/09/22/indoor-surfaces-act-as-massive-sponges-for-harmful-chemicals-uc-i...
35•XzetaU8•3h ago•9 comments

Zoxide: A Better CD Command

https://github.com/ajeetdsouza/zoxide
178•gasull•7h ago•98 comments

The YAML Document from Hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
53•agvxov•3h ago•22 comments

Zinc (YC W14) Is Hiring a Senior Back End Engineer (NYC)

https://app.dover.com/apply/Zinc/4d32fdb9-c3e6-4f84-a4a2-12c80018fe8f/?rs=76643084
1•FriedPickles•38m ago

Altoids by the Fistful

https://www.scottsmitelli.com/articles/altoids-by-the-fistful/
112•todsacerdoti•6h ago•53 comments

Processing Strings 109x Faster Than Nvidia on H100

https://ashvardanian.com/posts/stringwars-on-gpus/
43•ashvardanian•3d ago•0 comments

Qwen3-Omni: Native Omni AI model for text, image and video

https://github.com/QwenLM/Qwen3-Omni
501•meetpateltech•18h ago•125 comments

Cache of Devices Capable of Crashing Cell Network Is Found Near U.N

https://www.nytimes.com/2025/09/23/us/politics/secret-service-sim-cards-servers-un.html
46•adriand•1h ago•17 comments

Hyb Error: A Hybrid Metric Combining Absolute and Relative Errors

https://arxiv.org/abs/2403.07492
6•ncruces•2h ago•0 comments

Delete FROM users WHERE location = 'Iran';

https://gist.github.com/avestura/ce2aa6e55dad783b1aba946161d5fef4
628•avestura•7h ago•468 comments

Fall Foliage Map 2025

https://www.explorefall.com/fall-foliage-map
190•rappatic•12h ago•24 comments

Show HN: Run Qwen3-Next-80B on 8GB GPU at 1tok/2s throughput

https://github.com/Mega4alik/ollm
13•anuarsh•3d ago•0 comments

I built a dual RTX 3090 rig for local AI in 2025 (and lessons learned)

https://www.llamabuilds.ai/build/portable-25l-nvlinked-dual-3090-llm-rig
75•tensorlibb•4d ago•61 comments

Compiling a Functional Language to LLVM (2023)

https://danieljharvey.github.io/posts/2023-02-08-llvm-compiler-part-1.html
22•PaulHoule•2d ago•0 comments

Walking Michigan City (Indiana)

https://walkingtheworld.substack.com/p/walking-michigan-city-indiana
27•Michelangelo11•1h ago•2 comments

Themis (European Reusable Rocket) is assembled on launch pad

https://phys.org/news/2025-09-themis-pad-fully.html
88•theamk•3d ago•72 comments

Gamebooks and graph theory (2019)

https://notes.atomutek.org/gamebooks-and-graph-theory.html
49•guardienaveugle•8h ago•2 comments

Cap'n Web: a new RPC system for browsers and web servers

https://blog.cloudflare.com/capnweb-javascript-rpc-library/
572•jgrahamc•23h ago•239 comments

I'm spoiled by Apple Silicon but still love Framework

https://simonhartcher.com/posts/2025-09-22-why-im-spoiled-by-apple-silicon-but-still-love-framework/
348•deevus•23h ago•462 comments

Paper2Agent: Stanford Reimagining Research Papers as Interactive AI Agents

https://arxiv.org/abs/2509.06917
124•Gaishan•14h ago•29 comments

Why haven't local-first apps become popular?

https://marcobambini.substack.com/p/why-local-first-apps-havent-become
445•marcobambini•23h ago•439 comments

Based C++

https://github.com/SheafificationOfG/based-cpp
80•phamtrongthang•3d ago•30 comments

The Beginner's Textbook for Fully Homomorphic Encryption

https://arxiv.org/abs/2503.05136
220•Qision•1d ago•38 comments

Kevo app shutdown

https://www.kwikset.com/support/answers/what-does-the-kevo-app-shutdown-mean-to-my-kevo-door-lock
106•asperous•14h ago•90 comments

Is a movie prop the ultimate laptop bag?

https://blog.jgc.org/2025/09/is-movie-prop-ultimate-laptop-bag.html
230•jgrahamc•1d ago•232 comments

The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text

https://arxiv.org/abs/2506.05209
47•djoldman•4d ago•10 comments

Germicidal UV could make airborne diseases as rare as those carried by water

https://www.worksinprogress.news/p/how-to-clean-the-air
87•venkii•14h ago•49 comments