-
Notifications
You must be signed in to change notification settings - Fork 466
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
yacc argument "write_tables" is missing in 3.11 #277
Comments
The feature of writing tables was removed entirely at some point. However, I think this was post-3.11 and would only be present in code copied from GitHub. |
Thanks! |
Excuse me for opening the issue again, I've noticed Massive refactoring/cleanup commit removes optimized mode and all related stuff, including cached tables. Can you elaborate in a few words the rationale, please? Is there any potential performance degradation related to it? I've seen these tables in pycparser (it still uses ply 3.10), for example |
PLY was originally written on a 200 Mhz PC and the initial implementation was quite slow at table generation (a large grammar could take tens of seconds). Machines have become much faster and PLY uses a significantly better algorithm than it did before. On my current desktop machine, generating tables for the full ANSI C grammar barely takes 0.1 second. Writing of cache files was always problematic for various reasons--especially for deployment and packaging. Most people do not expect a third-party package to be implicitly writing temporary files as a side-effect of usage. Frankly, it was a never-ending source of bug reports and I'm glad to be rid of it. If you want the parsing tables to be cached, the parser should be serializable with pickle. Use that to write it out and bring it back in your application. Alternatively, if startup time matters a lot, you might consider writing a daemonized parser instead. |
Thank you for your time, sir. Totally makes sense. |
The
write_tables
argument toyacc.yacc()
is missing in 3.11. Documentation on https://www.dabeaz.com/ply/ply.html for 3.11 still has this option in it. Was it removed? If I move to 3.11, can I prevent yacc from writingparsetable.py
? I have a very small grammar I use this for.The text was updated successfully, but these errors were encountered: