30 comments

[ 3.1 ms ] story [ 49.4 ms ] thread
Do you have the Gemini:// URL? I’m getting a URL resolution error.
> Unlike binary formats or database dumps, these files don't hide their meaning behind layers of abstraction. They're built for clarity, for resilience, and for people who like to know what's going on under the hood.

Csv files hide their meaning in external documentation or someone’s head, are extremely unclear in many cases (is this a number or a string? A date?) and is extremely fragile when it comes to people editing them in text editors. They entirely lack checks and verification at the most basic level and worse still they’re often but not always perfectly line based. Many tools then work fine until they completely break you file and you won’t even know. Until I get the file and tell you I guess.

I’ve spent years fixing issues introduced by people editing them like they’re text.

If you’ve got to use tools to not completely bugger them then you might as well use a good format.

Clearly there’s a very real need for binary data formats, or we wouldn’t have them. For one, it’s much more space efficient. Does the author know how much storage cost in 1985? Or how slow computers were?

If I time traveled back to 1985 and told corporate to adopt CSV because it’d be useful in 50 years when unearthing old customer records I’d be laughed out of the cigar lounge.

I journeyed from fancy commercial bookkeeping systems that changed data formats every few years (with no useful migration) to GNU Cash and finally to Plain-Text Accounting. I can finally get the information I need with easy backups (through VCS) and flexibility (through various tools that transform the data). The focus is on content, not tools or presentation or product.

When I write I write text. I can transform text using various tools to provide various presentations consumable through various products. The focus is on content, not presentation, tools, or product.

I prefer human-readable file formats, and that has only been reinforced over more than 4 decades as a computer professional.

I concur with most of these arguments, especially about longevity. But, this only applies to smallish files like configurations because I don't agree with the last paragraph regarding its efficiency.

I have had to work with large 1GB+ JSON files, and it is not fun. Amazing projects such as jsoncons for streaming JSONs, and simdjson, for parsing JSON with SIMD, exist, but as far as I know, the latter still does not support streaming and even has an open issue for files larger than 4 GiB. So you cannot have streaming for memory efficiency and SIMD-parsing for computational efficiency at the same time. You want streaming because holding the whole JSON in memory is wasteful and sometimes not even possible. JSONL tries to change the format to fix that, but now you have another format that you need to support.

I was also contemplating the mentioned formats for another project, but they are hardly usable when you need to store binary data, such as images, compressed data, or simply arbitrary data. Storing binary data as base64 strings seems wasteful. Random access into these files is also an issue, depending on the use case. Sometimes it would be a nice feature to jump over some data, but for JSON, you cannot do that without parsing everything in search of the closing bracket or quotes, accounting for escaped brackets and quotes, and nesting.

> I have had to work with large 1GB+ JSON files, and it is not fun.

I had also had to work with large JSON files, even though I would prefer other formats. I had written a C code to split it into records, which is done by keeping track of the nesting level and of whether or not it is a string and the escaping in a string (so that escaped quotation marks will work properly). It is not too difficult.

> I was also contemplating the mentioned formats for another project, but they are hardly usable when you need to store binary data, such as images, compressed data, or simply arbitrary data. Storing binary data as base64 strings seems wasteful.

I agree, which is one reason I do not like JSON (I prefer DER). In addition to that, there is escaping text.

> Random access into these files is also an issue, depending on the use case. Sometimes it would be a nice feature to jump over some data, but for JSON, you cannot do that

With DER you can easily skip over any data.

However, I think the formats with type/length/value (such as DER) do not work as well for streaming, and vice-versa.

I can understand this for "small" data, say less than 10 Mb.

In bioinformatics, basically all of the file formats are human-readable/text based. And file sizes range between 1-2Mb and 1 Tb. I regularly encounter 300-600 Gb files.

In this context, human-readable files are ridiculously inefficient, on every axis you can think of (space, parsing, searching, processing, etc.). It's a GD crime against efficiency.

And at that scale, "readable" has no value, since it would take you longer to read the file than 10 lifetimes.

I'll take sexprs over CSV/JSON/YAML/XML any day.
Lets hear it for RTF for documents
Are there any binary formats that include the specification in the format itself?
There are binary files with text header, e.g. PCD (pointcloud data) writes the payload type, point count, point attribute names and types as text, and the list of points is stored in text, binary, or compressed.
Readable files are great… until they’re 1TB and you just want to cry.
I'm not sure the author knows much about binary formats.

Binary formats are binary for a reason. Speed of interpretation is one reason. Usage of memory is another reason. Directly mapping it and using it, is another reason. Binary formats can make assumptions about system memory page size. They can store internal offsets to make incremental reading faster. None of this is offered by text formats.

Also, the ability to modify text formats is completely wrong. Nothing can be changed if we introduce checksums inside text formats. Also if we digitally sign a format, then nothing can be changed despite the fact that it's a text format.

Also, comparing CSV files to internal database binary format? It's like comparing a book cover to the ERP system of a library. Meaning, it's comparing two completely different things.

Let’s say that hypothetically one were to disagree with this. What would be the best alternative format? One that has ample of tooling for editing and diffing, as though it was text, yet stores things more efficiently.

Most of the arguments presented in TFA are about openness, which can still be achieved with standard binary formats and a schema. Hence the problem left to solve is accessibility.

I’m thinking something like parquet, protobuf or sqllite. Despite their popularities, still aren’t trivial for anyone to edit.

Human-readability was one of the aspects that I enjoyed about using CCL,the Categorical Configuration Language (https://chshersh.com/blog/2025-01-06-the-most-elegant-config...), in one of my projects recently.

It saves you from escaping stuff inside of multiline-strings by using meaningful whitespace.

What I did not like about CCL so much that it leaves a bunch of stuff underspecified. You can make lists and comments with it, but YOU have to decide how.

That whole post reads like a parody. Making fun of other config formats, only to go full blown category theory to explain one can merge config files.. Also weird to use key-value maps as basic type instead of lists, then having to make lists out of maps, rather than the other way around. And who wants to configure the comment symbol? Schema validation is also not in, but hey we can define data types (which are app specific anyway?)
Even "human-readable" formats are only readable if you have proper tools - i.e. editors or viewers.

If a binary file has a well-known format and tools available to view/edit it, I see zero problems with it.

Ease of: reading, comprehension, manipulation, short- and long-term retrieval are not the same problems. All file formats are bad at at least one of these.

Given an arbitrary stream of bytes, readability only means the human can inspect the file. We say "text is readable" but that's really only because all our tooling for the last sixty years speaks ASCII and we're very US-centric. Pick up a text file from 1982 and it could be unreadable (EBCDIC, say). Time to break out dd and cross your fingers.

Comprehension breaks down very quickly beyond a few thousand words. No geneticist is loading up a gig of CTAGT... and keeping that in their head as they whiz up and down a genome. Humans have a working set size.

Short term retrieval is excellent for text and a PITA for everything else. Raise your hand if you've gotten a stream of bytes, thrown file(1) at it, then strings(1), and then resorted to od or picking through the bytes.

Long term retrieval sucks for everyone. Even textfiles. After all, a string of bytes has no intrinsic meaning except what the operating system and the application give it. So who knows if people in 2075 will recognise "48 65 6C 6C 6F 20 48 4E 21"?

You want JARs to be human-readable? PNGs? MP3s?

I think the author is thinking about a very narrow set of files.

We learned the hard way, for some of us it's all too easy to make careless design errors that become baked-in and can't be fixed in a backward-compatible way (either at the DSL or API level). An example in Graphviz is its handling of backslash in string literals: to escape special characters (like quotes \"), to map special characters (like several flavors of newline with optional justification \n \l \r) and to indicate variables (like node names in labels \N) along with magic code that knows that if the -default- node name is the empty string that actually means \N but if a particular node name is the empty string, then it stays.

There was a published study, Wrangling Messy CSV Files by Detecting Row and Type Patterns by Gerrit J. J. van den Burg, Alfredo Nazábal, and Charles Sutton (Data Mining and Knowledge Discovery, 2019) that showed many pitfalls with parsing CSV files found on GitHub. They achieved 97%. It's easy to write code that slings out some text fields separated by commas, with the objective of using a human-readable portable format.

You can learn even more by allowing autofuzz to test your nice simple code to parse human readable files.

It’s not about human-readable, it’s about standard format & available tooling to read for it. Be it .txt or json or yaml; standard format & tooling; digital content anyways isn’t human readable either digital interface.
/* Technically, most binary formats are legible to a human, given a proper renderer, e.g. journalctl. What TFA speaks about is ASCII/UTF-8 text formats that need no processing besides rendering CR, LF, and TAB characters specially. Assuming a Unix command line, I would call these "cat-readable" formats, or maybe even "less-readable". */
FWIW, journald's file format is one case where upon reading the spec I said it needs to be taken behind the barn and shot as a mercy.

And no, it had nothing to do with being binary, and everything to do with badly mixing "durable system log" and "quick retrieval" aspects in wrong order.

I see no issue using (or even receiving) an SQLite file, where I can see the tables structure and even export everything to pure text format.

The major problem of both human-readable and binary formats is not the serialized form, but the understanding of the schema (structure) of the data, which more often than not, is completely undocumented. Human-readable formats are worse in this regard, because they justify it by "it's obvious what this is".

> The major problem of both human-readable and binary formats is not the serialized form, but the understanding of the schema (structure) of the data, which more often than not, is completely undocumented. Human-readable formats are worse in this regard, because they justify it by "it's obvious what this is".

Exactly - CSV files for instance handle escaping or quoting inconsistently depending on the creator. Even supposedly machine readable text formats like RSS do not always have consistent schemas [0]. Unix programs seem particularly prone to using underspecified text formats as output.

[0] https://www.xml.com/pub/a/2002/12/18/dive-into-xml.html

Me too.

Especially in ASCIIDOC/HTML/TXT/PDF files - for PDF files also a copy of ODF/ODT for editing where possible.

Then I can search for anything needed with grep(1) or pdfgrep(1) commands.

I'd love to see us go even further! Having file formats at all is less human readable than going 9p style, less human (and script) readable than a directory tree of simple values.

The OS has a builtin way to create heirarchical structured data. I'd love to see the boldness to try using that!

There was a good example of a json->directory tool submitted yesterday, json2dir. https://github.com/alurm/json2dir https://news.ycombinator.com/item?id=44840307

This does mean you'd need to tar/zip up your file tree to send it around. It's less clear that this directory is a thing, is meant to be a file like one entity. But by taking our data out of complex file formats and turning it into a a filesystem heirarchy, it removes the arbitrariness of choosing any encoding at all, and it directly opens up all data to scripting. You can echo a new hex color into a foreground file to change it. You can watch a user directory for changes to update a rendering of it. You can btrfs snapshot your window layout to save your desktop configuration.

We have so so many specific tools for computing. It's time that we try making some more general systems, that let us work broadly / regardless of specific application! "Just files" could be a key enabler!

Nice captcha. I made almost the same thing, except mine looks like an actual captcha box and sends a post request upon clicking the fake checkbox. This works very well (100% of the times) for automated scrapers. I don't think anything more is needed
I used the URL gemini://adele.pollux.casa/gemlog/2025-08-04_why_I_prefer_human-readble_file_formats.gmi (the one linked to directly does not work on my computer).

I prefer binary file formats (including DER) for many things, and I will respond to the individual parts as well as my own comments.

> With human-readable formats, you're never locked out of your own data. Whether you're on a fresh Linux installation, a locked-down corporate machine, or troubleshooting a system with minimal tools, you can always inspect your configuration files, data exports, or documentation with nothing more than `cat`, `less`, or any basic text editor.

This is helpful especially for documentation.

However, not all of the formats for data are going to be that easy to inspect in this way, and the meaning is not always clear even if it is a text format. Additionally, even if it is clear when reading does not necessarily mean that it is convenient to modify it.

Furthermore, the use of text formats means that escaping may be needed, which can complicate the decoding and encoding, and can also be the "leaning toothpick syndrome".

> A JSON configuration file works the same way whether you're viewing it in VS Code, vim, or even a web browser. This universality means fewer barriers to collaboration and fewer "it works on my machine" moments.

Although it can be displayed the same way (especially if it is in purely ASCII format), it can be difficult to read if packed together and inefficient if formatted nicely, and there is the issue with escaping that I mentioned above. When editing JSON, there is also that JSON does not have comments and that optional trailing commas are not allowed, which can make it inconvenient to modify.

JSON, CSV, etc have their own limitations though, which can be problems for some uses (e.g. storing binary data together with text, storing non-Unicode text data, and others). Sometimes this will then extend to the formats made using them, because they had not considered that.

> Digital archaeology is real, and proprietary formats are its enemy. How many documents from the 1990s are now trapped in obsolete file formats?

It is not quite that simple. I had sometimes found them easier to figure out than some modern text-based formats.

> Ok, sometimes, there are some character encoding conversions needed (you see, CP-1252, EBCDIC, IBM-850, ISO8859-15, UTF-8), but, these operations are easy nowadays.

That is also often done badly. There are good ways to handle character encoding, including ways that do not involve conversion, but they are not as commonly supported by some modern programs.

> Need to bulk-update settings? Write a simple script or use standard text processing tools.

This is not always good, depending on the format and on other things. (SQL might work better for many kind of bulk updates.)

> You don't need expensive software licenses, proprietary APIs, or vendor-specific tools to work with your data.

You don't need those things for many binary formats either. Sometimes you might, but if it is designed well then you shouldn't need it.

> The entire Unix toolchain, `grep`, `sed`, `awk`, `sort`, `cut`, becomes your toolkit. Want to extract all email addresses from a CSV? `grep` has you covered.

For some simple formats, especially TSV, it might work, but not all text-based formats are like that.

> JSON, XML, CSV, these formats have multiple independent implementations, comprehensive specifications, and broad community support.

Yes, but so do many binary formats, such as DER (I wrote my own implementation in C).

> Version control systems like Git are optimized for text, and human-readable formats take full advantage of this optimization. Line-by-line diffs become meaningful, showing exactly what changed between versions. Merge conflicts are resolvable because you can actually read and understand the conflicting content.

It is true that such version control systems are made to work with...