Gno.land
Package bf is a Brainfuck machine for gno.land, and the measuring stick the rest of the guest-VM work is calibrated against. It ships two things that look alike and are not: - [Execute](#Execute), the naive interpreter: a switch over the source bytes, a brace matcher that rescans the program on every loop edge. It is kept verbatim as rung 0 of the optimization ladder, because a baseline you have edited is not a baseline. - [Compile](#Compile) plus [Machine](#Machine), the real one: the program is compiled to an op array with resolved jumps, runs of identical operators are fused, the common loop idioms become single ops, and execution is metered by a caller-supplied fuel budget against a [vmkit](/gno.land/p/moul/x/vm/vmkit/v0)(/p/moul/x/vm/vmkit/v0) Host, so a program can pause when it runs out and resume in a later transaction. The ladder between them is measured, not asserted: see the README for the table, and ladder\_test.gno for the harness that produces it. Live demo: [r/moul/x/vm/bfdemo](/r/moul/x/vm/bfdemo)(/r/moul/x/vm/bfdemo/v0).