Git Product home page Git Product logo

construct3's People

Contributors

bitdeli-chef avatar harvimt avatar tomerfiliba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

construct3's Issues

Missing containers.py

When importing construct3, I get an exception due to a missing construct3/lib/containers.py file:

$ python -c 'import construct3'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "construct3/__init__.py", line 3, in <module>
    from construct3.packers import (Packer, PackerError, Adapter, Struct, NamedPacker, Raw, Range, Bitwise, 
  File "construct3/packers.py", line 4, in <module>
    from construct3.lib.containers import Container
ImportError: No module named containers

Copying the construct/lib/container.py file from the construct 2 repository fixes the issue, but I'm guessing you have a file that simply hasn't been added to the repository.

"There should be one obvious way to do it"

Maybe I should have written this to the user-group, but sorry, I don't like user groups :-)

I'm very impressed by construct3, and it's a pity that I didn't hear about construct1 and construct2 before. It would have saved me and my colleagues a ton of work a year ago.

But allow me to quote The Zen of Python:

There should be one-- and preferably only one --obvious way to do it.

I think this is a very important rule of API design. When you have aliases and multiple syntaxes to accomplish the same thing things get confusing.

For example byte, int8u and int8ul mean the same, right? At the same time int8, int8s, int8l and int8sl are the same thing as well. You might disagree with me, but I think that's "too many ways to do it".
(Not mentioning that unsigned int8 is usually called uint8, not int8u).

You have a couple of syntax shortcuts as well: byte[4] for Array(4, byte), 'a' / byte for ('a', byte), and byte >> byte for Struct(byte, byte). IMHO those are unnecessary. Compare:

'a' / byte >> 'b' / byte >> 'c' / byte >> 'd' / byte
Struct(('a', int8u), ('b', int8u), ('c', int8u), ('d', int8u))

The later one is only marginally longer, but how much more readable to me.

Anyway, I think construct3 is fantastic, great work! I'm sure it's impossible to spoil it—that's how good it is :-)

Pass is missing

Something like Pass from construct 2.5 is missing,
especially when If takes 3 args
(cond, then, else)

STICKY: Construct2 is undergoing serious changes

After I took it over, I started doing some serious API changes. Most classes have been changed. Second half of my plan is going to be porting it to Cython.

I dont know how Construct3 is going but maybe we should consider having a debate on what the future of both projects should be. @tomerfiliba You could probably import some of the classes that I added.

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.