09-Feb-2013 19:46, Andrei Alexandrescu пишет:
On 2/9/13 10:37 AM, Jacob Carlborg wrote:
On 2013-02-09 16:10, Andrei Alexandrescu wrote:

Requiring a random-access range of ubyte with a terminating zero may be
the most general approach to a fast lexer - and that's fine.

Requiring a random-access range probably makes it easier. People here
seems to try to support ranges with less functionality, like input or
forward ranges.

Yah. The way I see it is, start with a random-access range and then see
what the use patterns are. Then possibly refine.


I don't get this. There is no sensible requirement to forbid non-random access. A couple of static ifs and you are done.

And I can confidently say that std.d.lexer has quite some room for optimization in both cases and it doesn't have to sacrifice the generic path.

I intent to continue hacking on Brain's implementation and to help him refine it. Any real help (as in work and analysis) is appreciated, thanks.

--
Dmitry Olshansky

Reply via email to