From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0AE8CBB84 for ; Thu, 18 May 2006 20:53:11 +0200 (CEST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4IIrA3U020928 for ; Thu, 18 May 2006 20:53:10 +0200 Received: from [130.113.68.27] (account carette@univmail.cis.mcmaster.ca [130.113.68.27] verified) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP id 126583403; Thu, 18 May 2006 14:53:09 -0400 Message-ID: <446CC2C1.5040801@mcmaster.ca> Date: Thu, 18 May 2006 14:53:53 -0400 From: Jacques Carette Organization: McMaster University User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: skaller Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] compiler bug? References: <20060517231426.30289.qmail@web32203.mail.mud.yahoo.com> <446CABCA.8000906@inria.fr> <446CB021.6000009@mcmaster.ca> <1147976357.25630.27.camel@rosella.wigram> In-Reply-To: <1147976357.25630.27.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 446CC296.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 bug:01 inlining:01 trivial:01 compiler:01 haskell:01 untyped:01 ocaml:01 statically:01 metaocaml:01 statically:01 untyped:01 wrote:01 caml-list:01 syntactic:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 skaller wrote: >What about high level optimisations? > >Felix supports this: > > reduce revrev[t] (x:list[t]): rev (rev x) => x; > >which, combined with inlining, removes adjacent list reversals. >This is a fairly trivial example of integrating logic with >programming as a way of achieving both correctness and >performance: the reduction above provides both semantic >knowledge to the reader as well as allowing the compiler >to generate better code. > > Haskell (GHC to be precise) allows that too. But is syntactic term-rewriting, in other words it is *untyped*. Ocaml is great because it is statically typed. MetaOCaml is wonderful because it is statically typed. Adding an untyped layer to a typed language seems like a definite step backwards (i.e. a hack).. Jacques