I got to wondering how much code it would need to implement the BrainFuck language in Forth. Turns out not much:
create array
8000 chars allot
variable pointer
array pointer !
: reset ( -- )
\ zero bf memory and reset pointer
array 8000 0 fill
array pointer ! ;
: peek ( -- )
pointer @ c@ ;
: poke ( -- )
pointer @ c! ;
: > ( -- )
\ increment the pointer
pointer @ 1+ pointer ! ;
: < ( -- )
\ decrement the pointer
pointer @ 1- pointer ! ;
: +