⚠️ CoreVM API is subject to change.
How to write a program for CoreVM
Rust
CoreVM programs have single entry-point called main
with index = 0
(the default).
The simplest program looks like the following.
extern "C"
CoreVM programs produce output into one of the output streams. Currently console and video streams are available. The simplest program that outputs "Hello world" to the console output stream is shown below.
use println;
extern "C"
Copying out the data is an atomic operation:
the array passed to e.g. yield_console_data
is either fully copied or not copied at all.
If the array can't be copied, the program execution is suspended, and
the continuation is possible via creating another work package.
C
Here is the example program written in C.
;
uint64_t