This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: expect module


| Gary Houston <ghouston@easynet.co.uk>
| > True.  I had a vague idea of rewriting part of it in C.  Adding a
| > per-line mode may be a good idea too.  Perhaps implementing
| > expect-strings directly instead of as a front-end to a more general
| > expect would help.
| 
| If you are after speed, I think it would be better to implement a
| regexp library based on a more generic nondeterministic FSM to
| deterministic FSM transformer. Then you advance the deterministic FSM
| on each character you receive. If both machines were scheme data
| structures, then this same transformer could be used for many other
| things as well.
| 
| I am sorry if this is already thought over or shot down or even
| implemented. I do not follow these scheme things very closely so just
| let me know what I am ignorant of.

This looks like a very promising idea to me.  Nothing has been
shot down or implemented for the current implementation of expect:
it's completely unoptimized.

Interestingly Tom Lord's Rx interface did include regexp->dfa and 
advance-dfa! among others, so that could be a place to start.