Hacker News new | ask | show | jobs
by WhitneyLand 1699 days ago
What would you have recommended instead of JSON?
3 comments

It's weird to put variable-length text-based serialization formats into something that has to perform in realtime no matter what, on potentially limited hardware.
I think JSON makes a lot of sense. It's just orders of magnitude more complex to parse into useful data structures than MIDI1, or any other part of MIDI2.

Since MIDI is already going the opposite direction of say AES67 and reinventing wheels is ok, a custom binary encoding would have made more sense to me. Something that can be encoded in a C89 struct without a ton of trouble or doesn't need much thought put into an allocator on bare metal devices to get the handshake working.

I believe it's not strictly JSON though, I don't have the docs in front of me but iirc strings have a max length. So that's good.

JSON feels like a terrible choice to me, especially on the latency aspect of things.
msgpack comes to mind...