Giter Club home page Giter Club logo

Comments (11)

joeedh avatar joeedh commented on August 22, 2024

It might not be a bad idea to use an ordered dict class. There was even a version of ply where I had to do this (it was relying on dict keys having a consistent order).

from ply.

LocutusOfBorg avatar LocutusOfBorg commented on August 22, 2024

Hi, ping? :)

from ply.

dabeaz avatar dabeaz commented on August 22, 2024

Dictionaries are used all over the place in yacc. Not sure I can easily fix this or not.

from ply.

refi64 avatar refi64 commented on August 22, 2024

@dabeaz Could you just do sorted(dct.items()) instead of dct.items()?

from ply.

johnyf avatar johnyf commented on August 22, 2024

Would such a change affect performance though? Should it be for the debugging implementation only, and not any optimized ones?

from ply.

refi64 avatar refi64 commented on August 22, 2024

@johnyf I think that would only be run when parsetab.py is being written, though, so it would be only for the first run.

from ply.

dabeaz avatar dabeaz commented on August 22, 2024

Suggest using yacc(write_tables=False) to disable the creation of the parsetab.py file entirely.

Background: The whole reason that parsetab.py file is there in the first place is that the first version of PLY was written on a 200Mhz PC and the parser table creation was slow. To make startup faster on subsequent runs, parsetab.py was written and used as a kind of cache. I'm not even sure it matters now. For one, machines are a LOT faster. Also, PLY switched over to a different, much faster, algorithm ages ago (generating the tables for C with some 353 states takes about 0.3s on my current machine).

Honestly, I've been thinking about ditching all of this parsetab.py/lextab.py business entirely in some future version.

from ply.

lamby avatar lamby commented on August 22, 2024

(Not all dicts would have to be changed, mind you...)

from ply.

johnyf avatar johnyf commented on August 22, 2024

In my experience with promela, the parsetab.py is useful and does accelerate runs. I would prefer that it remains available as functionality. Quantifying the difference would require collecting measurements from running a representative collection of large parsers.

from ply.

dabeaz avatar dabeaz commented on August 22, 2024

Ditching parsetab.py/lextab.py is not something I'm likely to do in the context of PLY. I have a more modern project in the works (a successor to PLY) that will ditch the generated files however.

from ply.

LocutusOfBorg avatar LocutusOfBorg commented on August 22, 2024

Hello, FWIW I switched the Debian packaging to the new release 1.0.0
https://github.com/viraptor/phply that seems to be the new one published on pypi

https://pypi.debian.net/phply
https://pypi.python.org/pypi/phply

So, I consider this issue "fixed" for my packaging needs

from ply.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.