Construct 2.0 released
http://construct.wikispaces.com/
比較值得注意的概念是Construct是declarative的:
Construct is a python library for parsing and building of data structures (binary or textual). It is based on the concept of defining data structures in a declarative manner, rather than procedural code: more complex constructs are composed of a hierarchy of simpler ones. It's the first library that makes parsing fun, instead of the usual headache it is today.
....
Unlike most other parsers, such as python's builtin struct module, Construct is declarative, can work with either bytes or single bits, follows pythonic paradigms, is easy to extend, and symmetrical. Apart from that, it comes loaded with built-in primitives, a tutorial, and an inventory of constructs for file formats and protocols.
Being declarative means you directly define the data structure, not the code that parses it. This means you can export your definition to XML, or write a code generator that takes a construct and converts it to a C module, just to name a few ideas.
Philosophy裡 這句Components are better than inheritance也深得我心
License: Public Domain
沒有留言:
張貼留言