[Ur] How to design JSON interface?

Marc Weber marco-oweber at gmx.de
Wed Dec 1 10:24:33 EST 2010


Excerpts from Adam Chlipala's message of Wed Dec 01 15:46:45 +0100 2010:
> I'm sorry if I didn't say this clearly before: The way I would implement 
> this involves modifying the compiler in a not especially modular way.  
> This would naturally be a mirror of the current support for encoding 
> arbitrary values into URLs with the new format I made up.  I'll be very 
> impressed if you're able to figure out how to implement this.
Yeah - we all already know this: Reading code takes about 1/2 the time
of writing it. And urweb is non trivial code. So it would take me very
much time to get it done if I suceedede at all (I would not - I would
run out of money) - That's why I asked. I don't even have smlnj yet.
Its on my TODO list though.

Anyway: someone else wants to support yaml - what to do then? Do you
want him to wait for you implementing native yaml support?

There are many different protocols out there - eg databases are not the
only storage facilities. So learning how to encode / decode foreign
formats within urweb is essential.

> I still don't understand yet why you want JSON.  Can you explain?  Maybe 
> I can talk you out of it. :-)
Today its hard to make a project successful unless you create interfaces
for others to join or use a service. JSON is a very easy format which is
implemented in all languages I know. If you ever have tried creating
xmlrpc stuff you know that generating JSON can be simpler. So I want to
use it for two reasons:
- interface with external applications (because I don't know urweb
  enough to recode everything in it)
- provide interfaces for other users. Letting users do what they want
  can be a way to be successful.
 
> Yes, though this particular case would be easy to implement in Ur code.  
> The issue is just with automatic, generic handling of records and datatypes.
 
> I mask out the tests when building distributions for a reason: a lot of 
> them don't compile anymore. :-)
I learned something from them. Its worth keeping them up to date. There
is not much ur code at the momemnt. If you understand all test
cases you know that you learned something about a language.
(This worked fine when learning about Nix)
Eg I learned this that you can use sig after structure:

 structure ... : sig .. end
 end

Marc Weber



More information about the Ur mailing list