Skip to content

feat: Stack Machine (rebased, starting on kernel compilation)#99

Draft
acl-cqc wants to merge 87 commits intomainfrom
acl/stack_machine2
Draft

feat: Stack Machine (rebased, starting on kernel compilation)#99
acl-cqc wants to merge 87 commits intomainfrom
acl/stack_machine2

Conversation

@acl-cqc
Copy link
Collaborator

@acl-cqc acl-cqc commented Jan 2, 2026

Version of #88 rebased to come after #98, with a few commits moved out into #100

I've reworked the Hugr compiler to compile only Kernel boxes, and Compiler.hs (brat -c) calls this only for Kernel boxes that are inputs to the Id nodes of top-level decls. "compile" produces a Hugr + list of splices, where each splice is (the NodeId of a Hole op in the hugr, OutPort from BratGraph) - the "index" of the Hole op is not really used. The interpreter then (hopefully) evaluates the outports, perform the splices using #98, and returns the final Hugr in JSON form.

TODO:

  • Add some actual interpreter tests
  • Of course more interpreter stuff, nodes, wiring etc....could be a never-ending stream of later PRs tho
  • Validation fails with a bunch of the output hugr .json files that are 0 bytes long?!?!

Base automatically changed from acl/splice_hugr to main February 25, 2026 14:50
@acl-cqc acl-cqc force-pushed the acl/stack_machine2 branch from 600b217 to 5b55246 Compare March 6, 2026 16:22
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.

3 participants