From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 7BE22BC8B for ; Sat, 12 Feb 2005 17:11:30 +0100 (CET) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1CGBT24029182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 12 Feb 2005 17:11:30 +0100 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id AE10720014; Sat, 12 Feb 2005 17:11:29 +0100 (CET) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11297-02-41; Sat, 12 Feb 2005 17:11:27 +0100 (CET) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id B6AB620010; Sat, 12 Feb 2005 17:11:27 +0100 (CET) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 5AFF726E87; Sat, 12 Feb 2005 17:11:27 +0100 (CET) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 9D4B33CBC; Sat, 12 Feb 2005 17:11:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 9B00F2D713; Sat, 12 Feb 2005 17:11:20 +0100 (CET) Date: Sat, 12 Feb 2005 17:11:20 +0100 (CET) From: Thomas Fischbacher To: Brian Hurt Cc: Michael Walter , skaller , Jon , caml-list@yquem.inria.fr Subject: Re: [Caml-list] The boon of static type checking In-Reply-To: Message-ID: References: X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at concorde with ID 420E2AB1.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 inlined:01 usefullness:01 inlining:01 innate:98 1,000:98 cip:98 cip:98 lambda:01 lambda:01 integer:01 interactions:01 interactions:01 functions:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Sat, 12 Feb 2005, Brian Hurt wrote: > And I disbeleive the "makes it easier with large programs" statement. > It's contrary to all evidence I've seen, and all my experience. The > complexity of a program is, I've postulated, a function of the number of > interactions between different parts of the code. And that therefor the > innate complexity approximately scales with the square of the number of > lines of code- so a 10,000 line program is 100 times as complicated as a > 1,000 line program. Brooks has evidence of this as well. I don't think this is true. It certainly is for spaghetti code, but isn't it just the essence of structured programming to avoid having complexity scale like (lines)^2? There are both quite general and strong reasons why one should expect the complexity of programs of roughly the same "style" (whatever one has to invent to make a proper, meaningful notion out of this) to obey a scaling law of the form [nontrivial interactions] ~ [lines]^N but not necessarily with an integer exponent. I furthermore strongly suppose that this exponent should depend a lot on the programmer. > Very small functions, yes. But it's less of an optimization than people > think, and (especially in C++) it gets way overused. > > Allowing the programmer to force some functions to be inlined is right up > there with allowing the programmer to force some variables to be stored in > registers in usefullness. Sure. Never forget that inlining increases the amount of memory and cache bandwidth needed for getting the code into the CPU. -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)