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.5 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5B604BC69 for ; Fri, 9 Mar 2007 08:23:47 +0100 (CET) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.187]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l297NkeK007788 for ; Fri, 9 Mar 2007 08:23:47 +0100 Received: by mu-out-0910.google.com with SMTP id w9so888471mue for ; Thu, 08 Mar 2007 23:23:46 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mIqRp5LzN7KDd44jufnyiqCCzFZIfh+VBOxJ+8aos0KhxWLWDbwfalewgmm2hOBrj/nLOabO49Ft6ciqHMnwWjxsYSNrY2Mb+wt9EmYdsfByKAw7MGOAVROAydjLzvgYRCVOsem8YXd0tnaQr1W5pM+Qt7ZlZTXepUtmMTOlnmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=c+P7eYLowFbe1E+O3lPcxGlIk3f6l71zrn121cf42ObsNv26T0dgNv10FS0IT9Z+c58UYf9bBqQIv8749YYWSyTaWm4LsVwWmHpKAiKwWpZaKjfcH/+APXrI0PuyZ1KrxMxZn00/YvK0WfowLFsnKuB2xZ1TNllI2QDQEsi5/9M= Received: by 10.82.163.13 with SMTP id l13mr2155308bue.1173425026614; Thu, 08 Mar 2007 23:23:46 -0800 (PST) Received: by 10.82.100.16 with HTTP; Thu, 8 Mar 2007 23:23:46 -0800 (PST) Message-ID: Date: Fri, 9 Mar 2007 08:23:46 +0100 From: Tom To: skaller Subject: Re: [Caml-list] Operator overloading Cc: "Robert Fischer" , caml-list@yquem.inria.fr In-Reply-To: <1173397864.6613.49.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_212827_26766663.1173425026564" References: <3D1E4D9CA9BCE04D8F2B55F203AE4CE30666AB74@selma.roomandboard.com> <1173397864.6613.49.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 45F10B82.002 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45F10B82.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; overloading:01 ocaml:01 functors:01 overloading:01 vectors:01 matrices:01 axioms:01 ocaml:01 abstraction:01 compiler:01 functors:01 vectors:01 matrices:01 axioms:01 abstraction:01 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_212827_26766663.1173425026564 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 09/03/07, skaller wrote: > > > BOTH Ocaml functors and overloading are just hacks to > work around the lack of ability to properly express > higher order natural transformations. Hm... indeed, but for some operations, you cannot provide a single, general definition - say for length operation, or for * (* is very different when it comes to scalars, vectors and matrices - not even the same axioms hold). I believe that the basic operations should be implemented using overloading (actually, some smart overloading that would allow both static and (seemingly) dynamic resolving) and then polyadic operations be built on top of that. For systems like Ocaml, you need a mix of sloppiness > and heavy typing, because unless you're implementing > a well understood mathematical formalism, too much > formality and abstraction just gets in the way. > > For example if you were implementing a C++ compiler in Ocaml > I'm going to bet you'd want plenty of space to fiddle with > your representations and concepts, because you don't quite > know what it is you're actually implementing. > I have a feeling what you say here is important, yet I don't quite understand it... Can you clarify it ang give an example? And how (in your opinion) can this problem be solved? - Tom ------=_Part_212827_26766663.1173425026564 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 09/03/07, skaller <skaller@users.sourceforge.net> wrote:

BOTH Ocaml functors and overloading are just hacks to
work around the lack of ability to properly express
higher order natural transformations.

 Hm... indeed, but for some operations, you cannot provide a single, general definition - say for length operation, or for * (* is very different when it comes to scalars, vectors and matrices - not even the same axioms hold). I believe that the basic operations should be implemented using overloading (actually, some smart overloading that would allow both static and (seemingly) dynamic resolving) and then polyadic operations be built on top of that.

For systems like Ocaml, you need a mix of sloppiness
and heavy typing, because unless you're implementing
a well understood mathematical formalism, too much
formality and abstraction just gets in the way.

For example if you were implementing a C++ compiler in Ocaml
I'm going to bet you'd want plenty of space to fiddle with
your representations and concepts, because you don't quite
know what it is you're actually implementing.

I have a feeling what you say here is important, yet I don't quite understand it... Can you clarify it ang give an example? And how (in your opinion) can this problem be solved?

- Tom

------=_Part_212827_26766663.1173425026564--