help-zile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-zile] Next steps [Was: [ANN] Zile Syntax Highlighter]


From: Reuben Thomas
Subject: Re: [Help-zile] Next steps [Was: [ANN] Zile Syntax Highlighter]
Date: Sun, 11 May 2014 19:59:59 +0100

On 11 May 2014 18:57, Gary V. Vaughan <address@hidden> wrote:

Of course, a parallel alien array of cell attributes will still be a good deal
faster than the slew of nested tables I'm currently slinging... Or maybe
I'm missing something more elegant by thinking along those lines?

I would go with that.

In general, the only better idea I've had (and once implemented in the C version of Zee) is to use what I call "lazy ropes", i.e. ropes (as implemented e.g. by the companion libraries to libgc) which are only split when needed. A file can thus be read (or mapped) into a single string, but when part of the file is edited, it's split into lengths of rope, and hence doesn't have to be maintained in a contiguous lump of memory. This slows down navigation but speeds up editing; I suppose that some sort of adaptive remerging of sections that have not been edited for a while might also be good. One might use the generational aspect of a garbage collector for that, without, of course, the actual collection.

Ropes also seem like a good way to split up a buffer to apply metadata, like highlighting information, with various scopes. Lazy parsing could work with lazy ropes to keep things fast when you open a big file.

--
http://rrt.sc3d.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]