• Re: Interpreters and parsing in Forth

    From Zbig@21:1/5 to All on Tue May 31 10:41:49 2022
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.

    I wonder if on that rule one could implement Forth-specific (even simple) filesystem, using existing dictionary facility (I mean „its logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create vocabulary etc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to Zbig on Tue May 31 11:47:34 2022
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple) filesystem, using existing dictionary facility (I mean „its logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool
    to build your own DSL interpreter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minf...@arcor.de on Thu Jun 2 12:24:53 2022
    On 1/06/2022 04:47, minf...@arcor.de wrote:
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple)
    filesystem, using existing dictionary facility (I mean „its logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create >> vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool to build your own DSL interpreter.

    Even better if one can avoid it. Moore once wrote a BASIC compiler in Forth. Was everyone impressed? Yes - but a lot of effort for something neither he
    nor they actually needed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to dxforth on Wed Jun 1 22:17:46 2022
    On Thursday, June 2, 2022 at 4:24:56 AM UTC+2, dxforth wrote:
    On 1/06/2022 04:47, minf...@arcor.de wrote:
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple) >> filesystem, using existing dictionary facility (I mean „its logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create
    vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool
    to build your own DSL interpreter.
    Even better if one can avoid it. Moore once wrote a BASIC compiler in Forth. Was everyone impressed? Yes - but a lot of effort for something neither he nor they actually needed.

    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE, Mathematica, ...) have some kind of interpreter on board. It makes using
    them extremely easy and convenient.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Marcel Hendrix on Thu Jun 2 16:37:38 2022
    On 2/06/2022 15:17, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 4:24:56 AM UTC+2, dxforth wrote:
    On 1/06/2022 04:47, minf...@arcor.de wrote:
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple) >> >> filesystem, using existing dictionary facility (I mean „its logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create
    vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool
    to build your own DSL interpreter.
    Even better if one can avoid it. Moore once wrote a BASIC compiler in Forth. >> Was everyone impressed? Yes - but a lot of effort for something neither he >> nor they actually needed.

    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE, Mathematica, ...) have some kind of interpreter on board. It makes using
    them extremely easy and convenient.

    By sophisticated you mean complicated? You do all the hard work so that
    others can have it easy. Either one is getting handsomely paid for it -
    or it's a labour of love :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to dxforth on Thu Jun 2 01:54:02 2022
    On Thursday, June 2, 2022 at 8:37:42 AM UTC+2, dxforth wrote:
    On 2/06/2022 15:17, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 4:24:56 AM UTC+2, dxforth wrote:
    [..]
    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE, Mathematica, ...) have some kind of interpreter on board. It makes using them extremely easy and convenient.
    By sophisticated you mean complicated? You do all the hard work so that others can have it easy. Either one is getting handsomely paid for it -
    or it's a labour of love :)

    A side-benefit of having an interpreter is that they have to open up their API, and keep it that way. Most of the algorithms are based on open source
    anyway, but it saves me a lot of time just looking at it or copying bits and pieces.

    -macel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to dxforth@gmail.com on Thu Jun 2 11:40:42 2022
    In article <t7971l$1csa$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote: >On 1/06/2022 04:47, minf...@arcor.de wrote:
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple) >>> filesystem, using existing dictionary facility (I mean „its
    logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create >>> vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool >> to build your own DSL interpreter.

    Even better if one can avoid it. Moore once wrote a BASIC compiler in Forth. >Was everyone impressed? Yes - but a lot of effort for something neither he >nor they actually needed.

    I guessed that the BASIC compiler originated from Moore himself,
    but I found no confirmation of that. What is you source of information?

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to albert on Fri Jun 3 11:48:09 2022
    On 2/06/2022 19:40, albert wrote:
    In article <t7971l$1csa$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote:
    On 1/06/2022 04:47, minf...@arcor.de wrote:
    Zbig schrieb am Dienstag, 31. Mai 2022 um 19:41:50 UTC+2:
    FORTH IS ITS OWN INTERPRETER.
    IMPLEMENTING AN INTERPRETER IN FORTH IS AN ABOMINATION.
    I wonder if on that rule one could implement Forth-specific (even simple) >>>> filesystem, using existing dictionary facility (I mean „its
    logic”). You know:
    creating a file as analogy to word creation, create (sub)directory = create
    vocabulary etc.

    Just take it as tongue-in-cheek comment. After all Forth is a wonderful tool
    to build your own DSL interpreter.

    Even better if one can avoid it. Moore once wrote a BASIC compiler in Forth. >>Was everyone impressed? Yes - but a lot of effort for something neither he >>nor they actually needed.

    I guessed that the BASIC compiler originated from Moore himself,
    but I found no confirmation of that. What is you source of information?

    FD V3N6 "Charles Moore's Basic Compiler Revisited" - M. Perry

    It references Moore's "BASIC Compiler in FORTH" FORML Proceedings 1981

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Marcel Hendrix on Fri Jun 3 13:00:18 2022
    On 2/06/2022 18:54, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 8:37:42 AM UTC+2, dxforth wrote:
    On 2/06/2022 15:17, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 4:24:56 AM UTC+2, dxforth wrote:
    [..]
    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE,
    Mathematica, ...) have some kind of interpreter on board. It makes using >> > them extremely easy and convenient.
    By sophisticated you mean complicated? You do all the hard work so that
    others can have it easy. Either one is getting handsomely paid for it -
    or it's a labour of love :)

    A side-benefit of having an interpreter is that they have to open up their API,
    and keep it that way. Most of the algorithms are based on open source
    anyway, but it saves me a lot of time just looking at it or copying bits and pieces.

    I'm all for other folk writing and maintaining programs for the masses
    as it leaves me free to write the small things I need, as I please.

    But why go down the hard path of emulating the MATLABs and SPICE in
    Forth if those tools already exist? Are they flawed? When I began
    my forth compiler, the systems I could afford were rather miserable
    so I felt some justification. OTOH I severely miscalculated both
    the time it would take and my ability.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to dxforth on Thu Jun 2 22:23:28 2022
    On Friday, June 3, 2022 at 5:00:23 AM UTC+2, dxforth wrote:
    [..]
    But why go down the hard path of emulating the MATLABs and
    SPICE in Forth if those tools already exist? Are they flawed?

    Well, in my view, yes.

    And I don't emulate them, I use them by sending a few lines
    of text and catch the output (or access their API).

    Are all the tools we use just perfect and is there
    nothing in them that even slightly bothers us?

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to dxforth on Thu Jun 2 23:58:21 2022
    dxforth schrieb am Freitag, 3. Juni 2022 um 05:00:23 UTC+2:
    On 2/06/2022 18:54, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 8:37:42 AM UTC+2, dxforth wrote:
    On 2/06/2022 15:17, Marcel Hendrix wrote:
    On Thursday, June 2, 2022 at 4:24:56 AM UTC+2, dxforth wrote:
    [..]
    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE,
    Mathematica, ...) have some kind of interpreter on board. It makes using >> > them extremely easy and convenient.
    By sophisticated you mean complicated? You do all the hard work so that
    others can have it easy. Either one is getting handsomely paid for it -
    or it's a labour of love :)

    A side-benefit of having an interpreter is that they have to open up their API,
    and keep it that way. Most of the algorithms are based on open source anyway, but it saves me a lot of time just looking at it or copying bits and
    pieces.
    I'm all for other folk writing and maintaining programs for the masses
    as it leaves me free to write the small things I need, as I please.

    But why go down the hard path of emulating the MATLABs and SPICE in
    Forth if those tools already exist? Are they flawed? When I began
    my forth compiler, the systems I could afford were rather miserable
    so I felt some justification. OTOH I severely miscalculated both
    the time it would take and my ability.

    I used a linear algebra DSL in Forth for adaptive filter coefficient calculation in the loop. A descendant of Kalman filters.

    The DSL emulates classic Matlab syntax as far as it makes sense.
    It couldn't have been done with Matlab coder or compiler.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to dxforth on Fri Jun 3 10:37:44 2022
    dxforth <dxforth@gmail.com> writes:
    On 2/06/2022 15:17, Marcel Hendrix wrote:
    The most sophisticated tools I know (MATLAB, Octave, Scilab, NGSPICE,
    Mathematica, ...) have some kind of interpreter on board.

    And if the interpreter is not designed in from the start, it still
    appears in an ad-hoc form, according to Greenspun's tenth rule.

    You do all the hard work so that
    others can have it easy.

    Division of labour and toolmaking are new concepts? [Meta: Oh boy,
    dxforth's style of "discussion" is contagious.]

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2022: http://www.euroforth.org/ef22/cfp.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to Anton Ertl on Fri Jun 3 04:31:56 2022
    On Friday, June 3, 2022 at 12:44:33 PM UTC+2, Anton Ertl wrote:
    [..]
    And if the interpreter is not designed in from the start, it still
    appears in an ad-hoc form, according to Greenspun's tenth rule.

    "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified,
    bug-ridden, slow implementation of half of Common Lisp."

    *Exactly* on point for NGSPICE :--(

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Valencia@21:1/5 to Marcel Hendrix on Fri Jun 3 07:34:23 2022
    Marcel Hendrix <mhx@iae.nl> writes:
    On Friday, June 3, 2022 at 12:44:33 PM UTC+2, Anton Ertl wrote:
    [..]
    "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified,
    bug-ridden, slow implementation of half of Common Lisp."

    We found the same thing, but for programs which do search-for-solution.
    In that case, the same statement applies, except "Lisp" -> "Prolog".

    Andy Valencia
    Home page: https://www.vsta.org/andy/
    To contact me: https://www.vsta.org/contact/andy.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)