From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D61EB7FA56 for ; Wed, 23 Jul 2014 11:55:05 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of whitequark@whitequark.org) identity=pra; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of whitequark@whitequark.org designates 176.58.103.125 as permitted sender) identity=mailfrom; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.whitequark.org) identity=helo; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="postmaster@mail.whitequark.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwFAJGFz1OwOmd9/2dsb2JhbABZg2BXrzIBAQEBAQEGgTqWZohpdoQxEQJTeUQIDIgyCZg3plMTBIV7g2WEXYErhDAFimCDZJhGiFCDSzgv X-IPAS-Result: AmwFAJGFz1OwOmd9/2dsb2JhbABZg2BXrzIBAQEBAQEGgTqWZohpdoQxEQJTeUQIDIgyCZg3plMTBIV7g2WEXYErhDAFimCDZJhGiFCDSzgv X-IronPort-AV: E=Sophos;i="5.01,716,1400018400"; d="scan'208";a="86619392" Received: from fehu.whitequark.org (HELO mail.whitequark.org) ([176.58.103.125]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Jul 2014 11:55:05 +0200 Received: by mail.whitequark.org (Postfix, from userid 33) id 6CB454D737; Wed, 23 Jul 2014 09:55:03 +0000 (UTC) To: caml-list@inria.fr X-PHP-Originating-Script: 1000:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 Jul 2014 13:55:03 +0400 From: Peter Zotov Message-ID: <0618b5ce9c054e91507c03eae7e7de0c@whitequark.org> X-Sender: whitequark@whitequark.org User-Agent: Roundcube Webmail/1.0.1 Subject: [Caml-list] [ANN] ppx_deriving 0.1 Hello, I'm glad to announce an initial release of ppx_deriving, a modular syntax extension for type-driven code generation. It will be shortly available in OPAM. I will introduce ppx_deriving with an example: # #require "ppx_deriving";; # type file = { kind : [ `File | `Dir ]; name : string; perm : int [@printer fun fmt -> Format.fprintf fmt "0o%03o"]; } [@@deriving Show, Eq];; type file = { kind : [ `Dir | `File ]; name : bytes; perm : int; } val pp_file : Format.formatter -> file -> unit = val show_file : file -> bytes = val equal_file : file -> file -> bool = # print_endline (show_file { kind = `Dir; name = "bin"; perm = 0o755 });; { kind = `Dir; name = "bin"; perm = 0o755 } - : unit = () A more thorough description is available in README[1]. While I intend this release to primarily serve as a preview for the community and a means to gather feedback, it is fully usable and documented. Some of the planned features (marked "TBD" in README) are not yet implemented. I hope that ppx_deriving can serve as a future replacement to both ocsigen's deriving and JaneStreet's type_conv. If you are responsible for these libraries, please get in touch. The OCaml ecosystem would benefit from a single type-driven code generation mechanism. I welcome any comments. [1]: https://github.com/whitequark/ppx_deriving/ -- Peter Zotov sip:whitequark@sipnet.ru