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 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 911E7BC69 for ; Fri, 9 Mar 2007 13:46:25 +0100 (CET) Received: from sigma957.cis.mcmaster.ca (sigma957.CIS.McMaster.CA [130.113.64.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l29CkOxa018984 for ; Fri, 9 Mar 2007 13:46:25 +0100 Received: from Dura7.UTS.McMaster.CA (dura7.UTS.mcmaster.ca [130.113.196.62]) by sigma957.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id l29CkCgr005226; Fri, 9 Mar 2007 07:46:21 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Dura7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id l29Cjqal022054; Fri, 9 Mar 2007 07:45:52 -0500 Received: from [74.109.166.109] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 165521243; Fri, 09 Mar 2007 07:45:52 -0500 Message-ID: <45F15782.3010406@mcmaster.ca> Date: Fri, 09 Mar 2007 07:48:02 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Andrej.Bauer@andrej.com Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Operator overloading References: <3D1E4D9CA9BCE04D8F2B55F203AE4CE30666AB74@selma.roomandboard.com> <45F14E4E.6040200@fmf.uni-lj.si> In-Reply-To: <45F14E4E.6040200@fmf.uni-lj.si> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2007.3.9.41434 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-Miltered: at concorde with ID 45F15720.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; overloading:01 andrej:01 overloading:01 vectors:01 matrices:01 toplevel:01 ambiguities:01 algebra:01 toplevel:01 computations:01 predictable:01 catch-all:01 wrote:01 caml-list:01 matlab:01 Andrej Bauer wrote: > I will repeat my suggestion again: when writing serious and > complicated code, overloading can cause a lot of harm. When > manipulating expressions such as vectors and matrices interactively, > it is convenient to have overloaded + etc. Perhaps the right way to > solve the dilemma is to have a "toplevel on streoids" which > intelligently resolves ambiguities. The intelligence can then go much > further than simple overloading. The (heavily typed) computer algebra system Axiom tried just this. The end result was that, frequently, 90% of the computation time was spent in the "toplevel guesser", 10% on the actual computation. Much worse was that while the underlying computations were very predictable (types help), the toplevel was so huge and complex, that it was unpredictable what *it* would do. And, worse, lots and lots of "types" now resolved to the catch-all 'Expression' type. Note however that Matlab also has its share of massive overloading, and yet it doesn't suffer as much as Mathematica does from this. So there must be something about the richness of the available data-structures that makes the Matlab approach 'fail'. Jacques