(DIR) Home
 (DIR) Blog posts
       
       Feed me.
       
       16 July, 2025
       
       Atom feeds! Imagine reinventing a whole new web & keeping XML. JFC.
       
       Atom & RSS came out of RDF, where XML encoding was just an implementation detail. Why not use something else, maybe even something better?
       
       I could make some new thing that looked like YAML. YAML, Markdown, & Gemtext are all designed for the benefit of human writers (& perhaps even readers). Does a feed need to be human readable or writeable? I'd argue yes for the readability part at least. From a functional point of view the summary of a site could be binary, but that way lies the madness of WASM. Looked at as part of the whole system where the web should be as readable as possible, it should stay text & at least as readable for humans as possible. (IMHO is implied throughout the blog!)
       
       But before reinventing any wheels it's worth considering that RSS & Atom already have an existing competitor in HTTP space: JSON Feeds.
       
 (HTM) JSON Feed Version 1.1
       Gemini doesn't for the moment have "modern needs such as avatar images, feed icons and favicons, and banner and featured images", much less the Javascript universe JSON grew out of, but the other goals, of being easier for humans to read & easier for most modern programming languages to read & write, those do apply.
       
       Alas JSON deals just as badly with new lines as YAML. Which means the content text has to be encoded, at least partially for newlines & inverted commas. XML also needs text encoding, because otherwise it would fall over at the first angle brackets. XML has CDATA as well as encoding too, but include the un-encoded ending combination of that caveat in your text & that's all she wrote.
       
       ]]>
       
       Still here? Good.
       
       There are other encodings but I thought percent encoding felt like a natural fit for the JSON world & that's what I used first. The JSON standard mandates Unicode escape sequences though, & Swift's JSONEncoder just adds back in plain old \n & friends, which does have the benefit of keeping it more readable. We could use YAML with any of these encodings too, and that may be where I end up going, but for now I'm using minimally escaped JSON, as blessed by Apple. All standard stuff.
       
       I don't have access to any of the discussion around why anybody picked Atom feeds for Gemini. I'd like to imagine at least some of this was thought & talked about. Maybe it was. It feels like Atom's a pretty idiosyncratic choice though. Personally I'd like to see XML die. It also appeals to me that JSON could outlive Javascript. Those are my own biases here.
       
 (BIN) So I included a JSON Feed on this site, now in its second version at least.
       I'm going to get kicked out of this club aren't I?
       
       JSON feeds have content_html & content_text, & we could add content_gemtext to differentiate between Gemtext & text posts, but I'm putting it all under text for now. That way it still fits the standard & any libraries written for it.
       
       Creating my feed's just another template in the current version of Zine, & that code will probably be in there when I get around to pushing that. Maybe I'll bust that out into something standalone for other generators & servers to use. Feeds readable by nobody until I get around to writing my browser too.
       
       (This post originally appeared in a much shorter form as a Mastodon toot.)