0xMiden / 0xMiden/miden-vm

Support while.exec.<proc> to ease loop maitenance

Open
#798 2 comments 3 reactions 1 assignee Claimed by @bitwalker View on GitHub
assembly
Dominant language
Rust
Stars
772
Forks
352
Avg merge
1d 12h
Merged PRs (30d)
93

Description

A common while pattern is to write:

```

while.true
...

end
```

This causes a bit of duplication, since the same test has to be replicated prior to the while, and as the last thing in the loop. This proposes extending the `while.true` syntax to also support `while.exec.`. The syntax would expand to the pattern above.

Example usage:

```
proc.is_not_zero
dup.0 neq.0
end

begin
push.5
while.exec.is_not_zero
sub.1
end
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.