Skip to content

Add dialect! macro - #115

Open
robpatterson13 wants to merge 3 commits into
rob/execute-traitfrom
rob/dialect-macro
Open

robpatterson13 wants to merge 3 commits into
rob/execute-traitfrom
rob/dialect-macro

Conversation

@robpatterson13

@robpatterson13 robpatterson13 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Adds dialect! for declaring a dialect’s instructions in one place. The macro generates runtime instruction structs and separately parsable syntax structs, with support for custom patterns, distinct syntax, and runtime payload types (like is currently supported through the composite! macro).

It also exposes an instruction enumerator for downstream (vihaco internal) macros. Callers can select every instruction or named instructions in a chosen order; each descriptor includes its types, mnemonic, and original declaration position. You can read the docstrings in crates/vihaco-runtime-derive/src/dialect/enumerator.rs for explanation of the callback macro mechanism and how it is used by consumers.

The branch adds validation for duplicate names, unsupported forms, and malformed declarations, plus parsing and compile-fail tests.

@robpatterson13
robpatterson13 added this pull request to stack #116 September 23, 2026 19:24
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://QuEraComputing.github.io/vihaco/pr-preview/pr-115/

Built to branch gh-pages at 2026-09-23 19:40 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant