Re:Running Forth Unikernels
by abecedarius on Monday April 01, 2019 @05:12PM
(#19548277)
ANS Forth does include file I/O as well as blocks. Back when I worked at FORTH, Inc. we all just used blocks.
(also iirc EMPTY-BUFFERS predates ANS Forth, though maybe it wasn't standard then.)
- BLOCK: reads an individual block, returns address where it was loaded.
- UPDATE: marks most recent block as dirty.
- FLUSH: writes out all dirty blocks.
ANSI forth (I think) added EMPTY-BUFFERS, which marks all blocks as not-dirty.
If you wanted more, you could implement a file system on top of that.
Example usage at http://wiki.c2.com/?ForthBlocks (includes a full-screen editor)