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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 2590D7ED26 for ; Mon, 28 May 2012 17:55:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0HAN2ew09QW+UDgGdsb2JhbABFhTKvBgSBIyIBARQoJ4IXAQEEASMPATocCxoCBRMOAgIPAQQoGxmIBgUEpWWSFoEkihmBb4IEgRIDiD+fRw X-IronPort-AV: E=Sophos;i="4.75,671,1330902000"; d="scan'208";a="160265173" Received: from plane.gmane.org ([80.91.229.3]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 28 May 2012 17:55:12 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SZ2Hi-0003i9-IQ for caml-list@inria.fr; Mon, 28 May 2012 17:55:06 +0200 Received: from pse.psellos.com ([174.121.218.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 May 2012 17:55:06 +0200 Received: from jeffsco by pse.psellos.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 May 2012 17:55:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Jeffrey Scofield Date: 28 May 2012 10:52:06 -0500 Message-ID: References: <4FC26FDD.9010407@gmail.com> <71FFF6A2CF1E4E6DA0FFF397B2084B89@erratique.ch> <9B6D7FCED63545E2BB3F0DDD7B337AA1@erratique.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pse.psellos.com User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-Validation-by: jeffsco@psellos.com Subject: [Caml-list] Re: Syntax extensions without Camlp4 Daniel Bünzli writes: > > The problem is that it's purely for partial evaluation and not > > extending the syntax. > > Then it's perfect ! I think it's wrong to try to extend the language > per se. Most of the time, except for very particular things > (e.g. introducing a monad notation), the dsl approach is perfectly > sufficient. Don't think you absolutely need to extend the OCaml > grammar, embed your dsl directly into OCaml, using OCaml language > binders if you need variables. > > Make libraries, not pet syntactic constructs. For what it's worth, I heartily endorse this approach. Use of campl4 when something simpler will do is a real burden on people learning the language and people combining modules. OCaml has already fragmented into two different syntaxes, and I've already chosen to hack several different modules for my own use by stripping out all the syntax extensions. In the long run this doesn't scale very well (in my opinion). The baseline for OCaml is already a large (rich, complex, amazing) language. But it's hard to pitch it to potential adopters if it's also a rapidly moving and ramifying target. (I should say that the syntactic flexibility is fantastic for language researchers, it's users who are solving practical problems with the language that I'm talking about. I would put myself in this category.) Just my opinion. Jeffrey Scofield Seattle