Sujet : Re: The joy of FORTRAN
De : 186283 (at) *nospam* ud0s4.net (186282@ud0s4.net)
Groupes : comp.os.linux.misc alt.folklore.computersDate : 20. Oct 2024, 05:13:15
Autres entêtes
Organisation : wokiesux
Message-ID : <MZScnWkZT7T_Hon6nZ2dnZfqnPWdnZ2d@earthlink.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 10/6/24 11:02 PM, rbowman wrote:
On Sun, 6 Oct 2024 16:06:14 -0600, Louis Krupp wrote:
GNU Forth... I don't know enough about it to have an opinion.
https://gforth.org/manual/Forth-is-written-in-Forth.html
Forth is an odd beast. There is a very small engine that has to be built
for the processor in question to handle words.
https://github.com/forthy42/gforth/tree/master/engine
gcc can handle that since it is C code.
The original Chuck Moore FORTH slightly pre-dates the
i4004 chip.
As a half-a-step above ASM the syntax is (sort of) more
readable. The 'stack' approach to dealing with both
commands and data could be implemented very simply
(but you HAD to be fully aware of what was on the
stack exactly where). FORTH also supports subroutines
and you can make a lib of those.
The interpreter can be VERY small - fit into a little
old ROM chip. I think one company made CPUs with an
inbuilt FORTH kernel. It is reported that the first
language ported to the new 8088/8086 processors way
back was FORTH.
It was especially popular in the 70s/80s for minimal
systems - especially for academia/space. If you had a
telescope on a mountaintop in Chile and a 110 baud
connection then you could still easily edit/test
the control program from sunny Cal. I know an old
astronomer - he is still fluent in FORTH.
Modern chips/systems and 4/5-G or sat connections have
kinda made FORTH redundant - but it may still have a
place for some 'industrial' and remote-sense apps
using power around that of an Arduino or less.
Interpreters can be handy sometimes.
Somewhere I've got a 'CPL' interpreter. CPL
became BCPL which became 'B' which became 'C'.
gFORTH is kind of a 'cheat' - just a translator
into 'C'. What you want is a native interpreter.
https://www.forth.org/compilers.html SOMEWHERE I came across a whole FORTH dev environment
for Linux but accidentally deleted it.