From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 6DEA5BBAF for ; Mon, 20 Dec 2010 13:47:01 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AngAAFvfDk1CbwQbkGdsb2JhbACkIxUBAQEBCQkMBxEEIL1HBYVKhGmGHIMX X-IronPort-AV: E=Sophos;i="4.60,202,1291590000"; d="scan'208";a="71149940" Received: from out3.smtp.messagingengine.com ([66.111.4.27]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 20 Dec 2010 13:47:00 +0100 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 93FE6375 for ; Mon, 20 Dec 2010 07:46:59 -0500 (EST) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 20 Dec 2010 07:46:59 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:subject:content-type:content-transfer-encoding; s=smtpout; bh=PDhTqsdsiDFeaEa3rEYzWkbAPZg=; b=m4o7T05bKE/Hf7oCCjbRrn6Bh/urhkLllLdFiC2IfhasEDdKGNgJBhi0ajMcXK5WNuOEryJxeeIiytUMTDqYvSU37mCxrDx1MCiDnv1dqC9eZTHfdW0qZIzhdYdQGpzwjBjXLUV1hFVzc4cAwwdc5B1VVSWCr5buGd6z5siZLb8= X-Sasl-enc: tXiTsiEjmGXSRwIdvEiR9GF7vsCDHtWLry6xYazSchNc 1292849219 Received: from [192.168.2.4] (c-98-248-39-171.hsd1.ca.comcast.net [98.248.39.171]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3096740B11C for ; Mon, 20 Dec 2010 07:46:59 -0500 (EST) Message-ID: <4D0F5055.8060007@mylife.com> Date: Mon, 20 Dec 2010 04:47:17 -0800 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20101023 Lightning/1.0b3pre Thunderbird/3.1.3 MIME-Version: 1.0 To: OCaml Mailing List Subject: [ANN] Atdgen/Biniou with support for cyclic values Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 syntax:01 node:01 node:01 printf:01 printf:01 endline:01 ocamlfind:01 mli:01 -package:01 -linkpkg:01 hash:01 hash:01 026:98 021:98 Hi list, Atdgen is a tool that produces OCaml serializers and deserializers from type definitions in the ATD syntax. Two serialization formats are supported: JSON and Biniou. For more information on the project, see http://martin.jambon.free.fr/atd-biniou-intro.html The main highlight of this release (1.1.0) is support for sharing, which allows the serialization of cyclic values such as graphs. Sharing is currently supported for the Biniou format only and requires extra wrapping using type ref for non-record types. The other new features are listed here: http://oss.wink.com/atdgen/atdgen-1.1.0/Changes.txt Example: $ cat cycle.atd type shared_node = node shared (* sharing point *) type node = { label : string; self : shared_node; } $ cat test_cycle.ml open Cycle let () = let rec a = { label = "A"; self = a } in let s = string_of_shared_node a in Printf.printf "%i %S\n" (String.length s) s; let a' = shared_node_of_string s in assert (a != a'); assert (a == a.self); assert (a' == a'.self); print_endline "Success" $ atdgen cycle.atd $ ocamlfind opt -o test_cycle \ graph.mli graph.ml test_cycle.ml \ -package atdgen -linkpkg $ ./test_cycle 17 "\026\000\021\002\239\175\r\244\018\001A\204P\139\140\026\015" Success Dissection of the serialized value: \026 shared_tag \000 0 indicates that the value follows \021 record_tag \002 field count \239\175\r\244 hash("label") \018 string_tag \001 string length A string contents \204P\139\140 hash("self") \026 shared_tag \015 find value 15 bytes backward The Biniou format is fully described here: http://martin.jambon.free.fr/biniou-format.txt Home of each project: http://martin.jambon.free.fr/biniou.html http://martin.jambon.free.fr/yojson.html http://oss.wink.com/atd/ http://oss.wink.com/atdgen/ Non-interactive installation with Godi: $ godi_console update $ godi_console perform -build godi-atdgen Each of these four projects are distributed under a BSD license. Biniou (c) 2010 Martin Jambon Yojson (c) 2010 Martin Jambon Atd (c) 2010 MyLife Atdgen (c) 2010 MyLife Enjoy. Martin