Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Document the instruction format. #56

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

Closed
ericsnowcurrently opened this issue Jun 4, 2021 · 5 comments
Closed

Document the instruction format. #56

ericsnowcurrently opened this issue Jun 4, 2021 · 5 comments
Assignees

Comments

@ericsnowcurrently
Copy link
Collaborator

The code emitted by the compiler, stored in PyCodeObject.co_code, and executed in the eval loop clearly has a well-defined format. In 2016 (bpo-26647) we switched to a fixed size wordcode (16 bits). There are a number of details about that format which aren't obvious, nor easy to discover (especially for someone new to the code).

Consequently, it would be helpful to have the format documented (in an easily discovered location). I haven't been able to find anything like that, other than a few scattered comments in the code (in relatively non-obvious places). We have similar documentation in .txt files in the Objects dir (e.g. dictnotes.txt). Something like that would make sense to me. Likewise we have comments with a similar utility in various source and header files (e.g. Objects/odictobject.c,). Another option might be to put it in the devguide, though it would probably be better to keep it in the repo, tied to the implementation it describes.

(FYI, this issue was born of discussion on one of my PRs.)

@gvanrossum
Copy link
Collaborator

Isn’t this described under the ‘dis’ module?

@ericsnowcurrently
Copy link
Collaborator Author

It has some of the info though I was thinking of a bit more depth of technical detail.

@gvanrossum
Copy link
Collaborator

Okay, then we should put this in the source repo, not the dev guide. Are you volunteering? :-)

@ericsnowcurrently
Copy link
Collaborator Author

I'd be glad to do it. 🙂

@markshannon
Copy link
Member

Is this going to happen?

@faster-cpython faster-cpython locked and limited conversation to collaborators Dec 2, 2021
@gramster gramster moved this to Todo in Fancy CPython Board Jan 10, 2022
@gramster gramster moved this from Todo to Done in Fancy CPython Board Jan 10, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Development

No branches or pull requests

3 participants