Realm

v0

gno.land/r/moul/x/vm/bfdemo/v0

Render

Brainfuck, on chain, a slice at a time

Demo of p/moul/x/vm/bf (the machine) and p/moul/x/vm/vmkit (the host ABI, the fuel meter, the instance store). This realm holds no logic of its own.

A program here does not run to completion. It runs until its fuel slice is spent, then pauses: the realm keeps the snapshot and the next caller pays for the next slice. Realm code cannot pause itself, and a guest can.

Samples

Hello World: 385 guest ops, five tape cells. Finishes in one slice.

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.

Upload Hello World

Echo the input: Reads through Host.Input, which is what the naive interpreter could not do at all: it panicked on ,.

,[.,]

Upload Echo the input

Heavy loop: About 111k guest ops. Give it 20000 fuel and it takes six slices, which is the point.

++++++++++[->++++++++++[->++++++++++[-]<]<]

Upload Heavy loop

Instances

idstatusfuel usedslicesoutput
0000001halted321Hello World

Limits

limitvalue
instances64
source bytes65536
input bytes1024
output bytes4096
fuel per slice5000000
tape cells30000

Transactions

HashBlockTimeMsgCallerStatus
258CBF84E8…898F1B42407,17312d agoCall Stepg1manfre…dlf5ok
403E667F2E…A038DFA6407,17012d agoCall Uploadg1manfre…dlf5ok
0AB01BCFE0…061EE9F8272,69817d agoEnablePkg—ok
DD24EF909B…43A4E4E7272,41217d agoAddPackage—ok

Calls, deploys, and child packages in indexed history.

Call function

Source (qfile)