Why does ACME use JSON, arrrg! I know XML is a pain, but surely that would have been better. I need to knock up a JSON library now :-) The plan is for @firebrick to have ACME @letsencrypt built in - not in this coming release of code but next one, soon...— RevK® (@TheRealRevK) 7 April 2018
Well, I am starting to wonder if JSON is better than XML in some ways now. I have coded a new JSON library for the FireBrick today. It was not hard, in fact, the simplicity does make me wonder if neater in some ways than XML.
Both have a clear formal spec, but what do they have different?
- XML has all sorts of special cases like CDATA and processing instructions and comments, JSON does not
- XML does not allow a null character even escaped, JSON allows it
- XML has all of that pesky namespace stuff. It has its place but for a lot of systems it does not help matters and makes it more complex
- XML has no concept of even simply types for data, JSON has strings, numbers, boolean, and null as distinct and identifiable types.
- XML only has objects with attributes and sub objects, JSON has arrays which XML does not.
The JSON library was actually really easy and the syntax if very strict, surprisingly so, to be honest.
So I am leaning towards JSON as being better than XML for now.
What is this all in aid of? Well FireBricks use code we control and we have coded everything from operating system startup to IPSec. So I needed to make a JSON library. There are "standard" open source libraries we could use, but having only taken a day to do this I suspect integrating something in to our build system would have taken longer.
But why do I need JSON all of a sudden? Well ACME uses JSON, and I am working on ACME coding to allow FireBricks to easily have Let's Encrypt certificates for https. So I start with a JSON library.
A good days work I think.