My opinion is that the parsers should be written using a more robust
approach to incrementality, namely that I've developed for this purpose
and described here 

www.cse.chalmers.se/~bernardy/PP.pdf

(I developed the current version; the problem with it is that it requires
inhumane skill to construct efficient parsers based on it.)

A first step towards this long-term goal would be to develop monoid-based 
lexers. See here for an intro to the idea:

http://blog.sigfpe.com/2009/01/fast-incremental-regular-expression.html

In sum, the fundamental research has been done, 
now it's a matter of putting the pieces together.

Cheers,
JP.
 

On Thursday, 6 June 2013 21:52:41 UTC+2, tri...@nochair.net wrote:
>
> I love the idea of yi and decided to try to make a syntax-based 
> highlighting mode for it.
> I started with HTML since that should be easy;  my efforts are on github:
>
>   
> https://github.com/travitch/yi/blob/html-mode/yi/src/library/Yi/Syntax/HTML.hs
>
> I plan on setting up tag matching to highlight badly-nested tags, but 
> right now the
> parser only produces a list of open tags, close tags, text nodes, and 
> comment nodes.
> It works fine and looks great for small files, but anything large chokes 
> it.  By "chokes",
> I mean that enabling the mode and running 'yi /tmp/test.html' on a file 
> with more than a
> few dozen lines pegs a CPU for longer than I've had the patience to wait 
> (it also starts
> allocating all of my memory).
>
> Are there any guidelines I should follow to make an efficient syntax-based 
> mode?
>
> I don't really understand the incremental parser, but I feel like 
> re-parsing the file
> each time might be more efficient than what I am seeing.  I also notice 
> this same
> behavior with the Javascript mode (which isn't surprising, since my mode 
> looks
> very similar).  The "clever" haskell mode seems much more resilient to 
> large files,
> but I don't see any huge differences.
>

-- 
-- 
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
--- 
You received this message because you are subscribed to the Google Groups 
"yi.devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to yi-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to