[Ur] How to design JSON interface?

Marc Weber marco-oweber at gmx.de
Thu Dec 2 16:34:41 EST 2010


Excerpts from Adam Chlipala's message of Thu Dec 02 19:03:17 +0100 2010:
> This isn't the kind of recursion I meant.  In the world of type theory, 
> a "recursive type" is a type defined in terms of itself.  Lists are a 
There are only objects (= dictionaries or hashes) and arrays (which you
translate to lists) and primitive types (int, string, bool).
So you can't perform better that what you've done.

Your library seems to work perfectly. You did exactly what I had in
mind. Do you mind making the repo public?
Maybe add it to this list (I'm going to add a link to the main Ur page
soon. Somehow I failed doing so at the beginning)
http://impredicative.com/wiki/index.php/Libraries_and_FFI_bindings

How efficient are those escape / unescape functions compared to plain C
functions ? Does it make sense to code them in C ?
Calling substring for each space could be inefficient.

I had in mind doing the parsing in C, building up a tree of structs.
Then use ur for checking that all object members exist etc only.
For now its fine.

Thank you very much for this example!

Marc Weber



More information about the Ur mailing list