4 ms·
Kinda misleading title, because if you take a look at the code: https://github.com/ppelleti/json65/tree/master/src https://github.com/ppelleti/json65/tree/maste
by anta40 6y ago
Kinda misleading title, because if you take a look at the code:
https://github.com/ppelleti/json65/tree/master/src https://github.com/ppelleti/json65/tree/master/src
It's only the core (https://github.com/ppelleti/json65/blob/master/src/json65.s https://github.com/ppelleti/json65/blob/master/src/json65.s) which is written in asm. The rest are C.
Seems neat anyway, let's fire a 6502 emulator :)
- lifthrasiir 6y agoThe leading paragraph mentions "It's time to write a JSON parser in 6502 assembly language?" so I figured out everything in C is supplementary ;-)
- RantyDave 6y agoCame here to say that. Also we have cbor which is "json for embedded". But, hey! it's still pretty hardcore. Not something I'd be doing.
- uKVZe85V 6y agoAccording to github https://github.com/ppelleti/json65 https://github.com/ppelleti/json65 C 47.1%, Assembly 40.4%, Perl 9.4%, Haskell 3.1%. Yes, it actually contains perl and haskell code [0]. [0]: https://github.com/ppelleti/json65/blob/master/run-tests.pl https://github.com/ppelleti/json65/blob/master/run-tests.pl https://github.com/ppelleti/json65/tree/master/tools https://github.com/ppelleti/json65/tree/master/tools
- naters 6y agoThe "Library organization" section [1] explains that the json65.s file is the core of the library and the only code necessary to build the library. The additional C code provides a handy tree structure and a callback to pass to the parsing engine. However, because SAX is a callback-oriented parsing method, you can design your own data structure and write your own callback functions and do without this tree structure. The additional C code provides similar nice-to-haves, such as string pool interning, a function to print out the aforementioned tree structure, and a wrapper function to parse json from a file. [1] https://github.com/ppelleti/json65#library-organization https://github.com/ppelleti/json65#library-organization
- boomlinde 6y agoIt's not misleading. It's a JSON parser written in 6502 assembly language. The C stuff is just things you may or may not want to do with a JSON parser (json65-file.c to parse the content of a given FILE, json65-tree.c to deserialize JSON into a tree data structure).