Earlier quoted context omitted.
Actually sounds like an honest question to me.
"How hard is it" is sarcastic here.
Json vs. simplejson vs. ujson
71–75 of 75 posts
Re: Json vs. simplejson vs. ujson
#72Earlier quoted context omitted.
Fair enough. Although I'm not sure why one would want that behaviour given that there is no guarantee of ordering when a particular JSON file is processed with any other library.
I don't know what they do with it, but it's handy for writing tests against an expected JSON file: assert json.dumps(expected, sort_keys=True) == json.dumps(obj, sort_keys=True) # where expected was json.load()-ed and obj was produced by the function
Re: Json vs. simplejson vs. ujson
#73Earlier quoted context omitted.
I'm pretty sure symbols are not meant to be created from "user" input where user is untrusted, can't this lead to ddos atacks? Same thing for interning. De-Duping doesn't have that risk.
Lua has an interesting approach here. In Lua, all strings are interned. If you have "two" strings that consist of the same bytes, you are guaranteed that they have the same address and are the same object. Basically, every time a string is created from some operation, it's looked up in a hash table of the existing strings and if an identical one is found, that gets reused. However, that hash table stores weak referen…
You can discover what internal strings are held in a web application via a timing attack.
Better hope you never hold onto a reference to internal credentials inside the application! (Say... DB username / password? Passwords before they're hashed? Etc.)
Re: Json vs. simplejson vs. ujson
#74Earlier quoted context omitted.
At one point I looked into using it, but there werent any python bindings at the time, and I didnt have the time (for the project) to write any. Are there any good language libs for it these days?
Conveniently enough the first python extension landed in head 10 days ago: https://github.com/vstakhov/libucl/pull/68
Re: Json vs. simplejson vs. ujson
#75Earlier quoted context omitted.
Any particular reason to use this over YAML for configuration?
Macros seem to be the key distinguishing feature. It's a good idea, sort of borrowing from template engines.
Ansible combines YAML with jinja2 to do this type of stuff, for instance.
I'm not totally certain, but I think that might end up being simpler, more expressive and more powerful than this.