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.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 933F8BC6B for ; Tue, 30 Oct 2007 06:53:37 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGBjJkfAXQImh2dsb2JhbACOXgIBCAop X-IronPort-AV: E=Sophos;i="4.21,345,1188770400"; d="scan'208";a="3817007" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Oct 2007 06:53:37 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9U5ra11032107 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 30 Oct 2007 06:53:37 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGBjJkfRVYT2kGdsb2JhbACOXgIBAQcCBhMRBw X-IronPort-AV: E=Sophos;i="4.21,345,1188770400"; d="scan'208";a="5267648" Received: from an-out-0708.google.com ([209.85.132.246]) by mail3-smtp-sop.national.inria.fr with ESMTP; 30 Oct 2007 06:53:36 +0100 Received: by an-out-0708.google.com with SMTP id c36so250617ana for ; Mon, 29 Oct 2007 22:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=7cWVt6dPjXXT812YKbHkZLWIT9uS+P+/RYEWEXXl5v0=; b=d7mtiMivn8jcNojb5wRKALPrLdmqyMXL6ubPPE7+Kmef9VijUz7lUjT8eNsm+ea/Hn0P1JsJmSk+QmpIq3SXaH3vyH0ZjQ5lCmnvWw0fuLGvK6/QnmC1LlJcqWkoVkLvPzZbPA/ukG6Kdza6BHXxsWyP7jghsecVVL9htY/Piio= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=a9r9Ub8jZ9INUI3qlBOjc77YnBGr89652sm8lgGXgxpaF0OD94E+Fpt3zjA7xMRbCnWmrPPPtVzqIj+EgHdh1BiX01lXndsMR2pjg7u+hh9qz760xPZ4c+8/16R0OTR3eIvLIxyOlXZYSek1cEC6oNz10vTJOF5qdpD9DvHnao0= Received: by 10.100.250.12 with SMTP id x12mr2318645anh.1193723615329; Mon, 29 Oct 2007 22:53:35 -0700 (PDT) Received: from ?192.168.0.7? ( [69.154.217.112]) by mx.google.com with ESMTPS id 6sm10104362wrh.2007.10.29.22.53.32 (version=SSLv3 cipher=RC4-MD5); Mon, 29 Oct 2007 22:53:33 -0700 (PDT) Message-ID: <4726C6DA.2010608@gmail.com> Date: Tue, 30 Oct 2007 00:53:30 -0500 From: Edgar Friendly User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Caml List Subject: Re: [Caml-list] Patch to 3.10.0 compiler enabling simple spell-checking References: <47264C70.5050100@gmail.com> <45E766F6-29C7-4710-8E32-9C6007A516FF@cs.princeton.edu> In-Reply-To: <45E766F6-29C7-4710-8E32-9C6007A516FF@cs.princeton.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4726C6E0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; compiler:01 yitzhak:01 mandelbaum:01 compiler:01 ocamlc:01 parses:01 cheers:01 yitzhak:01 ocaml:01 parser:01 namespaces:01 ocaml:01 namespaces:01 constructors:01 constructors:01 Yitzhak Mandelbaum wrote: > Very cool! Do you think there's any way you could separate it from the > compiler, like Learner et al.'s SEMINAL work, which separates type error > messages from the compiler?. Separation could help ensure this (and any > other, similar) ideas don't accidentally introduce bugs into the > compiler, and make it much easier for you to maintain. A very simple > hack might be tod wrap ocamlc in a script that parses such error > messages and then tokenizes the source file, looking for similar strings? > > Cheers, > Yitzhak > Separating it from the compiler would keep from interfering with the compiler's activities, but it would add some difficulties: Parsing ocaml - I guess I could steal the parser out of the current source code, and use the internal parse tree, but it'd be a lot more difficult than what I've done so far. Namespaces - Ocaml has a ton of namespaces. At the moment, the patch doesn't find mistyped module names, but it does distinguish the following: type parameters, type constructors, classes, row variables, values, constructors, labels and instance variables. Visibilty/scope - A simple script would have to add much complication to keep track of where each identifier is visible - Maybe easy, maybe not. Parsing the output of the ocaml compiler - ocamlc lacks i18n to make this extra difficult, but the error messages don't follow any spec, and could change at any time. On the plus side, if the simpler hack were built into an IDE, it could embed a list of corrections into a right-click menu, like a spell checker. It could do this outside the current cycle of edit -> compile -> edit I don't have interest in doing this - my ideas of a super-ocaml-IDE seem too big for me to program ATM. E.