René's URL Explorer Experiment


Title: Macro for defining opcode & instruction enums by ShaharNaveh · Pull Request #7573 · RustPython/RustPython · GitHub

Open Graph Title: Macro for defining opcode & instruction enums by ShaharNaveh · Pull Request #7573 · RustPython/RustPython

X Title: Macro for defining opcode & instruction enums by ShaharNaveh · Pull Request #7573 · RustPython/RustPython

Description: This macro will generate an Instruction and a Opcode enum, all within rust, no external python scripts with custom config in toml or something. I'd love to hear what you guys think:) Summary by CodeRabbit Refactor Bytecode instruction types reorganized and generated via a unified macro for consistency and maintainability. Size and conversion behavior preserved to remain backward-compatible; no runtime behavior changes. New Features Public opcode enumeration types are now exposed for direct inspection and conversion. Opcode metadata generation script updated to include explicit CPython names.

Open Graph Description: This macro will generate an Instruction and a Opcode enum, all within rust, no external python scripts with custom config in toml or something. I'd love to hear what you guys think:) Summary b...

X Description: This macro will generate an Instruction and a Opcode enum, all within rust, no external python scripts with custom config in toml or something. I'd love to hear what you guys think:) Summa...

Opengraph URL: https://github.com/RustPython/RustPython/pull/7573

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:65979d4c-3bc6-2c76-8d21-7bd37f454b2e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAFA2:342CBC:339C36:45594B:6A5E72A2
html-safe-nonce7ee3f8cc3eb4a25ff89447783806c7db2e3a4444c86deb6bba52ec5ce5df270a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkEyOjM0MkNCQzozMzlDMzY6NDU1OTRCOjZBNUU3MkEyIiwidmlzaXRvcl9pZCI6IjI2OTcyNjk4NTA1NjYxOTM4MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace5dd9cc61ee46d625c8842da71403ce4f8b893afda7cab5309f6ed798db098a8
hovercard-subject-tagpull_request:3509767016
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7573/files
twitter:imagehttps://avatars.githubusercontent.com/u/50263213?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/50263213?s=400&v=4
og:image:altThis macro will generate an Instruction and a Opcode enum, all within rust, no external python scripts with custom config in toml or something. I'd love to hear what you guys think:) Summary b...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None71950bbe6bf7e15662b868c102fed9d1682c29a05970d9b2daa2e4dd3522c52e
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7514606601325843bc1c464d2d8bf5fe9af2c154
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/7573/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7573%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7573%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/7573/files
Reloadhttps://github.com/RustPython/RustPython/pull/7573/files
Reloadhttps://github.com/RustPython/RustPython/pull/7573/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 290 https://github.com/RustPython/RustPython/issues
Pull requests 101 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
ShaharNaveh:bytecode-instr-super-macrohttps://github.com/ShaharNaveh/RustPython/tree/bytecode-instr-super-macro
Conversation 19 https://github.com/RustPython/RustPython/pull/7573
Commits 23 https://github.com/RustPython/RustPython/pull/7573/commits
Checks 19 https://github.com/RustPython/RustPython/pull/7573/checks
Files changed https://github.com/RustPython/RustPython/pull/7573/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
Macro for defining opcode & instruction enums https://github.com/RustPython/RustPython/pull/7573/files#top
Show all changes 23 commits https://github.com/RustPython/RustPython/pull/7573/files
61a2db1 Macro for defining opcode & instruction enums ShaharNaveh Apr 9, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/61a2db139fd5276d0a2b73dac9e74d6948c9c1a0
9772ca3 Convert `Instruction` as well ShaharNaveh Apr 9, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/9772ca3850b4a428ecea703419165bf1a440a88f
6170214 revert `#[repr(...)]` changes ShaharNaveh Apr 9, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/617021431afe5f01f16bc545cb2a8d38afc7f13f
769e9b6 fmt ShaharNaveh Apr 10, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/769e9b6f460b79f0d4a85d146d33ee9158cf3936
9f629ce Align real opcodes ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/9f629ce321bb679cc8ce9cfe715c38f25a89ea3b
c4caae2 Align pseudo opcodes ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/c4caae23c2e00a510ef5179a929b94ef33323535
93c38d8 const `Opcode.name()` method ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/93c38d8f96eaa1f8afbfb1c43d0f9328d5bf8f69
048515b Add docs to methods ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/048515b9ac2bb29e752f4cd9162df7bafa799974
5b40098 Adjust `scripts/generate_opcode_metadata.py` to new macro ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/5b40098937b7eb69d54c083d2e7b79ea051ddc7d
9791858 nit ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/97918589c685a6ea83abbf6ab64598486136dcd3
f6fb58d Add `AnyOpcode` enum ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/f6fb58da5484c4c3661e265fc88083edc11e6208
ac9844b Add impls for `AnyOpcode` ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/ac9844b14cceb2a28331117926e74dad6c025cf3
8274ffe Use `AnyOpcode` ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/8274ffeca9d23113050c34465d90a7bbed5e1535
64d722e Cleanup more ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/64d722e62a8c45149661092628f1ac267ddbd630
d7b9dbb Cleanup `_opcode.rs` ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/d7b9dbb349b0689416780c3e78cbb78f8b6db6cb
0adcd50 clippy ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/0adcd507140d896ce6dbdb8e7f19b5e276e9093a
06021c9 Cleanup more ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/06021c9668269d9bec1940eca1c2745f73045f98
f5fb54d more cleanup ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/f5fb54dee259f1d1df7a2605bffb0d312e42460e
5cd47aa More cleanup ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/5cd47aaec4a0e4dd8888db4aeee2249cdf1ab4ea
c96f81e more cleanup ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/c96f81ee4f75c7d9c809a0c94758d74b7683f593
aef533b more ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/aef533b941ff085ad121a538e8a03a81bca2311e
cd7e46e More cleanups ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/cd7e46e5e8432f734d74256ae8fe8ad4a64609c5
c0c1218 More cleanup ShaharNaveh Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7573/commits/c0c1218869e59303eb37374f3315816a1295567f
Clear filters https://github.com/RustPython/RustPython/pull/7573/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
ir.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-d8c69d86dba0a1bbfb21c9d93371294ea2861a4083565b20e622a7bec7da1ecc
bytecode.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-14e38729fc9f6fc42fa6a3125689aa0034480a2cf3ebd59f1c4d1f40fdcd36a0
instruction.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-6018c8f0dd833da5182e2e0bcbf8b6ef6c4e5e7922bf9297daf9e84824fcaa91
_opcode.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-49b4012950d82df2891bf5e9ebe150f9e068a8b70f7287b3dbed84df43da5fbb
frame.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-03f2741d7d424014f3d2f0c82226be52fa58134aab34bf0780714ee67a248deb
context.rs https://github.com/RustPython/RustPython/pull/7573/files#diff-266ab6550d81a4d367e5ef4973281aecf61c7abb46760195fc4ad6064bca0791
generate_opcode_metadata.py https://github.com/RustPython/RustPython/pull/7573/files#diff-bed9450c52d223293e90807e120e419789e2922de8d523c3a2dbe37cfce4cb27
crates/codegen/src/ir.rshttps://github.com/RustPython/RustPython/pull/7573/files#diff-d8c69d86dba0a1bbfb21c9d93371294ea2861a4083565b20e622a7bec7da1ecc
View file https://github.com/ShaharNaveh/RustPython/blob/c0c1218869e59303eb37374f3315816a1295567f/crates/codegen/src/ir.rs
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
crates/compiler-core/src/bytecode.rshttps://github.com/RustPython/RustPython/pull/7573/files#diff-14e38729fc9f6fc42fa6a3125689aa0034480a2cf3ebd59f1c4d1f40fdcd36a0
View file https://github.com/ShaharNaveh/RustPython/blob/c0c1218869e59303eb37374f3315816a1295567f/crates/compiler-core/src/bytecode.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7573/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7573/files#diff-14e38729fc9f6fc42fa6a3125689aa0034480a2cf3ebd59f1c4d1f40fdcd36a0
https://github.com/RustPython/RustPython/pull/7573/files#diff-14e38729fc9f6fc42fa6a3125689aa0034480a2cf3ebd59f1c4d1f40fdcd36a0
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7573/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.