Sujet : Re: Back & Forth - 4tH I/O and You
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 18. May 2025, 02:05:47
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <b2a4690cc4cdcb9e39310166d37070ab2a16d8b2@i2pn2.org>
References : 1
User-Agent : Mozilla Thunderbird
On 18/05/2025 1:02 am, Hans Bezemer wrote:
Back & Forth - 4tH I/O and You
How is 4tH, a Forth compiler, able to define an entire I/O system with so few words? And still capable of supporting most of the ANS FILE word set? Well, the idea isn't new - and was inspired by an unexpected computer.
https://youtu.be/4G_15r01bmc
Many forths have (or had) a mechanism for redirecting console output.
Usually this was redirection to a printer as most OS had a dedicated
character-oriented channel for the latter. OTOH this redirection
isn't something I've used. Only one application springs to mind and
even then it felt out of the norm:
\ Set EMIT to OFILE
: DISK ( -- )
['] writech [ sys-vec 4 + ] literal ! ;
For me it's redirection that feels C-like and the ANS file wordset
a blessing relative to the native FCB file mechanism of CP/M (as
clever and memory-efficient as the latter was).
As always, another thought-provoking video. Thanks, Hans.