frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Why do so many tools have JSON config files?

https://textlog.cc/post/895
17•stagas•1h ago

Comments

brunoborges•58m ago
TOML is a better format for configuration files IMO, if not for many reasons, primarily because TOML accepts comments.

However, one annoying thing for TOML was the lack of schema, and the reliance on JSON Schema for that. Which I decided to tackle years ago when I started the TOML Schema project. In the past few months I leveraged code agents to take to the finish line and got something compelling: tomlschema.org

bakies•49m ago
Reading and writing json is so much easier than reading or writing toml imo
jauntywundrkind•9m ago
I'd argue that for code, yes, JSON is vastly closer to computer structures.

I think this is the real "why do so many tools have JSON config files": because it's just a literal notation, for basic data structures, that looks a lot like what many programming languages natively do, what their data structures natively are. The answer to the post is: it's mechanistic sympathy.

For humans, I do find TOML to be a lot easier to manage. Even if you have a really good editor that takes care of all the quoting/nesting/comma concerns for you, even if you have jsonc or json5 with comments, it's still not as easy/friendly as a big flat file with sections in it.

leni536•44m ago
Interesting. The website says that it's "validation-focused". I don't know how that plays out for TOML, but the lack of focus in json schema to define an interface in addition to validation can be very frustrating. Most of the time I would rather trade off some expressitivity in terms of validation in favor of having a defined typed interface into the validated data.
Sha1rholder•34m ago
I find TOML is nowhere near as good as YAML. I'd even rather use jsonc.
ChickeNES•28m ago
Yeah, I just use JSON5, it solves all the issues with normal json
nottorp•55m ago
It would be too easy to have every option in a config file documented in comments in the default config file. Think of the poor tutorial industry. It may even make chatbots less useful.
mr_toad•54m ago
Somewhat off topic, but Oracle database connection strings seem to be a form of Lisp. It makes me wonder why they would choose that.
eastbound•46m ago
Let me guess... if they're a form of Lisp, did someone add jndi support, then made it possible to print to the console while the string gets read and finally made it executable because who wouldn't want a LISP for-loop in an Oracle connection string? On to the next RCE...
tosti•49m ago
JSON is obviously a poor choice. It's job is to interchange data, produced and parsed by computers.

ESR had the idea of writing configuration in English. It didn't gain traction at the time, but we have LLMs now. It might be a good idea to revisit the idea of accepting plain english. The LLM output could then be any format that's easy and unambiguous to parse.

bigstrat2003•47m ago
Absolutely not. We do not want a stochastic program without any actual understanding of the schema to be interpreting config data.
samrus•45m ago
> The LLM output could then be any format that's easy and unambiguous to parse.

Thats the problem isnt it? LLMs arent deterministic. Terrible for prod

anon291•25m ago
Llms are absolutely deterministic if you want them to be.

Still a terrible idea for config

NewJazz•3m ago
[delayed]
tosti•25m ago
I'm not sure why there's a problem before even trying.

Say for instance you have a program that keeps recipes. In your configuration file, there's settings such as metric/imperical units, allergies, diets, type of stove in your kitchen, and some theming (font, size, color...). You put them all in a file that you can parse, but aunt tillie messes up the formatting and the program breaks.

Instead of changing the config by hand, an LLM could supply the diff according to instructions in English. I really don't see why this would be "Terrible for prod". If the LLM screws up, you're simply back to square 1 and aunt tillie will call you just like she would before she had an LLM to fix her computer.

gwbas1c•48m ago
> Why do so many tools have JSON config files‽

1: Because JSON is a very easy serialization format to work with. I suspect these tools all have configuration classes / objects that are deserialized straight from the config file.

2: I suspect a lot of these tools are written in Javascript, and in Javascript JSON is very easy to work with.

happymellon•8m ago
JSON is probably the easiest format to work with regardless of language.
bonestamp2•45m ago
For our internal tooling we use something similar to a bash profile config file with name/value pairs separated by linebreaks. So, our configs look something like:

env=staging

db=0.0.0.0

#descriptive comment

etc=true

jetbalsa•26m ago
ini file format is pretty much this

[section_name]

key=value

key=value

Super3000•39m ago
Because JSON is native to the lingua franca of the internet: Java-/Ecmascript.

It fits into the poor choices we made, <-- Parse error

Garlef•39m ago
because JSON is in the following sense "universal":

every format/structure that has numbers, strings, booleans, null/none, finite lists of items, and string-indexed records of items already contains JSON

and that's pretty much the barebones you need for a configuration language

(of course you can argue about the syntax)

stagas•35m ago
Lack of comments is pretty big though for a human editable config.
dd8601fn•30m ago
It’s just one person’s opinion, but I think two things are true enough, here…

1) JSON is pretty darn good for storing configuration. Everything speaks it, and a pretty printed one is very readable/tweakable in a pinch.

2) If you insist that someone manually edit a significant amount of it, you kinda fucked up.

Just my opinion, but it feels like two separate things.

krapp•27m ago
JSON still a very simple and useful format and being natively supported on the web and by javascript basically guarantees its universality. Native comments would be nice though. But to be fair even Douglas Crockford suggested using comments in JSON was fine as long as you stripped them out before parsing.

<whispers>but Lua tables are even better.</whispers>

arcanemachiner•8m ago
You can always use JSONC or JSON5.
francisofascii•30m ago
> Why do so many tools have JSON config files‽

Because XML hasn't been cool for about two decades. And suggesting .ini would you laughed out of the room into retirement.

szatkus•27m ago
> A lot of tech folks resist documentation because they think it provides them with job security.

No, we're just lazy.

binsquare•26m ago
It's readable, it's easy, it gets the job done.

I don't think that's necessarily lazy, it's just efficient

herbst•22m ago
> It's readable, it's easy

That's what I am saying about my ruby codes as well. Still my boss wanted proper commit messages

zamadatix•9m ago
Something has gone awry if the config files have a readability and difficulty analogous to that of the codebase.
gwbas1c•8m ago
I don't agree with "readable," though. For a simple set of key-values, yes. Once you get into complicated structures, other file formats express the semantics much better.
jjice•13m ago
Occam's Razor at it's finest. I'm not trying to screw others over. I just want to not write sometimes.
spottedmarley•24m ago
JSON just works, everywhere, all the time. Sometimes I'll use SQLite if there is a particular need.
Y-bar•23m ago
Can you show an example of how you use SQLite for _config_ files?
LambdaComplex•22m ago
I think your emphasis might be in the wrong place...SQLite for config makes enough sense, but as a config _file_?
Y-bar•14m ago
Not entirely. Because where would I configure the location of the SQLite location/connection then?

Given what I know about it (single file, no auth, and such by default) I sort of understand the ”file” part I think. But not the ”config” part.

spottedmarley•12m ago
SQLite is a tiny relational db that essentially runs right in the same folder as your application. No connection other than connecting from the app itself to the SQLite.db sitting next to it.
gwbas1c•6m ago
You're missing the point: Why are your config files so complicated that you need SQLite?

I've shipped a product that used SQLite, and we actively removed configuration from SQLite. It was a lot easier to diagnose issues when configuration was in text files, because non-programmers could kinda-sorta understand them without needing to learn how to use SQL.

jamesponddotco•20m ago
I don't know about others, but I use JSON because it's in the standard Go library, and most of the times, I rather use something weird than add a dependency.
mholt•12m ago
For Caddy we chose JSON because it's fairly universal, maps nearly 1:1 with Go structs (useful for initializing an extensible server), and nearly everything else compiles to JSON one way or another, so you can choose your own config format, really: https://caddyserver.com/docs/config-adapters
p4bl0•47s ago
Hey, thanks for Caddy! It's awesome :).
climate_denier_•12m ago
I wish everyone would embrace Amazon's Ion format. Of the data serialization formats it seems the most reasonable with the exception that it can encode S-expressions (so like having data serialization within your data serialization), so it is a bit excessive.

https://en.wikipedia.org/wiki/Ion_(serialization_format)

happymellon•8m ago
At a previous employer we tried using Ion, but when they stopped supporting our QLDB it was obvious that nothing else really used it and it was a dead end.

Shame.

raincole•7m ago
> Why do so many tools have JSON config files‽ Commenting why options have been set the way they have is just such a basic thing to want to do… Why do tech people have such an aversion to writing things down⁇

That's the whole post. First I don't know why this is posted on HN. Second I don't see how "JSON config" and "writing things down" are the two opposite options.

delecti•8m ago
Using an LLM to parse your application's config is a bit like using an F1 racecar to drive from your house to the bicycle in your attached garage. Getting config into the application should to be fast, light (lighter than the rest of the application), and deterministic. And if the LLM's output is easy and unambiguous to parse, it's easier to simply use that as the original config file.
6510•1m ago
I just put them in as values. In a GUI I sometimes render them as a editable textarea.
deaf_coder•30m ago
It's so simple and straightforward, and that's why Douglas Crockford claims he "discovered" it, rather than invented it.

Gemini 3.8 Flash and 3.8 Flash Cyber

https://blog.google/innovation-and-ai/models-and-research/gemini-models/3-8-flash-and-3-8-flash-c...
589•bratao•4h ago•361 comments

Mistral now trains on user input by default, except on enterprise tier

https://help.mistral.ai/en/articles/455207-can-i-opt-out-of-my-input-or-output-data-being-used-fo...
301•teekert•7h ago•126 comments

Biggest dark matter detector spots a single weird particle

https://www.science.org/content/article/world-s-biggest-dark-matter-detector-spots-single-weird-p...
190•randycupertino•5h ago•44 comments

Exit the Cave

https://turtlespace.blog/p/exit-the-cave
142•akkartik•5h ago•37 comments

SteamdDB Joins Nexus Mods

https://www.nexusmods.com/news/15597
66•HelloUsername•4h ago•32 comments

Aging Brains Blend Memories Together Instead of Just Forgetting Them

https://studyfinds.com/aging-brains-blend-memories-together-instead-of-forgetting-them-study-finds/
137•mdp2021•6h ago•60 comments

Three sites made 215,128 “best software” pages for AI. Perplexity cites them

https://trellner.com/reports/manufactured-sources-behind-ai-recommendations/
234•jakobgreenfeld•5h ago•109 comments

Commodore 64 released September 1, 1982

https://dfarq.homeip.net/commodore-64-released-september-1-1982/
290•giuliomagnifico•10h ago•140 comments

Wendell Berry has died

https://www.nytimes.com/2026/08/31/us/wendell-berry-dead.html
18•Curiositry•1d ago•12 comments

Paint.net 5.2 alpha now runs on Linux

https://forums.paint.net/topic/134562-paintnet-52-alpha-build-9739/
110•judah•2h ago•90 comments

Poisson Disk Sampling

https://stripeacross.com/posts/poisson-disk-sampling/
96•vismit2000•5h ago•14 comments

I Don't Have a Smartphone

https://ploum.net/2026-09-02-i_dont_have_a_smartphone.html
122•speckx•1h ago•107 comments

A Selection of Los Alamos Rolodex Business Cards

https://clui.org/collections/los-alamos-business-cards/selection-cards
101•1970-01-01•2d ago•21 comments

Google avoids a breakup of its ad tech business

https://www.nytimes.com/2026/09/02/technology/google-ad-tech-remedies.html
9•donohoe•4h ago•0 comments

Humanity has built the records of FATE by accident

https://ariadne.space/2026/09/01/humanity-has-built-the-records.html
6•miniBill•32m ago•1 comments

A note on subscription prices from LWN

https://lwn.net/Articles/1090585/
631•rwky•6h ago•125 comments

Making the Internet Boring

https://cemrehancavdar.com/2026/08/30/making-the-internet-boring/
27•zdw•2d ago•12 comments

Check if a file was made with Claude

https://claude.com/check-content
126•frexs•7h ago•86 comments

We could save petabytes of cache storage with Zstandard and Pingora

https://blog.cloudflare.com/cache-transcoding/
18•torutofu•1d ago•0 comments

WebLLM: high-performance in-browser LLM inference engine

https://github.com/mlc-ai/web-llm
60•saikatsg•5h ago•14 comments

The American Worker vs. the Most Qualified

https://www.marginallycompelling.com/p/the-american-worker-vs-the-most-qualified
10•skmurphy•50m ago•7 comments

The Qantas A380 engine disintegration in 2010

https://admiralcloudberg.medium.com/a-matter-of-millimeters-the-story-of-qantas-flight-32-bdaa62d...
4•gumby•51m ago•0 comments

GrapheneOS says Pixel 11 has MTE support after all

https://grapheneos.social/@GrapheneOS/117194007157499435
158•user_7832•5h ago•114 comments

Discontinuation of third level domain registrations for the .name TLD [pdf]

https://itp.cdn.icann.org/en/files/consensus-policies/rsep-2026013-name-request-15-04-2026-en.pdf
35•greyface-•1d ago•25 comments

Embedded Rust RTOS vs. C RTOS

https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown/
5•kooi•1h ago•0 comments

Show HN: FrontierHarness Eval – 9 harness, same model, cost per pass varies 17x

https://frontierharness.org
48•shiqimei•3h ago•27 comments

The race to engineer new knobs for the human brain

https://www.neuroai.science/p/the-race-to-engineer-new-knobs-for
26•pminimax•3h ago•3 comments

Telli (YC F24) is hiring engineers and designers [Berlin, on-site]

https://careers.telli.com/
1•sebselassie•10h ago

How to debloat your Xiaomi 15 Ultra without root access

https://trackerninja.codeberg.page/post/how-to-debloat-your-xiaomi-15-ultra-without-rooting-and-c...
24•spacedrone808•3h ago•14 comments

Tangle – Visual ML Pipeline Editor

https://tangleml.com/
18•duck•2h ago•1 comments