Title: `inst` defintion and its optional `stack_effect` · Issue #133412 · python/cpython · GitHub
Open Graph Title: `inst` defintion and its optional `stack_effect` · Issue #133412 · python/cpython
X Title: `inst` defintion and its optional `stack_effect` · Issue #133412 · python/cpython
Description: The DSL specification syntax definition of the inst shows that the stack_effect is optional, including its parentheses: definition: "inst" "(" NAME ["," stack_effect] ")" "{" C-code "}" ... stack_effect: "(" [inputs] "--" [outputs] ")" B...
Open Graph Description: The DSL specification syntax definition of the inst shows that the stack_effect is optional, including its parentheses: definition: "inst" "(" NAME ["," stack_effect] ")" "{" C-code "}" ... stack_e...
X Description: The DSL specification syntax definition of the inst shows that the stack_effect is optional, including its parentheses: definition: "inst" "(" NAME ["," stack_effect] ...
Opengraph URL: https://github.com/python/cpython/issues/133412
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`inst` defintion and its optional `stack_effect`","articleBody":"The DSL specification syntax definition of the `inst` shows that the `stack_effect` is optional, \n**including its parentheses**:\n```\ndefinition:\n \"inst\" \"(\" NAME [\",\" stack_effect] \")\" \"{\" C-code \"}\"\n...\nstack_effect:\n \"(\" [inputs] \"--\" [outputs] \")\"\n```\n\nBut if we defined a new instruction, let's say, `MY_INSTRUCTION` as:\n```C\ninst(MY_INSTRUCTION) {\n /* implementation */\n}\n```\nWe will get the following error:\n```\nSyntaxError: Extra stuff at the end of ./Python/bytecodes.c\n```\nHowever, if we defined `MY_INSTRUCTION` with an **empty** `stack-effect`, it will work!\n```C\ninst(MY_INSTRUCTION, ( -- )) {\n /* implementation */\n}\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-133708\n* gh-133729\n* gh-133730\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/nybblista","@type":"Person","name":"nybblista"},"datePublished":"2025-05-05T00:01:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/133412/cpython/issues/133412"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0d6519fd-f974-0030-2e5f-1a81de97607f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC4E:3280E7:4CDAE1:64FF90:6A53E940 |
| html-safe-nonce | 349d7d41e9e03a83937f277065dbc78d54d7adaac14cd3163946e1f74143c466 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzRFOjMyODBFNzo0Q0RBRTE6NjRGRjkwOjZBNTNFOTQwIiwidmlzaXRvcl9pZCI6IjkyMTI0ODE0ODMzMzk3MjEwMjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c7451c15e596dcc39ea782ddb305df8aa1b4fc3b366bf521c7b629361e23aff4 |
| hovercard-subject-tag | issue:3038328734 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/133412/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c05abc6a07d4a478899ecfac97026dc9e3cb7235efe1001956b8fa295dcfad7/python/cpython/issues/133412 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c05abc6a07d4a478899ecfac97026dc9e3cb7235efe1001956b8fa295dcfad7/python/cpython/issues/133412 |
| og:image:alt | The DSL specification syntax definition of the inst shows that the stack_effect is optional, including its parentheses: definition: "inst" "(" NAME ["," stack_effect] ")" "{" C-code "}" ... stack_e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nybblista |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width