From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id AAD05BBAF for ; Mon, 1 Jun 2009 01:08:43 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYPAK+qIkpDww+XdWdsb2JhbACQTIEmhiUBDAoLBxGjCYEUjXwBBQMBhAgF X-IronPort-AV: E=Sophos;i="4.41,280,1241388000"; d="scan'208";a="40861428" Received: from web111504.mail.gq1.yahoo.com ([67.195.15.151]) by mail4-smtp-sop.national.inria.fr with SMTP; 01 Jun 2009 01:08:41 +0200 Received: (qmail 98647 invoked by uid 60001); 31 May 2009 23:08:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1243811320; bh=GInTsiCVYDv+1kRx4YsommjMp7gKLDiX4M9OFtPzIns=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MY4A74je9wcY8KEHhlGDbEYQX9foP9dQbXbb7T87VvdPy7EaVEmVTLONx6PJ2oJ4XQn72zYwosMBlKFtMzH2R1ew80ys908TvC9PI8hHVf7W14Qxc49PukbInzWGSR8v2ooevwFuXu9OQHwTEC8GghCtFcWFCX5VKdiOB37IyYM= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=fhuTkEGblxq5RAp7D+yLec3CrcEux/eCLujgfMbFVLLy8PGexFAR4nfC1OXaG4hKBWrwu822mY0gyIsqs0yMbt3136yfjLlcV/ld/1g5pfSvZ/dvLF+YXGSZAKXOJP8OlYa48UAzDyVcITyUaRrs2R7AHyZSqrS0MxjThwEGgIA=; Message-ID: <411083.97835.qm@web111504.mail.gq1.yahoo.com> X-YMail-OSG: IMWeWcsVM1nyjkq63ZhYvyHIRi1Uq8fLvLH3rdGMITkRQCqlfjYwzccOpcey5lPraofFBbrK0Kscc23Fmgkh9zsAOPgTql4HV9beC9qd_8e9z3dimBHA8d4SX_C0_QB2.eGs6cbC2XY5EcnAioqVi.8pZNPevc9OkR3IAO8OVIIlYPtrZQ0kq5m.bKqq8j4rO3gD7VbJIw4p49wkRkAN3O3Qr0Yr8Sqa.cLzLFrLkmoQ1HEjNcLGBlsMVEBXWLh0xgE9TRwuNEQKzSErQt1DMGZTMmuLbyhOV.P5Ln.XE1aBPtnclLrFixk- Received: from [213.205.71.53] by web111504.mail.gq1.yahoo.com via HTTP; Sun, 31 May 2009 16:08:40 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Sun, 31 May 2009 16:08:40 -0700 (PDT) From: Dario Teixeira Subject: RE: [Caml-list] Width subtyping To: David Allsopp Cc: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; subtyping:01 syntax:01 runtime:01 variants:01 subtyping:01 compile-time:01 camlp:01 ocaml:01 cheers:01 polymorphic:01 ideally:01 syntactic:01 caml-list:01 variant:02 width:97 Hi,=0A=0A> > Heavier in terms of efficiency, or syntax?=0A>=0A> My concern = is the former. The extra two fields per "record" and the heavier=0A> runtim= e calls make them so systemically slower that (to me, at least) it=0A> just= feels "wrong" to use objects just to achieve a little syntactic clarity=0A= > and a small reduction in the amount of code written. Polymorphic variants= =0A> (which use only slightly more memory than regular variant values) othe= rwise=0A> perform at the same speed as their normal counterparts.=0A=0AI al= so meant "heavier" in terms of efficiency. And like David said, it does=0A= feel wrong to carry the performance penalty of the object system solely bec= ause=0AI need the structural subtyping features. Ideally, what I should be= using=0Ais "record subtyping": something along the lines of the Polymap ex= tension=0A(which I advise everyone to take a look at), but with compile-tim= e checking.=0A=0AHowever, my guess is that proper record subtyping cannot b= e tacked onto the=0Alanguage by means of Camlp4, and it probably needs to b= e a builtin feature=0A(though I would gladly be proven wrong). Which leads= to the obvious question:=0Ais there any theoretical reason why record subt= yping is not available in Ocaml?=0AOr is the answer simply "just use the ob= ject system; it's not as heavy as you=0Athink it is"?...=0A=0ACheers,=0ADar= io Teixeira=0A=0A=0A=0A