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.3 required=5.0 tests=SPF_FAIL 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 AFE7EBC0B for ; Fri, 15 Dec 2006 13:34:15 +0100 (CET) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id kBFCYFgs004597 for ; Fri, 15 Dec 2006 13:34:15 +0100 Received: (qmail invoked by alias); 15 Dec 2006 12:34:14 -0000 Received: from e178089192.adsl.alicedsl.de (EHLO [192.168.2.190]) [85.178.89.192] by mail.gmx.net (mp049) with SMTP; 15 Dec 2006 13:34:14 +0100 X-Authenticated: #6007662 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <45825396.4020900@abc.se> References: <457FF423.7000703@abc.se> <45800CD5.8050401@janestcapital.com> <458106BD.7060103@abc.se> <20061215.140749.85706043.garrigue@math.nagoya-u.ac.jp> <45825396.4020900@abc.se> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5623CFF1-BF07-440F-AA1C-6B13BB158C5C@gmx.de> Content-Transfer-Encoding: 7bit From: Jan Rehders Subject: Re: [Caml-list] How to refactor a large Ocaml program Date: Fri, 15 Dec 2006 13:36:33 +0100 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.2) X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 45829647.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; refactor:01 ocaml:01 mattias:01 waldau:01 otags:01 ocaml:01 repetitive:01 intellij:01 emacs:01 notepad:01 emacs:01 15.:98 dez:98 navigate:98 wrote:01 Hi, On 15. Dez 2006, at 08:49, Mattias Waldau wrote: > A nice thing would be to be able to navigate the program, i.e. > > 1. Goto to definition (Ctrl-B in Visual Studio) This is possible with Otags On the utility of a refactoring tool: I believe it would be very useful in OCaml. It doesn't matter that much whether a language is expressive or not, tools doing repetitive work are always a great relieve. Imagine changing the signature of a function in a module type which is realized by several modules which in turn are used all around the program. You don't need bad code to save much time here if the name change is done by a tool in seconds instead of by a programmer in minutes or hours. Apart from that an "extract method"/"pull up let expression" refactoring would be especially useful in OCaml where one uses nested "let" expressions often. I find myself pulling a local function up a level frequently. There is a huge gap between tools which are aware of the program structure and those who are not. Take a language where such tools exist like Java: can anyone who ever got used to IDEA IntelliJ or Eclipse JDT going back to a simple text editor? I even prefer them over Emacs for Java coding. There is so much an IDE can provide if it can work on an AST of the language that you don't want to miss it. Not even in a language like OCaml. Searching references, changing names and structure etc. are things which can be done by the editor/ IDE. A powerful language can do much to improve programmers productivity but it will only reach it's full potential together with equally powerful tools - would anyone program OCaml in MS Notepad? Has anyone tried adding OCaml support for Emacs semantic? This might be a starting point -- Jan