News for hackers. Stuff that matters.
Re:Why Python Pickle is Inscecure by euroclydon on Wednesday September 09, 2009 @12:37PM (#813449)
What's up with YAML? Doesn't Google use it extensively? Is it a better alternative than JSON even if you are sending serialized data from the Javascript in the browser to the web server and back?
Re:Why Python Pickle is Inscecure by rcoder on Wednesday September 09, 2009 @12:57PM (#813504)
YAML is strictly a superset of JSON in its expressiveness, since it allows tagging of serialized objects with a type name. JSON reduces everything to maps, arrays, and scalars, so any type information has to be encoded in (or inferred from) the structures themselves. I also find it to be a bit easier to read, and so prefer it for configuration files or console dumps of data structures.

However, YAML isn't quite as well-supported in the standard libraries of various programming languages, most notably Javascript. Which one to use depends largely on how heavily you expect browsers to consume your service output.

Re:Why Python Pickle is Inscecure by tptacek on Wednesday September 09, 2009 @12:54PM (#813496)
Almost any format is superior to Pickle or Marshal for interchange.
Re:Why Python Pickle is Inscecure by drawkbox on Wednesday September 09, 2009 @05:44PM (#814044)
If you are passing around data from Python, to Javascript to even Flash, JSON is the best. Minimized parsing, smaller subset of YAML and KISS methodology. It doesn't have the verboseness problems that xml has but isn't as compact as binary data. But JSON converts to javascript, actionscript and python objects with almost no effort. It is actually not bad as a socket messaging format over xml or binary as well.