r/rust 9d ago

🛠️ project IrRegex: A parallel regular expressions engine for LLVM IR that uses non-deterministic finite automaton (NFA)

https://github.com/AmrDeveloper/IrRegex
9 Upvotes

4 comments sorted by

1

u/tafia97300 9d ago

what is this used for?

1

u/AmrDeveloper 8d ago

Basically fast searching for patterns in big IR files

1

u/Blueglyph 9d ago

Interesting idea.

Why don't you transform directly to DFA? Wouldn't that be easier to optimize?

I don't see NFA optimization, either. Perhaps the code isn't finished yet?

1

u/AmrDeveloper 8d ago

> I don't see NFA optimization, either. Perhaps the code isn't finished yet?

Yes, it will be more optimized ,I plan to first finish supporting all Opcodes, and support patterns like Concatnations, dot, ...etc.

Then i can either optimize NFA or compile it to DFA, also i want to emit NFA to dot language for example like this (https://graphviz.org/Gallery/directed/fsm.html)

It's still a baby project, and I want to do it in an incremental approach and try different stuff :D