New Reflection-Based JSON Encoder/Decoder

BlitzMax Forums/BlitzMax Programming/New Reflection-Based JSON Encoder/Decoder

Tylerbot(Posted 2010) [#1]
http://code.google.com/p/bmx-rjson/

It is in a usable state, but type-specific metadata is still in the works. Includes very little documentation aside from the test suite at present.


ima747(Posted 2010) [#2]
Very cool, just about to start on a project where son may come into play so this could save me a LOT of time, can't wait to find time to play with it!


zambani(Posted 2010) [#3]
Thanks for the code. I'm also starting to use JSON. XML is a liitle hard on the eyes for me :-)


Czar Flavius(Posted 2010) [#4]
What is JSON?


Warpy(Posted 2010) [#5]
json.org

It's a very simple data exchange format. Think of it like a useful version of an .ini file.
The 'JS' is because it is also valid javascript code, so the idea was you would get a JSON string and eval() it to get the data structure automatically. It's so useful that people write encoders and decoders in other languages.


Htbaa(Posted 2010) [#6]
Cool. JSON is a very nice format. Seems more efficient than XML for serialization as well.

Just curious, but were you aware of cower.jonk (a JSON parser) and duct.json (a JSON handler for cower.jonk)?


zambani(Posted 2010) [#7]
@Htbaa
Thanks for the link to the parser.
I couldn't find any example in the files on how to use cower.jonk.
Do you know of any examples out there?

Last edited 2010


Htbaa(Posted 2010) [#8]
The Maximus client makes use of duct.json, which in turn uses cower.jonk. You could go from there I suppose.

For duct.json there's actually an example available.