3 ms·
I just can’t imagine anyone who knows how to write assembly being one of the “JSON everything” people. But who knows. Not knocking JSON. Just thinking it would
by colejohnson66 6y ago
I just can’t imagine anyone who knows how to write assembly being one of the “JSON everything” people. But who knows.
Not knocking JSON. Just thinking it wouldn’t be the right thing for this situation.
- mpoteat 6y agoEnter a JSON wrapper format for specifying assembly applications, compete with a NodeJS transpiler toolchain a la Babel. Seriously though, it's been a while since I've had to work with assembly or IDA but JSON is great as an interoperable data format. Sure, it's not maximally efficient, but what needs to be?
- lambda_obrien 6y ago> it's not maximally efficient, what needs to be? I'm guessing most things written for a 6502
- QuesnayJr 6y agoEmacs had to add JSON parsing to its C core to get reasonable performance when using JSON for interprocess communication.
- nineteen999 6y agoWhat, you mean Emacs Lisp wasn't fast enough?
- userbinator 6y agoI agree, but unfortunately you sometimes don't get a choice of what the other end has created for you to consume.
- seibelj 6y agoIf it’s good enough and it’s what you need. Proper engineering doesn’t need to be maximally efficient, just adequate for the task at hand.
- colejohnson66 6y agoI get what you’re saying, but why would a (relatively) wasteful format such as JSON be used on a design using a 6502? Why not a binary one?
- goatlover 6y ago> Proper engineering doesn’t need to be maximally efficient, Until it does, like with limited hardware.
- KingOfCoders 6y agoI like JSON. I write Z80.
- magicalhippo 6y agoI have a few STM32 projects where I need bidir communication between the microcontroller and the PC. The microcontroller has on the order of 10-20kB of RAM total and around 100kB of Flash. After trying several other solutions I ended up with JSON over USB serial. I tried several of the binary JSON-like variants, but they were all a PITA to port or ended up eating a lot of space, either in RAM or Flash or both. For this project I wasn't too concerned about message size or performance as such, as long as it could be read or generated in small portions. I ended up adapting two JSON libraries, a one for parsing and for generating. The parser was SAX-like, so worked just fine for incremental parsing. Worked quite well, in total considerably smaller both in RAM and Flash than the alternatives.
- bradstewart 6y agoAn STM32 is several orders of magnitude more powerful than an 8051 (or a 6052) though.
- magicalhippo 6y agoSure but I wasn't after fast parsing, I was after a somewhat flexible data exchange format that didn't take a lot of space (both data and code), and ideally was easy to debug. A custom binary protocol would certainly be smaller but would take a lot more time to develop and debug.