Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will the slowness warning of computation expressions be moot after f#5? #60

Open
travis-leith opened this issue Sep 5, 2020 · 1 comment

Comments

@travis-leith
Copy link

The documents warn us that using computation expressions will be slower than we might expect.

The upcoming release of F#5 is adding support for applicatives in computation expressions. Will this slowness still be an issue if we use the new applicative syntax, provided FParsec provides support for it?

@baronfel
Copy link

baronfel commented Dec 5, 2020

Adding support for applicatives can definitely address some of the underlying concerns, as instead of nested calls to Bind, independent parsers can be run individually and collected up into a single value for passing to the next Bind call via MergeSources and/or BindN/BindReturn overloads.

There will likely be some additional overhead still compared to manual parser writing, but I would naïevely expect the performance gap to shrink massively.

And perhaps with state machine additions coming sometime in the future the parse CE could actually compile down to low/zero-overhead state machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants