Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gems Found Cleaning Shelves - "C -vs- FORTH" Debate

1 view
Skip to first unread message

25B.Z969

unread,
Sep 12, 2022, 10:13:19 PM9/12/22
to
"Computer Lanaguage" magazine, premier issue, sometime in 1984.

Good articles :

"BASIC Becomes a Structured Language"
"Programming In The UNIX Environment"
"Improve Your Programming With Structured Techniques"
"Bubble Sort, Insertion Sort and QuickSort Compared"
"COBOL: Pride and Prejudice"
"Exploring ADA and Modula 2"

Lots of ads for development software, "C-MANX" and
Aztec-C (I have a Z80 copy of that I've used in a
virtual machine) plus macro-assemblers for Z80s's
alongside 8086 chips and 6502 chips and the
wonderfulness of RATFOR and .....

But the main article revolved around whether that
newfangled 'C' language was really better for
lower-level systems programming than good old FORTH.

Yes, that was a REAL debate.

Now most of you who aren't starting to lust for
the Turbo-X walker with the built-in grocery/meds
tray have probably never touched FORTH. However,
clearly, there WAS a time ......

FORTH is an ultra-simple stack-based interpreted language.
It was writ by an astronomer to provide easy operation of
big telescopes back when a 'hot' CPU was an 8080 or 6800
or less and "a lot" of memory was maybe 4 KILObytes.
It is quite possible to implement a full FORTH interpreter
on such tiny systems and have room left over. You can
get FORTH interpreters for some PIC microcontrollers
and similarly limited environments. I *think* I remember
a version for FOUR-bit chips ... but you had to burn it
into a ROM chip.

FORTH commands push data onto a stack and then you enter
some kind of command to deal with it. "2 2 +" pushes a
2, and another 2, onto the stack and "+" is for adding
the nearest two numbers on the stack together. You can
print that, in 'live' mode, or DUP it and pass the result
to something else. FORTH uses a lot of very cryptic-looking
operators.

From the very low-level stuff, you can define "Words Of FORTH",
sort of like procedures or functions, that make more sense,
do something more complex. You can make crude libraries of
such "words".

FORTH *is* still around in various forms. There's gforth,
the GNU font-end that's in most Linux repos. There are
also stand-alone interpreters/"compilers" for Win and Lin.
There are even some For-Pay versions plus IDEs to be had.
It's about one step above assembler, more clear than BrainFuck,
and as it's usually used in interpreted mode you can modify
the "words" kinda on the fly as needed.

But, this mag was from 1984. You COULD get 'C' compilers
(multi-pass + linker) for the orig IBM-PCs by then. (Got
one of those in a DOS VM, IBM-Pascal too - FUN !). Thing is,
FORTH was well-established at that time, had lots of useful
libraries 'everyone' knew, and was thus both very capable
and, being interpreted, "handy" kinda like Python is
these days. There WAS a case for a "debate".

These days, if it has to have a GUI, especially by Friday,
I'll write it in Python-TK first and the Lazarus/FPC next
week. Services ... well 'C' of course. I don't really think
about FORTH anymore - but DO install it as a sort of reflex
anytime I bring up a new Linux box.

This is the sort of gem you find that's fallen behind the
other dusty books on the shelf. Maybe next week I'll get
into the old BYTE article that tells you all about RS-485
networking (again, still in use - esp in industrial
environments ...slow but very noise-resistant). RS-485
is kinda like what you'd set up with Novell Netware (in
the big heavy red box) that used coax with multiple 'T's
in the big long string to each PC. No 'stars' with more
'stars' back then ....

Bobbie Sellers

unread,
Sep 12, 2022, 10:44:24 PM9/12/22
to
On the Amiga I had the delightful use of a full featured Text Editor
which was shareware from a nearby city and paid for every update that
the authors" charged for. I also took the stuff they were not charging
for. It was programmed in "Forth" called that becasue when it was
devised fourth was beyound the reach of the naming protocols. So
with such a great product I read a programming book about forth
and it sounded really great but I never was interested in those days in
actually using even such a great sounding language.
Nowadays I use Kate and KWrite. Not quite as good as my Textra.

bliss - PCLinuxOS is the answer if you can formulate the question.

"The rule is perfect: in all matters of opinion our adversaries are
insane." (Mark Twain)

--
bliss dash SF 4 ever at dslextreme dot com


Charlie Gibbs

unread,
Sep 12, 2022, 10:50:25 PM9/12/22
to
On 2022-09-13, 25B.Z969 <25B....@noda.net> wrote:

> FORTH commands push data onto a stack and then you enter
> some kind of command to deal with it. "2 2 +" pushes a
> 2, and another 2, onto the stack and "+" is for adding
> the nearest two numbers on the stack together. You can
> print that, in 'live' mode, or DUP it and pass the result
> to something else. FORTH uses a lot of very cryptic-looking
> operators.

<snip>

I heard about Forth (not in all caps, please) and it sounded
interesting enough that I bought Leo Brodie's _Starting Forth_.
I found a CP/M implementation and played around with it a bit,
going as far as writing a Sieve of Eratosthenes program.

I never went much farther with it - I was busy moving from
various assembly languages to C at the time - but it was
a fun language to play with.

Forth love if honk then

--
/~\ Charlie Gibbs | Microsoft is a dictatorship.
\ / <cgi...@kltpzyxm.invalid> | Apple is a cult.
X I'm really at ac.dekanfrus | Linux is anarchy.
/ \ if you read it the right way. | Pick your poison.

25B.Z969

unread,
Sep 13, 2022, 9:05:58 PM9/13/22
to
On 9/12/22 10:50 PM, Charlie Gibbs wrote:
> On 2022-09-13, 25B.Z969 <25B....@noda.net> wrote:
>
>> FORTH commands push data onto a stack and then you enter
>> some kind of command to deal with it. "2 2 +" pushes a
>> 2, and another 2, onto the stack and "+" is for adding
>> the nearest two numbers on the stack together. You can
>> print that, in 'live' mode, or DUP it and pass the result
>> to something else. FORTH uses a lot of very cryptic-looking
>> operators.
>
> <snip>
>
> I heard about Forth (not in all caps, please) and it sounded
> interesting enough that I bought Leo Brodie's _Starting Forth_.
> I found a CP/M implementation and played around with it a bit,
> going as far as writing a Sieve of Eratosthenes program.
>
> I never went much farther with it - I was busy moving from
> various assembly languages to C at the time - but it was
> a fun language to play with.
>
> Forth love if honk then

Heh ...

Maybe Yoda talked in words of Forth ? :-)

Forth was a product of "limited" systems prevalent
in the early 70s to early 80s ... boards far less
powerful than a VIC-20 or even a ZX-80.

Academics and engineers DID love to use digital
though, but the trick was in putting something
small ON them so you weren't stuck with ASM where
you'd have to compile and then copy from a bigger
system.

As said, Forth was writ by a radio astronomer who
wanted to take advantage of digital control to steer
his big dishes around - but needed more flexibility
and much faster concept-2-result. Burn the interpreter
and your selection of vital libraries onto a ROM,
hook up a cheap serial terminal and you could write,
mod, debug, run all in-situ on those tiny little boards
up on a cold mountain. The super-simple syntax and
fairly anal adherence to using the stack for everything
made the interpreter small.

For its time and place, Forth WAS a logical choice.
I wouldn't really recommend it for much of anything
these days except maybe certain microcontrollers, but
it still IS kind of interesting. As there ARE for-pay
development systems out there it would seem there are
continuing uses for Forth.

If you're interested :
http://forth.org/compilers.html
(not all links are good)

I also found :
https://en.wikipedia.org/wiki/4-bit_computing

The 4-bit processors were programmed in assembly language
or Forth, e.g. "MARC4 Family of 4 bit Forth CPU"[7] because
of the extreme size constraint on programs and because
common programming languages (for microcontrollers, 8-bit
and larger), such as the C programming language, do not support
4-bit data types

I think Epson still makes 4-bitters - for digital keyfobs
or simple remotes and such. 8-bit chips are cheaper these
days however. I did look at the Epson docs once though -
those are impressive 4-bitters, gobs of flexibility
combined with really low power consumption and simpler
board construction. I think they're all mask-programmed
now though ... send the company your code and they
embed it permanently on the chip die and sell you 100,000
of them.

Hmm ... didn't 'C' used to support 'nibbles' - 4-bit data
types ??? Maybe I misremember. You could FAKE 'em easily
enough though.

25B.Z969

unread,
Sep 13, 2022, 9:23:03 PM9/13/22
to
There's little you couldn't do, efficiently, in Forth. It
was kind of the Python of its day, a 'handy' language.
I did a few Forth programs, but never tried to build
anything really complicated like a word processor.

I did write the equiv of 'Notepad' in ASM once though,
but that was for fun (and was lots better than the
'edlin' that came with the early PCs).


> bliss - PCLinuxOS is the answer if you can formulate the question.


I don't like the fat mouse cursor :-)

But, nevertheless, I do have it on one of my sub-laptops
at the moment.

'Bliss', to me, is spelled 'MX'.


> "The rule is perfect: in all matters of opinion our adversaries are
> insane." (Mark Twain)


Heh heh ... notice how The Rule STILL applies - daily,
loudly - 100+ years later :-)

Bobbie Sellers

unread,
Sep 14, 2022, 12:46:42 AM9/14/22
to
Then you can pick a much smaller cursor at least in KDE.
>
>   'Bliss', to me, is spelled 'MX'.
>
>
>> "The rule is perfect: in all matters of opinion our adversaries are
>> insane." (Mark Twain)
>
>
>   Heh heh ... notice how The Rule STILL applies - daily,
>   loudly - 100+ years later :-)

All the great humorist's work endures.

Take Groucho and Captain Spauling Song which states eternal verities.

All How I admire your longer experience and greater knowledge of all
things *nix. I have run MX in VirtualBox to try it out and play Angband.

bliss -Your tag lines (k) were stolen! (more) There is a puff of smoke!

25B.Z969

unread,
Sep 14, 2022, 11:29:02 AM9/14/22
to
I never use KDE ... too fat, esp for low-powered subnotebooks.
LXDE is bliss there - and even then I turn off most of the
limited eye-candy it offers.


>>    'Bliss', to me, is spelled 'MX'.
>>
>>
>>> "The rule is perfect: in all matters of opinion our adversaries are
>>> insane." (Mark Twain)
>>
>>
>>    Heh heh ... notice how The Rule STILL applies - daily,
>>    loudly - 100+ years later :-)
>
>     All the great humorist's work endures.
>
>     Take Groucho and Captain Spauling Song which states eternal verities.
>
>     All How I admire your longer experience and greater knowledge of
> all things *nix.  I have run MX in VirtualBox to try it out and play
> Angband.

Linux is now far too big for anybody to "know it all"
(OK there may be someone who lives in a basement with a
case of Jolt Cola and Twinkies). Ask and someone with
the right spectrum of experience will answer (ok, maybe).

MX is a very good "medium" distro that seems to cover the
waterfront quite nicely. They include some of their own
special utilities/tools - some of which I wish could be
ported over to the other Deb derivatives. I keep MX on USB
sticks for emergencies, in a VM *and* its own real partition
on my work boxes plus on my personal PCs. There's a reason
it's been #1 on the DistroWatch list for so long.

Before MX there was "Mepis" and the minimalistic "Antix"
(you can still get pure AntiX). So, some clever people
put the M and X together and the hybrid was gold.
0 new messages