Module adapter

Module adapter 

Source

Functions§

clock
('host clock): nothing in the floor can read a clock and nothing in a task can wait for anything but a message.
disk
('host disk): ('write path text), answering 'ok.
files
('host files): ('read path), answering the text, and ('root), answering where fetched modules were put.
modules
('host modules): the impure half of the module system.
stdin
('host stdin): ('read) or ('read prompt), answering the text or 'eof. A prompt is ignored on a stream that is not a terminal, and a cast is dropped since there is nowhere to put the line.
stdout
('host stdout): ('write v) and ('line v), answering 'ok.
terminal
The interactive console: ('write v), ('line v) and ('read prompt) on one peer, because ordering between printing and prompting is the whole difficulty. Sharing one inbox makes the channel’s order the screen’s order; two channels would let a print land mid-line. Reading a tty line blocks, so a thread is occupied either way.