Skip to content

feat: refactor gogen to use bytecode#1965

Merged
DavePearce merged 1 commit into
mainfrom
1963-feat-refactor-gogen-to-use-bytecode
Jul 7, 2026
Merged

feat: refactor gogen to use bytecode#1965
DavePearce merged 1 commit into
mainfrom
1963-feat-refactor-gogen-to-use-bytecode

Conversation

@DavePearce

Copy link
Copy Markdown
Contributor

This PR refactors the GoGenerator to use the new Bytecode API rather than the legacy WordMachine API. In addition, GoGen is tweaked to support the "subtract with borrow" semantics.

@DavePearce DavePearce linked an issue Jul 7, 2026 that may be closed by this pull request
@DavePearce DavePearce force-pushed the 1963-feat-refactor-gogen-to-use-bytecode branch 2 times, most recently from ca3e416 to 26a1bdb Compare July 7, 2026 02:09
This updates the GoGenerator (GoGen) to use the new Bytecode API inplace
of the legacy WordMachine API.  Some changes were required for first.
Firstly, proper support for "subtract with borrow" semantics was put in
place.  Secondly, support for the bytecode CheckCast instruction was
added.

NOTE: this also fixes the Program.MaxStaticDepth() function which was
returning incorrect results.

Signed-off-by: DavePearce <dave01001110@gmail.com>
@DavePearce DavePearce force-pushed the 1963-feat-refactor-gogen-to-use-bytecode branch from 26a1bdb to e4ec1f6 Compare July 7, 2026 02:17
Comment thread pkg/zkc/vm/bytecode.go
// UintAdd constructs an addition instruction computing
// LoadConst constructs an instruction assigning a constant into a single
// target register.
func LoadConst[W Word[W]](target RegisterId, constant W) Bytecode[W] {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well ... We'll have to uodate this

@DavePearce DavePearce merged commit 85dae00 into main Jul 7, 2026
19 checks passed
@DavePearce DavePearce deleted the 1963-feat-refactor-gogen-to-use-bytecode branch July 7, 2026 04:25
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.

feat: refactor gogen to use bytecode

2 participants