var ecalls = include "ecalls"; var make_ipc_buffer = ecalls.make_ipc_buffer; var terminal; terminal.init = terminal_init; terminal.write = terminal_write; func terminal_init(){ // setup a buffer with the TextIO protocol var buffer = make_ipc_buffer(false, 0); terminal.buffer = buffer; } func terminal_write(value: String){ // TODO: write value into buffer according to TextIO protocol }