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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 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 AD603BC69 for ; Thu, 15 Nov 2007 14:48:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAN7cO0eCcUBTnmdsb2JhbACPAAEBAQEHBAYRGA X-IronPort-AV: E=Sophos;i="4.21,420,1188770400"; d="scan'208";a="5849496" Received: from sigma957.cis.mcmaster.ca ([130.113.64.83]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Nov 2007 14:48:50 +0100 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.McMaster.CA [130.113.196.61]) by sigma957.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id lAFDmYeQ015063; Thu, 15 Nov 2007 08:48:44 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id lAFDmN5a021675; Thu, 15 Nov 2007 08:48:23 -0500 Received: from [99.235.248.61] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.3.12) with ESMTPSA id 192347168; Thu, 15 Nov 2007 08:48:24 -0500 Message-ID: <473C4E27.60506@mcmaster.ca> Date: Thu, 15 Nov 2007 08:48:23 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Vincent Hanquez Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Compiler feature - useful or not? References: <20071114075827.GA24058@yquem.inria.fr> <473B28DF.2050705@gmail.com> <20071115.091714.58364160.garrigue@math.nagoya-u.ac.jp> <473BE5DD.2000000@gmail.com> <20071115105320.GA29693@snarc.org> In-Reply-To: <20071115105320.GA29693@snarc.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 5.3.3.310218, Antispam-Engine: 2.5.2.313940, Antispam-Data: 2007.11.15.52310 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Spam: no; 0.00; compiler:01 camlp:01 ocaml:01 ocaml:01 camlp:01 edgar:98 hardcore:98 wrote:01 wrote:01 syntactic:01 syntactic:01 incompatible:01 caml-list:01 caml-list:01 purely:02 Vincent Hanquez wrote: > On Thu, Nov 15, 2007 at 12:23:25AM -0600, Edgar Friendly wrote: > >> But camlp4 holds back real development of the OCaml Community >> by dividing the language into incompatible splinter dialects or forcing >> us to code in pure OCaml which has little sugar. >> > > I'm glad that some people feels the same way about camlp4 ! > this is really sad, that people thinks camlp4 is a great idea ... > Come now, be fair, camlp4 has both advantages and disadvantages. Advantages: - Allows you to *prove* that some syntactic sugar can make a big difference in writing code. This is 2 orders of magnitude more effective in convincing people than just arguing for it (on caml-list, in person, whatever). Some extensions become popular because they have proved themselves this way. What is lacking is a process by which these can be integrated into the language. - Allows you to show that some boilerplate code can be eliminated. This is even better than the above, because every such instance is really a research problem in disguise: how does one design a type system that can show that this purely syntactic manipulation is correct? - Allows you to embed a DSL into OCaml with quite a bit of ease and freedom. One of the reasons to use campl4 instead of OCaml directly is that for embedding DSLs, it is very frequent that lazyness is needed, something less comfortable in OCaml. Disadvantages: - It splinters the language into dialects. - It makes errors in the source code of user programs difficult to track [anyone who has ever debugged camlp4-enabled programs have seen this] - Bugs in the extension itself are fantastically difficult to debug. Personally, I think the best situation would be if camlp4 were unnecessary. But there is a lot of PL research to be done before that's possible. And in the meantime, the extensions that people choose to write in camlp4 communicate very loudly what users of OCaml really want [as they are willing to put in serious effort into ``adapting'' the language to their needs]; when I used to be a language developer (on another system and, sadly, before I got proper training to do so), I weighted user requests by how much effort the user had put into the request. This annoyed loudmouths and pleased hardcore users, which seemed fine with me. Jacques