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=AWL,SUBJECT_EXCESS_QP 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 C55A3BC6B for ; Tue, 11 Dec 2007 00:38:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAC5cXUfUnw6Eg2dsb2JhbACCOI0tAQEBCAQGIgc X-IronPort-AV: E=Sophos;i="4.24,148,1196636400"; d="scan'208";a="20185213" Received: from pih-relay05.plus.net ([212.159.14.132]) by mail4-smtp-sop.national.inria.fr with ESMTP; 11 Dec 2007 00:38:52 +0100 Received: from [80.229.56.224] (helo=beast.local) by pih-relay05.plus.net with esmtp (Exim) id 1J1sD5-0000c5-CA for caml-list@yquem.inria.fr; Mon, 10 Dec 2007 23:38:51 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ask for a more efficient way to =?iso-8859-1?q?deallocate=09memory=09?=(full version) Date: Mon, 10 Dec 2007 23:29:42 +0000 User-Agent: KMail/1.9.5 References: <39980.81.57.198.61.1197236388.squirrel@webmail.lpn.cnrs.fr> <1197324811.475dba0b8c26d@webmail.in-berlin.de> <200712102259.30602.jon@ffconsultancy.com> In-Reply-To: <200712102259.30602.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712102329.42186.jon@ffconsultancy.com> X-Spam: no; 0.00; bandel:01 ocaml:01 ocaml:01 camlp:01 compiler:01 hand-written:01 camlp:01 compiler:01 top-down:01 recursive:01 bottom-up:01 lalr:01 frog:98 wrote:01 wrote:01 On Monday 10 December 2007 22:59, Jon Harrop wrote: > On Monday 10 December 2007 22:13, Oliver Bandel wrote: > > Because I don't know how it's implemented, I don't know if this adds a > > performance lack. But possibly it would make sense to look at it closer > > to explore it's advantages and disadvantages... > > ...but I've no experience in OCaml extension, so I hope someone here can > > say some wprds about it. > > OCaml has a great macro system called camlp4 that lets you add new > syntactic constructs and rewrite OCaml code at will. So Martin's code adds > a new syntactic construct and automatically injects the code for the > compiler that we must currently write by hand. Consequently, its > performance will be superb: as good as hand-written OCaml code. > > However, using any camlp4 macros requires using the camlp4 replacement for > the front-end of the compiler. That uses a different parsing technology > (top-down recursive descent LL rather than bottom-up LALR) so the error > messages from the compiler are completely different. Incidentally, the single biggest disadvantage of adding syntactic constructs like this using macros is that your code will no longer autoindent properly. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e