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 155BE7FD26 for ; Fri, 6 Nov 2015 13:55:15 +0100 (CET) IronPort-PHdr: 9a23:s+S48BYS6b3MTs413hkk2i//LSx+4OfEezUN459isYplN5qZpM26bnLW6fgltlLVR4KTs6sC0LqL9fi4EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35nxj7j60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYFYO+dbzuBLfYQyK73oaGiVKw1sbSzTCuVvBWZr+rjH9rq41/SiRPcT7Sfp8DTGj5KdiRRuukyAKOCIj93n/i8psgaYdqxWk8U9R2YnRNa6cPuB/c6eVRtgaSHBMRI4FWCVLGIKxa80UBOoMJ+tCh4b4rloK6xC5AF//V6vU1jZUiyqujuUB2OM7HFSDgVUt Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-ig0-f177.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.213.177 as permitted sender) identity=mailfrom; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; 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-ig0-f177.google.com) identity=helo; client-ip=209.85.213.177; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ig0-f177.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ABAgBTojxWm7HVVdFeg1o0bwauVoUxjAghhW8CgTIHPBABAQEBAQEBARABAQEBAQYLCwkhLoIugggBAQMBEhEdAQgTEgsBAwELBgUEBxodAgIiAREBBQEKEgYTCAoQh3YBAwoIDaJagTE+MYtIgWqCeYZ+ChknAwpWg2gBAQEBAQEEAQEBAQEBAQEVAQUOhkaEfoQ1U4JtgUQFhgsMkDGFHYgIgiSYUxIkgRcRJ4IvI4FePTSDS4FJAQEB X-IPAS-Result: A0ABAgBTojxWm7HVVdFeg1o0bwauVoUxjAghhW8CgTIHPBABAQEBAQEBARABAQEBAQYLCwkhLoIugggBAQMBEhEdAQgTEgsBAwELBgUEBxodAgIiAREBBQEKEgYTCAoQh3YBAwoIDaJagTE+MYtIgWqCeYZ+ChknAwpWg2gBAQEBAQEEAQEBAQEBAQEVAQUOhkaEfoQ1U4JtgUQFhgsMkDGFHYgIgiSYUxIkgRcRJ4IvI4FePTSDS4FJAQEB X-IronPort-AV: E=Sophos;i="5.20,252,1444687200"; d="scan'208";a="186393295" Received: from mail-ig0-f177.google.com ([209.85.213.177]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 06 Nov 2015 13:55:14 +0100 Received: by igbhv6 with SMTP id hv6so32993174igb.0 for ; Fri, 06 Nov 2015 04:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=LMDDtYnpkyyrrWqT7qfCS69Bp9xHK5UcWprLksuGJU8=; b=d0otmo4oyhoXWWLzn8WNQwi2DLLgU1LMJjLorwiKNJ4oH5VT0PhjQgd9ALoamn+Pba fFr/AoS8zAo5NZww6KkboiAe7w4CBrhhWlRTV17Ij7fcIiYd5wq26mOO/HMtuhj9Ieup OwB9iYzyvyZ91nYelJvnnA8bsd2WHv299woNDfrWQkpfMpskWt0oau+rRtin/tvZazqE Y/t5t2FxDX29JWSbTbG+oK5tLOlb2MSUrKnbF+McH/5okxAZjJl/GEd1A22rTi6NFRlV qmhZ6sMleh1caEQbpVt5wbTVJESGu3PHf2V2f+Tyada6gUKuQUKMVTH7IGca0nLoOugG bN4A== X-Received: by 10.50.155.74 with SMTP id vu10mr8287412igb.50.1446814512808; Fri, 06 Nov 2015 04:55:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.39.200 with HTTP; Fri, 6 Nov 2015 04:54:33 -0800 (PST) In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E11A@IRSMSX102.ger.corp.intel.com> References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E070@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E11A@IRSMSX102.ger.corp.intel.com> From: Gabriel Scherer Date: Fri, 6 Nov 2015 13:54:33 +0100 Message-ID: To: "Soegtrop, Michael" Cc: Jonas Jensen , "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a1134958017873d0523dec101 Subject: Re: [Caml-list] Newbie comment on constructor syntax --001a1134958017873d0523dec101 Content-Type: text/plain; charset=UTF-8 The implementation technique used by Jun Furuse is to duplicate the implementation of the type-checker, and change only the parts that type-check constructor applications. This is the least-constraining way to write type-aware transformations as ppx extensions. A more concise way is to call compiler-libs for type-checking and postprocess the resulting typed AST, but this is only reasonable if the input source is expected to be well-typed. (There are few limit on the kind of transformations you can do if you are, in fact, willing to fork the compiler codebase if necessary. But, as Jonas Jensen mentioned, this is "adventurous" indeed.) On Fri, Nov 6, 2015 at 1:46 PM, Soegtrop, Michael < michael.soegtrop@intel.com> wrote: > Dear Jonas, > > thanks for the link! It is interesting that others feel enough pain to > write 200k of code to get a nicer and more flexible constructor syntax. > Also interesting that it takes > 200k of code to do this even with ppx. And > I am not sure if this would works for matches - at least there are none in > the test files. For sure I need to gather a bit more experience before I > dig into this. > > Best regards, > > Michael > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Christian Lamprechter > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a1134958017873d0523dec101 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The implementation technique used by Jun Furuse is to= duplicate the implementation of the type-checker, and change only the part= s that type-check constructor applications. This is the least-constraining = way to write type-aware transformations as ppx extensions. A more concise w= ay is to call compiler-libs for type-checking and postprocess the resulting= typed AST, but this is only reasonable if the input source is expected to = be well-typed.

(There are few limit on the kind of transf= ormations you can do if you are, in fact, willing to fork the compiler code= base if necessary. But, as Jonas Jensen mentioned, this is "adventurou= s" indeed.)

On Fri, Nov 6, 2015 at 1:46 PM, Soegtrop, Michael <michael.soegtrop@intel.com> wrote:
Dear Jonas,

thanks for the link! It is interesting that others feel enough pain to writ= e 200k of code to get a nicer and more flexible constructor syntax. Also in= teresting that it takes > 200k of code to do this even with ppx. And I a= m not sure if this would works for matches - at least there are none in the= test files. For sure I need to gather a bit more experience before I dig i= nto this.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89= 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a1134958017873d0523dec101--