<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Well, my thesis (many moons ago I assure you) was on syntax<br>
directed editors.  I came to the conclusion that letting the user<br>
do what they want is a requirement, but that "heuristics" and<br>
other "smarts" were to be avoided on the grounds that at least<br>
for my implementation they were more trouble than they were<br>
worth.  Thus I would avoid error correcting parsers unless you<br>
are very confident that the correction used is at least type-safe<br>
and that it is not "sticking things in" that are unwanted<br>
(or even more maddening removing what I just typed and<br>
which **was** what I wanted).<br>
<br>
So my recommendation is that pointing out where the syntax<br>
and typing errors are without having to leave the editor<br>
would be great.  Then the time required to actually make the<br>
corrections is minimal in terms of overall development time.<br>
<br>
The "interesting" (graveyard laugh) problems revolve around<br>
editing a library and the program that uses it at the same time<br>
with a few obvious extensions.  The "graveyard laugh" is because<br>
I rapidly found I needed transactions and as the implementation<br>
was in C++ it had some very nasty pointer issues going to and<br>
from disk.  Performance was also an issue --- but that was a<br>
a pre-sparc  SUN, M68020 w/ 4Meg of RAM if memory serves<br>
me correctly.<br>
<br>
Good Luck.<br>
<br>
<br>
John Meacham wrote:
<blockquote cite="mid20060530224647.GB6653@momenergy.repetae.net"
 type="cite">
  <pre wrap="">On Tue, May 30, 2006 at 10:33:05PM +0100, Brian Hulley wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I was kind of hoping that the syntax of Haskell could be changed so that 
for any sequence of characters there would be a unique parse that had a 
minimum number of "gaps" inserted by the editor to create a complete parse 
tree, and moreover that this parse could be found by deterministic LL1 
recursive descent.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
a problem is that people don't write code like they write novels. At
least I don't. I skip around, adding the beginning and ending of
functions and going back and filling in the center, or writing the =&gt;
first, then the type and going back and filling in the context. or
taking existing code and changing it in pieces, deleting something
there, adding it somewhere else, changing names, all of which leave
intermediate states that arn't just truncated programs.

I don't see such a property actually helping that much in terms of this
problem. I think you have no choice but to use heuristics to decide what
the user intends and try to limit the scope of potentially incomplete
source souring later things typed. Although not as popular as they once
were, error correcting parsers is a fairly advanced field in computer
science, combined with the knowledge of what names are in scope, I think
you can come up with fairly robust heuristics. It is by no means a
trivial problem, but it is certainly a tractable one.

        John


  </pre>
</blockquote>
<br>
</body>
</html>