Skip to content

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

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

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

Conversation

@acl-cqc
Copy link
Copy Markdown
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?!?!

@acl-cqc acl-cqc force-pushed the acl/stack_machine2 branch from 600b217 to 5b55246 Compare March 6, 2026 16:22
@acl-cqc acl-cqc force-pushed the acl/stack_machine2 branch 2 times, most recently from d7a09fc to 845be32 Compare April 15, 2026 10:32
@acl-cqc acl-cqc force-pushed the acl/stack_machine2 branch from 86b77ea to 3aea4e8 Compare April 17, 2026 14:13
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