caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Announcing json-static: syntax magic for JSON
@ 2007-01-21  3:00 Martin Jambon
  0 siblings, 0 replies; only message in thread
From: Martin Jambon @ 2007-01-21  3:00 UTC (permalink / raw)
  To: caml-list

Hello,

I am releasing a syntax extension which translates quasi-OCaml type 
definitions into converters from/to generic JSON data:

   http://martin.jambon.free.fr/json-static.html
   (version 0.9.0, BSD license)

JSON (JavaScript Object Notation) is a language-neutral data format, which 
is readily available in JavaScript, but also for many other 
programming languages thanks to its simplicity.

This tool uses the json-wheel library that Mika Illouz and myself released 
a few weeks ago. Using the json-static facility is not mandatory at all, 
but it can be a timesaver.

For example, the following declaration defines the type of a point object:

   type json point = < x: float; y: float >

This automatically makes two functions available, with the following 
signature:

   val json_of_point : point -> Json_type.t
   val point_of_json : Json_type.t -> point

Json_type.t is the type of any JSON data, as defined by the json-wheel 
library.

A typical use of this library is illustrated by an HTTP client that 
queries a web service which returns JSON data. There is an example of a 
program that queries Yahoo!'s JSON web service:

   http://martin.jambon.free.fr/yahoo.ml.html



Martin

--
Martin Jambon
http://martin.jambon.free.fr


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-21  3:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-21  3:00 Announcing json-static: syntax magic for JSON Martin Jambon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).