On Thursday, June 10, 2021 at 8:09:45 AM UTC-4, dxforth wrote:
> Here's a disambigufier for aberrant implementations :)
>
> : ," here ," count chars + here - allot ;
This is absolutely what I do not want to do, though. If I
feel compelled to override a standard word (though it's not
standard yet) with a slightly different implementation, won't
others be, as well? If they do so, and multiple source files
are included, suddenly we have several different overrides of
the word, and a bunch of dead/redundant code hanging around.
And hopefully no one includes source that was actually
expecting alignment.
I'd rather kill the problem at the source by deciding on a
good implementation before the word gets standardized with a
sub-par one.
Like "literal"... why on earth does it not have interpretation
semantics? Interpretation mode, given the existence of "["
and "]", is clearly not the same thing as "not compiling a
word" mode. I could certainly see a specification for
"literal" having a problem when there is no word definition
being built, but it seems far more intuitive for code to
say:
[ char Z char A - literal ]
rather than:
[ char Z char A - ] literal
The first implies that the literal value was something that
was computed on the data stack at compilation time, while
the second mode is misleading unless you understand "literal"
to be immediate, and yet it's required.
It really feels like, beyond STATE, there is another mode of
interest stating whether or not a word definition is currently
being built. I can see "literal" throwing an error if that
mode isn't "yes", and "," throwing an error if the mode isn't
"no" (unless you're using some internal version of "," because
you're the system developer and you know what data should be
encoded into a word definition).
It is this other mode which the standard seems to confuse with
STATE in terms of what words should be allowed where...
whether they should have compilation and/or interpretation
semantics. Why is there both ." and .( for instance? I mean,
sure you'd have to [ ." <something>" ] if you wanted to emit
something during the compilation of a word, but while that is a
lot more characters, it feels far more intuitive to me as to what
the developer wanted done right there ("pause word definition,
emit some text, resume definition"). What's more, abort" should
work the same in interpretation and compilation modes (I think
I've ranted about this before). I want to do things like:
[UNDEFINED] b@ abort" need a byte-access method"
or:
here ," " here - -1 <> [IF]
." WARNING!: ,\" wastes space"
[THEN]
(but then, ,\" doesn't work either, does it?)
It feels like half the standard is stuck in a 1980's mindset
(case insensitivity... single, flat namespace... modal BASE...
no escaped characters or native strings... every byte or
machine cycle counts... read blocks from disk) while the other
half is trying to just work around the problems and not correct
them (search order wordset, but no standard wordlists defined...
some words support character escaping... ," can burn 7 bytes for no
reason... file I/O exists).
It almost feels like we should make a clean break from the
past standard, either ditching backward compatibility
altogether or having it a mode by which old code can be
compiled (no... not a mode variable, just some "compat-include"
notion, or something), and rebuilding the standard to be
a bit more modern while retaining the interesting aspects
from the original.
--Jim