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 2B8B7BC0B for ; Thu, 14 Dec 2006 09:21:42 +0100 (CET) Received: from violet.abc.se (violet.abc.se [62.80.200.155]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBE8Le8V022732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 14 Dec 2006 09:21:41 +0100 Received: from [192.168.0.45] (localhost.localdomain [127.0.0.1]) (authenticated bits=0) by violet.abc.se (8.13.1/8.13.1) with ESMTP id kBE8Ld3t010562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Dec 2006 09:21:39 +0100 Message-ID: <4581098C.3040303@abc.se> Date: Thu, 14 Dec 2006 09:21:32 +0100 From: Mattias Waldau User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to refactor a large Ocaml program References: <457FF423.7000703@abc.se> <45800CD5.8050401@janestcapital.com> In-Reply-To: <45800CD5.8050401@janestcapital.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on violet.abc.se X-Virus-Status: Clean X-Miltered: at concorde with ID 45810994.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mattias:01 waldau:01 mattias:01 waldau:01 refactor:01 ocaml:01 ocaml:01 parsers:01 lexer:01 syntax:01 parsing:01 syntax:01 unmanageable:01 kloc:01 parsed:01 I agree that the smaller size of Ocaml programs makes them more manageable, however it doesn't solve all problems. My experience from doing refactoring like this is that you end up with a non-compiling program for a while, and in a day or two, your programs works well again. A "real" refactoring tool requires parsers, lexer etc, and I am not sure Ocaml syntax is very good for doing this kind of parsing on non-compiling code. (A side note, are there any programming language defined whose syntax has been designed so that fragments can be parsed?). However, a simple solution is to improve the .annot files as described in the previous entry, so that we at least can analyze compiled programs. > Am Mittwoch, den 13.12.2006, 15:00 +0100 schrieb Yann Coscoy: >> My opinion is that you are right when you say that ocaml programs are >> often shorter than Java one. However, I have the feeling that you are >> over-enthusiastic about manageability of ocaml programs. > > Well, it is certainly possible to write Ocaml programs that turn out to > be unmanageable. My experience (which is currently a 53 kloc commercial > project) is different, however. We are refactoring all the time, and it > is no big deal. > > Ok, we are only refactoring from "good design A" to "good design B", and > not from a bad design to a hopefully better design.