CoSy
Starting Point
  • 4th.CoSy
  • Planetary Temperature
  • CoSy/Life ; CoSy/Liberty
  •  FaceBook ; Twitter 
         ; YouTube ;

  • © Bob Armstrong


    From a FaceBook Messenger exchange

    The only thing I said, I did never found the starting point, how to help you with your project. I did not find, where REVA or Forth ends, and Where COSY Begins, 
    | 20200320 |
    Oh , man , you are touching on a clear weakness . But one I think common in maths . When the gestalt has so many aspects which you have to describe in some sequence before the totality can be ` groked . Like what a determinant is .

    On my YouTubes  I have tried the describing-the-elephant by examining a tail or a leg approach going thru a single line of code .

    Thru the course of discussion I've concluded the most direct way to begin migration and the most powerful single thing is to get the http://cosy.com/4thCoSy/Code/lib/net/sockets vocabulary integrated with CoSy and a tcp/ip link between an instance of CoSy and an instance of Foth2020 . I think it's essentially trivial for somebody whose ever done that stuff . I think one reason Arthur never had any interest in enhancing the GUI in original K was that he saw TCP/IP as the universal interface between processes . But these comments may just reflect how little I understand the world outside of CoSy .

    CoSy's unique power comes from the fact that it's a ` FirstPerson system , made by me for my own ambient use . But that's also a major barrier to entry .

    In any case , connecting the 2 as peers supplies immediate synergies and makes possible the exploration of each side .

    In terms of where Reva ends and CoSy begins , verbs ' venn

    : venn 2p (' R@ L@ ~membv LR@ membv LR@ ~membv ') 2P> ;
    | returns list of 3 lists : ( x nin y ; x in y ; y nin x )

    can very quickly determine the intersection of vocabularies .

    You've given me a lot to work on . But , again , the continued doing and enhancement of my accounting abilities and responsibilities is my unavoidable priority .




    Again , If you are writing in some system that has already solved memory management in anything other than Forth , it is a Toy which has NOT extended the domain of Forth to the level of those languages . It is trivial to create a Forth if you have memory managed objects , but it's going the wrong way . See https://youtu.be/0fVK_A209Fc for the essence of Forth in a few lines of CoSy .


    You did not understand, 😬 they keep running win32forth.exe absolutely normal implementation, but they did the SOCKET communication to A JAVASCRIPT program that works as server.

    Oh !  I thought you were saying they were one of the many who implement Forth in some sense in memory managed language like I've recently seen talked about for Perl . The fundamental serving has to be done by the Forth . JavaScript may be a useful intermediary to the Web . Again , as I understand it , the fundamental and universal interface is thru TCP/IP which is useful even as ` localhost . I believe that Kx even uses TCP/IP for communication between K processes on on the same processor and across processors .

    Again , there's little point in my doing anything as a solo act . [ The same is true in terms of modeling planetary temperature physics in CoSy ] I did play with K's small sockets vocabulary to set up inter-process server-client communication a good number of years ago , so I know it's not terribly complected . But , again , there's no point in my just learning another way to talk to myself .



     What does APL add to open native Forth ?

    Speaking to a Forther who understands the unique simplicity , openness and and understanding of the nature of ` compiling and direct interaction with hardware of Charles Moore's language , I'll address what Ken Iverson's , as retold by Arthur Whitney , APL adds .
    ( If not familiar with APL I strongly suggest reading or watching some of the many references to APL . See the 1998 K Reference Manual for the direct legacy from  which 4th.CoSy evolves . )


    In a word , I'd say  plurals .

    And that implies objects . The most basic object on all computers is an address space . Forth provides a minimal vocabulary laying out in a single address space a dictionary capable of appending new words to itself .  An address space is an integer indexed list of constant sized cells themselves lists of bits .

    Nouns
    Lists are  CoSy's nouns . So the most fundamental vocabulary CoSy adds to a Forth vocabulary is lexicon to allocate and free address spaces with a simple 3 cell header containing the fundamental information about themselves :
    `( type count refCount )`
    CoSy verbs generally expect addresses of CoSy lists as arguments . Ones which expect a naked cell are generally prefixed by a ` _ .

    CoSy opening screenshot >

    A cell gives an awful lot of space for types and currently only `( char int float )` are defined in addition to a general list , a list of addresses of lists , which is type 0 .

    When a list is created , its reference count is set to 0 . No other object , no other list refers to it . But , for instance , if it's just an item in a higher level list , it reference count will be incremented appropriately . In general on exit most Forth level verbs free any argument which has a ref count of 0 .  The vocabulary , I'm inclined to call it algebra , for the accounting of references is the enabler for everything else . But a crucial piece of this vocabulary is the ability to convert these recursive lists of address spaces to and from a linear form for transfer and storage .

    Verbs & Adverbs

    Iverson came to prefer the ordinary words verbs and adverbs to APL's original functions and operators . A verb is simply a word which takes nouns as arguments . Adverbs take verbs along with nouns among their arguments .  See the top of the distribution  ` text log for executable examples .

    Two of Moore's brilliances make these constructions much simpler and flexible than other APLs .
    • Forth's Read-It Do It RPN syntax with words simply being any non-blank string of characters
    • Because of Forth's unique transparency the address of any word , including verbs can be placed on the stack trivially using the word ' , simply a quote . It puts the address of the next word in the string being evaluated on the stack . A verb can be defined inline by enclosing in { and } with the same effect .
    Here are examples :
     5 _i iota    |>| 0 1 2 3 4   | takes a naked 5 off the stack convert it to a 1 item
    | then ' iota ( an ancient APL name ) returns a list of first 5 integers , ie: an
    | index into an address space .
    Most of the adverbs in CoSy , as in previous APLs , apply a verb to each item in a list or each corresponding pair of items in a pair lists .
     It can do this because the count of items in a list , for which I'm stuck on the venerable APL name rho , is the second cell in the header . And , an inovation which eliminates a lot of complexity in APL and possibility of bounds errors , is  all indexing is modulo .

    Thus almost all loops become words taking a list or lists , a verb , and an adverb .  Following Arthur Whitney , there are 4 basic flavors :
    list ' verb 'm            | 'm for monadic , ie: single argument
    Llist Rlist ' verb 'd     | 'd for dyadic , ie: 2 argument . apply verb to each pair
    Llist Rlist ' verb 'L     | 'L for apply  the Rlist as a whole to each item in Llist
    Llist Rlist ' verb 'R     | 'R for apply  the Llist as a whole to each item in Rlist
    For example :
     ` asdf 5 _i iota ' take 'R
    (
     
     a
     as
     asd
     asdf
     )


    This is why I consider APL kind of like a Fourier transform of scalar programming language space .



     Join CoSy αlphas .
    Charter 1 year Membership just $25
    Join the development discussion , start your own project ,
    simply use CoSy
     to assist you in your everyday business of life
    Inclusion and Access to Member simple open email list , cc not bcc .
    and Members archive directory


    Disqus allowed HTML
    comments powered by Disqus


    --

       
    Whole CoSy
    Locations of visitors to this page
    CoSy
     I reserve the right to post all communications I receive or generate to CoSy website for further reflection .
    Contact : Bob Armstrong ; About this page : Feedback ; 719-337-2733
    Coherent Systems / 28124 Highway 67 / Woodland Park , Colorado / 80863-9711 
    /\ /\ Top /\ /\