-------- Forwarded Message --------
Saturday evening I
finally got down to watching Sam's talk . It's excellent . Thank
you Sam . I think there are few others who could have gone thru
the code you did as clearly as you did .
I have clipped it and uploaded it to my Coherent Systems YouTube
channel . I'll be annotating it anon . For the nonce , here
are some thoughts at timestamps relevant to the beginning .
- 02:11 | It is relative .
- 03:30 | Once an object is allocated , I don't see why
performance should not be as good as any static allocation .
Which is not to say my implementations are optimal .
- 05:05 | I chose Reva because it was "light-weight" compared
to Win32Forth and , for that matter Stephen Pelc's VFX . And
had aspects I liked from my path in APL and K .
The symmetric vertical bar " | " comment symbol is
one . As is case-sensitivity .
I didn't know when I defined s" to be a CoSy
string that it was used by some standards like G-Forth . - 07:00 | CoSy's
size . Not super important , but diverted me into seeing just
how many lines actual are in the CoSy.f file . As
Sam notes , there are lots of comments because comments are
included with definitions and the help function ??
simply searches all source files for the occurrence of any
phrase and returns all text containing it delimited by totally
empty lines . I have recently , when I define or modify words
, started including dates referring to the days in my log on
which I worked on them . Thus additional info on motivation of
development and examples it available in those logs .
But here's the scrubbing I spent more time on than warranted
s" ./CoSy/CoSy.f" F> "nl VM >t0> rho
|>| 1733
| Read file , split on "cr "lf
t0 dae >t0> rho |>| 1375 | delete
all empty lines |
| eliminate full line comments .
t0 t0 { 0 _at s" |" <>i } 'm ,/ & at
>t0> rho |>| 1176
| delete all lines which are totally whitespace
t0 t0 { c>i 32 _i >i ['] maxi ./ } 'm ,/
& at rho |>| 1060
- 08:20 | I've moved the meta pointer ( 4th cell in
header ) referencing words to more where they belong in
sequence . Sam was right to totally skip over them . I know
they are extremely useful from my experience with K's
attributes , but have have only now , working on
multiple windows , started finishing implementing them .
- 10:15 | Modulo indexing is one innovation I'm particularly
happy with . It eliminates , generalizes APL's scalar
extension . ( But singletons still gets some special
treatment , disclosing results of some functions . )
Interestingly it actually makes CoSy's
data structure loops of loops rather than lists of lists . - 12:20 | Basing reference counting at 0 rather than 1 may
optimize some testing , but is a minor matter . I would like
to see the alternative .
- 13:50 | vdup is actually used in only 2 places : eachMcr
where it could be easily replaced , and lower which
converts a string to lower case and , again simply does what
essentially needs to be done .
More important and far more recent is rep which
replicates entire nested lists , and , quite recently :
.. dup rep ; which performs the function of dup
in making totally independent copies of ref counted objects .
It's a great simplifer . - 16:50 | Thanks for recognizing the subtly recursive nature
of ref- . It , and the save and restore functions
in SaveRestore.f which convert the allocated nested
list structures back and forth to a linear file format , are
the crux vocabulary .
- 18:45 | Starting with the each functions , we get
into the area which is the result of bushwhacking which needs
significant pruning . The top level each functions
are
'm 'd 'R 'L for monadic dyadic eachRight
eachLeft . Note that because of Forth's simple RPN
syntax and and ' which returns the address
of a word , whether noun or verb , it is quite easy to
implement what in APL are called operators . I found
it interesting that what APL implemented as commute ,
⍨ , originally , I believe from John Scholes , is simply swap
in Forth .
- 21:40 | If there is a better way to allocate space for
initializing lists of unknown length , I'm all ears . I was
really interested to see Sam's use of here as the
base for temporaries in his over the shoulder demo
. I think much of my code might be different if I really knew
Forth as a Forther before I began .
With a 2^n slot inventory memory allocation , a concatenating
method may be efficient .
- 22:48 | Yes the abandonment of the notion of rectangularity
which K introduced , and with it the default
application of functions along the most nested dimension greatly
reduces complexity . Interestingly , the primacy of the
leading axis is infiltrating APL with the implementation of tally
, ≢ .
- 24:15 I had and and or associated with min
and max backward -- as I found out in the all
whitespace line deletion above . I don't know where a colon
followed by a number is .
- 26:00 Symbols may be one type to far . at the Minnowbrook
2011 APL implementers conference Morton Kromberg who
runs Dyalog
APL asked me what is a symbol other than a string .
Functionally it's just a word . I made a separate type
out of it with a count of 1 rather than the number of
characters . I find that more commonly a pain than useful . I
may discard the type .
Similarly , Arthur has a dictionary type in K
. In CoSy
I have almost exactly copied his structure as a list of 2
lists of symbols and associated values , and a vocabulary
essentially supplying name indexed lists ( which Sam didn't
get to ) . I haven't made them a separate type and have never
run into a problem . Back in 1998 I wrote
about types just being shortcuts for determining the ding
an sich .
But they are a powerful to the point of essential shortcut in
many cases . - 27:30 | I think of iota as generating the index of
an address space . When I first met APL back in the '70s , I
thought ⍳ was the strangest thing in a computer language . And
a language evolved from matrix algebra which didn't even have
a verb for creating an identity matrix .
- 28:10 | A bunch of that Type stuff needs to be
thought out better and cleaned up . The most fundamental are
essential , but I've laid out some which are yet , if ever ,
to be used .
One important point which did not get mentioned is that a
general list , ie: a list of lists , ie: a list of pointers
to CoSy
objects , is type 0 . So , since type is the
first cell in the header , you can simply fetch & test it
. - 30:45 | Yes . Good description of apply
operators . They are what allow for instance a dot
product to be applied to data in , eg: each voxel of a map of
the atmosphere .
I would phrase it as leafs of the lists because the leafs
themselves are generally simple lists of numbers or characters
. - 31:35 | I'm cleaning up scan right now . I plan to
be presenting a bit of APL and Forth and CoSy
to math class when I'm at my 55th Culver Military Academy
reunion next month . Arthur Whitney , probably following
Iverson , has no compunctions simply calling scan integration
.
- I would strongly suggest a type field in the
header . Without it , you cannot have any sort of generic
verbs , nor , for that matter , any sort of general , ie:
nested , lists . But with 64 bit cells a whole cell is rather
overkill -- as it is for most of the items . Looks like you
are providing for max 256 bit items . I'm definitely
interested in looking at it in detail .
Thank you Sam . And for your kind comments . I think your
presentation provides a great resource for anyone interested in CoSy and
branching it in the direction of their interests .
The distillation of the dynamic array vocabulary of APL in the
open simplicity of Forth , I am continually discovering to be more
powerful , and far more flexible than either .
Bob A
Peace thru Freedom
Honesty enforced thru Transparency ,
--
|