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 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 78B66BC0B for ; Wed, 13 Dec 2006 14:53:19 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBDDrH9v026956 for ; Wed, 13 Dec 2006 14:53:18 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 14 Dec 2006 00:23:13 +1030 X-IronPort-AV: i="4.12,163,1165152600"; d="scan'208"; a="59765586:sNHT23504313" Subject: Re: [Caml-list] How to refactor a large Ocaml program From: skaller To: Pietro Abate Cc: caml-list@yquem.inria.fr In-Reply-To: <20061213130922.GA17914@pulp.rsise.anu.edu.au> References: <457FF423.7000703@abc.se> <20061213130922.GA17914@pulp.rsise.anu.edu.au> Content-Type: text/plain Date: Thu, 14 Dec 2006 00:53:10 +1100 Message-Id: <1166017990.5643.10.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 458005CD.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; refactor:01 ocaml:01 ocaml:01 compiler:01 compiler:01 coupling:01 vaguely:01 semantics:01 sourceforge:01 wrote:01 caml-list:01 expressive:01 modules:02 modules:02 interaction:02 On Thu, 2006-12-14 at 00:09 +1100, Pietro Abate wrote: > not an answer, but a general comment, maybe also a bit OT ... > On the other hand, in ocaml, I've never written modules/logical units > bigger than 1K lines, and even if the project can grow very big, the > level of interaction between modules is often confined to the module > interface and changing the name of a function is usually never a big > problem. Felix compiler (Ocaml code) is 100K loc. The largest hand written files appear to be around 5K loc. The compiler runs in phases so coupling is vaguely 'vine like' :) One of the longest (5K loc) files is more or less a single huge let-rec. I wish I *could* factor it more easily. It is a very hard module to understand, and also consumes about 65% of the compiler running time. I'm not a very good programmer.. there's no way I could have gotten this code running in C++ or Java. Ocaml is quite reasonably expressive. It mainly lets me think about semantics without too much worrying about house keeping. -- John Skaller Felix, successor to C++: http://felix.sf.net