Skip to content
/ scanner Public

Fast non-backtracking incremental combinator parsing for bytestrings

License

Notifications You must be signed in to change notification settings

Yuras/scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scanner

Fast non-backtracking incremental combinator parsing for bytestrings

Build Status

On hackage: http://hackage.haskell.org/package/scanner

On stackage: https://www.stackage.org/package/scanner

It is often convinient to use backtracking to parse some sophisticated input. Unfortunately it kills performance, so usually you should avoid backtracking.

Often (actually always, but it could be too hard sometimes) you can implement your parser without any backtracking. It that case all the bookkeeping usuall parser combinators do becomes unnecessary. The scanner library is designed for such cases. It is often 2 times faster then attoparsec.

As an example, please checkout redis protocol parser included into the repo, both using attoparsec and scanner libraries: https://github.com/Yuras/scanner/tree/master/examples/Redis

Benchmark results:

Bechmark results

But if you really really really need backtracking, then you can just inject attoparsec parser into a scanner: http://hackage.haskell.org/package/scanner-attoparsec

About

Fast non-backtracking incremental combinator parsing for bytestrings

Resources

License

Stars

Watchers

Forks

Packages

No packages published