On Tuesday, July 12, 2022 at 11:12:01 PM UTC+2, Gerry Jackson wrote:
> Without wishing to be rude, just honest, that's what I thought about
> your implementation of REPLACE-ALL a few weeks ago.
It's always nice to see people starting their rebuttal with a well-meant
compliment..
> I think you over-snipped there, destroying the link between dxforth's
> statemenet and my response
.. and unrelated remarks and diversions.
> What I meant was that if, say, I wanted to use a
> regular expression package and I was familiar with regex syntax from
> using another language like PHP, PERL, C ... and such a package already
> exists in Forth, then it makes sense for me to use that package as long
> as it works.
No, it doesn't - unless you're porting that particular PHP, Perl or C program
to Forth and need it to preserve a certain functionality. I myself got some
lightweight regex libraries and I've used them only once. Because regexes
are built to recognize certain patterns. They "compile" or interpret an
expression. I thought I could bypass the whole shebang an wrought a package
that could recognize patterns in Forth using Forth an bypassing that
extra engine.
> >> Dismissing them due to a narrow-minded dogma is silly or worse.
> > Since you provide absolutely zero arguments why this would be true, I tend
> > to dismiss this statement as "unfounded" and "without merit".
> I tend to regard it as self-evident.
Ok, we're getting in ontology territory here. You wanted it, here we go:
(a) Precisely quote the principle and prove its origin;
(b) Prove it is untrue;
(c) Prove that is is a dogma, given that the definition of a dogma is "a principle
or set of principles laid down by an authority as incontrovertibly true";
(d) Define "silly" and levels of "silly" (since it's "worse")
(e) Prove that (given a thru c is true) the application of d is appropriate.
I wouldn't call that "self-evident".
> Well locals and the file wordset are not just C-isms, I would guess that
> most languages have locals and similar file operations and so, at least
> for the latter, familiarity still applies.
Find a language that cannot be traced back to Algol in some way. Forth is
NOT a descendant of Algol, so this cannot apply to Forth. It's built on
entirely different principles. It's comparing trains to cars. Even driven a
train and wondered where the steering wheel was?
> Now before you blow a gasket
> let me say that I hardly ever use locals, the first ANS attempt was
> abominable but has been improved by Forth 2012. However, IIRC, it was a
> lot of work to implement them so I'm not over-impressed with them.
What you do or don't do is irrelevant unless you can illustrate a principle you
put forward. I can (and have) written several articles on NOT using locals and
getting results in Forth without too much stack acrobatics.
I DO support locals in 4tH (although in a slightly different way), but I very
rarely use them - and NEVER in libraries, because I think they're basically
wrong in a Forth context.
> Also I thought your 4th's file handling words are a good approach.
Flattery will get you nowhere ;-)
I consider it to be a "fortunate accident", given their history. It simply began
as a "redirection" issue and it required a lost of thought to turn it into something
that didn't break too much code and still was architecturally sound.
> > The simple fact that we, as a community, have been unable to come up with any
> > Forth-like alternative is somewhat worrying.
> Well have you tried or taken part in RfD discussions to disagree or
> propose alternatives.
In the old days those took place HERE. And like I said: I basically gave up on
Forth 200x. If there is a CfV I will still participate, though.
> what other C-isms in the standard? Off the top of my head, I can only
> think of character syntax e.g. 'X' which is trivial to implement and
> easier to write than CHAR X or [CHAR] X. Of other Forth 2012 words, I
> think SUBSTITUTE is awful and over complicated. Also I think ANS Forth
> could be greatly improved by pruning/rationalising stuff inherited from
> early Forths that are there because of resource limited computers in the
> 1970/80s.
It's C. It's irrelevant whether it is easy to write or not - it's not Forth. My
argument for that is simple. Forth is simple - and hence elegant. If I have
to implement something that breaks that simplicity (and hence its elegance)
I'm NOT going to implement that.
In my recent YouTube I show how simple and elegant Forth's tokenizer and
parser is. Things like 'X' break that internal simplicity - it makes my parser much
more complex. CHAR is a parsing word - and fits perfectly into that scheme.
F% could also be a parsing word for a float. D% could be a parsing word for
a double. No need for recognizers there (which are just UGLY hooks). They
fit the original schema and make the language perfectly expandable.
C-isms break that scheme and require lots of (often ugly) code to implement.
> Do you distinguish between a library and a tool? I regard a regex or
> printf package, with essentially single functionality, as a tool, not a
> library with multiple functionality.
> > Because there are almost always better ways to do it.
> Since you provide absolutely zero arguments why this would be true, I
> tend to dismiss this statement as "unproven" :)
You ask me to distinguish between a tool and a library and then go on to
speak of packages. But ok:
- A library is a set of words that cover one particular field of functionality
that can optionally be added to a program or be part of another library;
- A program is a piece of software that can be executed by a CPU or
another program and provides a certain functionality. A program may
rely on dynamically or statically linked libraries and require other
(non-executable) files in order to function properly.
- An application is a set of programs which provides a set of functionalities,
usually tied to a business process;
- A tool is an application or program targeted to administering or aiding
to the administering of IT services;
- A package is a set of libraries and/or programs intended to be installed
on a particular system.
So yes, regex, printf - all libraries. But very unForth-like libraries. And that
brings us back to square one.
> Having echoed you, your 'better ways ..." comment is true for lots of
> software and not just Forth. But then again "better ways" can mean
> different things.
Better ways: "A style of programming that is better suited to align with
the principles of Forth - or programming in general by requiring less code
and boasting a better performance without the loss of end user functionality".
Happy?
Hans Bezemer