<
no.to...@gmail.com> wrote in message news:jgilma$srd$1...@dont-email.me...
> I recently tried to ask this question here, and got
> replies that <I should buy the forth book>.
Yeah, just ignore those ...
There is quite a bit of good Forth information available online, but it's
not comprehensive. Some is easy to locate and some isn't. Ask ... If you
think or feel you need more in-depth references, a library, bookstore, or
online bookstore will provide what you need.
> I've read the forth-book decades ago, [...]
Ok.
> [...] and anybody
> who's read Backus' AGM prize winning 70's
> publication will know what I'm driving at.
Uh ... ?
If it's important for me to know as to what you are referring to, you'll
have to expound. Don't mention Fortran. It sucked!
1970's? You know ...
You really should probably forget about most, but not all, computer
programming concepts developed prior to 1978 or 1981 anyway. The
standardized microprocessor based computing platform that we're familiar
with today didn't exist prior to 1974 and wasn't widespread until 1984 or
later. Concepts developed prior to then weren't as fully developed until
much later due to the chaos of early competing and radically different
computing platforms. Any good concepts that existed prior to 1974, which
are exceptionally few IMO, still exist today in some form or another.
Concepts from around that time which are still good are: C and Forth,
contiguous memory, various algorithms, 8-bit bytes and ASCII and EBCDIC,
etc. I.e., although I know how to power a vacuum tube, construct a cpu from
logic-gates, such ancient things serve little to no purpose today. Most of
the ideas and theorems that power corporations like Google and Facebook and
Apple products are modern.
> The *nix approach of processing text via serially
> connected filters instead of the painfull and primitive
> use of pointers and inindices, fit's naturally with forth's
> <cascading functions via the stack>.
>
I just converted by mostly fig-Forth like Forth interpreter in C from buffer
address and offsets via IN to IN using pointers directly. Straight pointers
fit better with the C code and primitives or low-level words in C. So, if
you know that some modification or change suits your situation better, you
should just go ahead an use it. I.e., if you think "processing text via
serially connected filters" will work better for Forth, go ahead and
implement it. You'll either prove or disprove it.
> [reformat example snipped]
...
> Since forth is FORCED to use the serial filtering paradigm,
> I'm speculating that over the decades, a suitable library
> of <text filters> has evolved. And probably this would be
> seen in a 'classical' forth text editor.
Why is Forth "FORCED" to use the "serial filtering paradigm" ?
That reformmating is fairly easy to do in C. With no intent of stirring up
"C is better at it than Forth arguments" to which I like to respond, Forth
programmers should be able to come up with some solution.
> So, what is the approach of THE forth editor?
WHAT "forth editor?" What are you talking about? BL WORD? QUERY?
FIND? INTERPRET? The "inner interpreter" and "outer interpreter"?
> Is there anybody here who has thought about the deeper
> principles behind forth, [...]
What "deeper principles"? Lack of syntax? Chaos and confusion? Do it
yourself? Lost in numerous nested colons and semicolons? Keep track of
stack data in your head? You can't do that in ANS? No interpretation
semantics, really? Is that stack diagram for real? Syntax error?!?!?
Obviously, being pro-Forth as I assume you are and know most others are
here, you should qualify what "deeper principles" actually means to you.
The only standard principle I'm aware of is "factoring". The process by
which you code things in the smallest possible unit. Unfortunately, that
makes for small code, but not necessarily fast code, especially with
interpreters.
So far, during the implementation of my Forth interpreter in C, I've not
seen any "principles" that I would classify as "deep". The classic Forth
interpreter is novel in a few regards. However, that novelty is lost when
combined with a language like Forth that was not well suited to it as it
could've been. Also, ISTM, that Forth seriously missed the mark in a few
critical areas, at least as compared to C. Unfortunately, many other
languages, especially of the same era as Forth and C, suck so bad that Forth
looks brilliant by comparison, e.g., Fortran, Pascal, BASIC, Cobol, Snobol,
Lisp, etc. Most modern languages are either built upon C or are convertable
directly to C, so they typically inherent C's abilities and flaws. Forth
and C are the two most widely implemented languages. That said, let me know
when you find people building languages upon Forth ... Otherwise, most of
Forth fits very well with C, at least in my interpreter, and is simple to
implement, but time consuming. There are a few things in Forth that are
more complicated to implement. The compiled or high-level words are built
upon the primitives or low-level words. This is no different than any other
language or language library, at least at first. I provided a couple of
posts on this a few years ago to various NGs with compartive data. I
believe one was to c.l.f. You need some constants, and a couple stacks, and
an few "registers" for an interpreter, and a whole lot of words coded in
Forth, etc.
Rod Pemberton