Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #34396

Re: Does Forth solve the paradox?

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Does Forth solve the paradox?
Date 2014-11-14 01:33 +0100
Organization A noiseless patient Spider
Message-ID <m43ijk$lsm$1@dont-email.me> (permalink)
References <6f36e5e5-037c-41e2-89c5-2bc11937ddcd@googlegroups.com> <545a7e77$0$15893$e4fe514c@dreader35.news.xs4all.nl> <2014Nov6.102256@mips.complang.tuwien.ac.at> <4pudnS9lFcDMAsbJnZ2dnUVZ8qqdnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley wrote:
> Indeed so.  It seems to me that a lot of the arguments made by the
> author were exactly the ones made by Forthers in the past, especially
> Chuck Moore.  A very-generalized solution to a problem is going to be
> more complex, more expensive, and harder to maintain that one that
> simply does the job at hand.  A reusable component likewise.  I don't
> quite understand why this simple piece has raised so much ire here.

I'm not sure about this, because one reusable and extremely powerful tool in 
Forth is the interpreter itself.  The "Interpreter" is a very common design 
pattern; how often do you think a normal programmer writes an interpreter?  
Usually with the "design for one problem at hand" approach... which is very 
inflexible and quickly leeds to implementing another interpreter, because 
the first one wasn't good enough.

In Forth, instead of doing that, you often just reuse the already available 
interpeter.  And it's not big and complex.  And because Forth is a general 
purpose language, that interpreter is extensible and extremely powerful, 
even though quite simple to implement.  I've had friends, who weren't too 
much convinced of Forth, but exposed to it by me, and when they got to the 
point of "I need an interpreter", they just wrote a little Forth.  Because 
it was so much easier than any other typical option how to add an 
interpreter.

And that's how you do over-generalized things in Forth: You just expose the 
extensible interpreter, and write the stuff you actually need with this 
interpreter.  Or with a byte-coded variant of it, if you think byte-code is 
a good idea for your case (OpenFirmware and net2o considder tokenized code 
as better than plain text Forth).

So I think, yes: Forth does solve this paradoxon of simplifying, 
generalizing, and reusability, with the simple, general, and reusable 
component of the Forth interpreter, or variants, inspired by the Forth 
interpreter (can be both the inner or outer interpreter; after all, the 
inner interpreter is "just" a speed-optimized version of the outer 
interpreter so that you gain speed by compiling from outer to inner 
interpreter).

I would say that a very generalized solution to a problem needs more time to 
be simplified enough so that it is easy to maintain and reuse; and as my 
rule of thumb is that any sufficient complicated problem requires a turing 
complete programming language as solution, my advice is that if you think 
that you might maybe have such a problem, just add the turing complete 
programming language right now (I should add to that "object oriented"), 
make it Forth or Forth-like, and then be done with it.  If you like OOP-
based design, add a very simplified OOP thingy to it, as well; it fits in 
naturally, and you'll get there, too.

Of course, you can say that an OOP-based Forth-like language consists only 
of hooks, and you are right: It's a simple, small, maintainable and fairly 
efficient solution to the over-generalized problem.

And then you can carry on by solving only those problems at hand, because 
you never have to think about the generalization.  It's already there.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Does Forth solve the paradox? forthisit@gmail.com - 2014-11-05 08:08 -0800
  Re: Does Forth solve the paradox? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-11-05 19:45 +0000
    Re: Does Forth solve the paradox? "Elizabeth D. Rather" <erather@forth.com> - 2014-11-05 10:43 -1000
      Re: Does Forth solve the paradox? Paul Rubin <no.email@nospam.invalid> - 2014-11-05 14:04 -0800
        Re: Does Forth solve the paradox? "Elizabeth D. Rather" <erather@forth.com> - 2014-11-05 12:49 -1000
          Re: Does Forth solve the paradox? rickman <gnuarm@gmail.com> - 2014-11-05 18:13 -0500
            Re: Does Forth solve the paradox? "Elizabeth D. Rather" <erather@forth.com> - 2014-11-05 13:54 -1000
            Re: Does Forth solve the paradox? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-11-06 10:13 +0000
          Re: Does Forth solve the paradox? the_gavino_himself <visphatesjava@gmail.com> - 2014-11-05 20:55 -0800
          Re: Does Forth solve the paradox? Paul Rubin <no.email@nospam.invalid> - 2014-11-05 22:19 -0800
      Re: Does Forth solve the paradox? m.a.m.hendrix@tue.nl - 2014-11-06 03:05 -0800
        Re: Does Forth solve the paradox? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-06 11:43 +0000
          Re: Does Forth solve the paradox? m.a.m.hendrix@tue.nl - 2014-11-06 04:46 -0800
            Re: Does Forth solve the paradox? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-06 16:58 +0000
    Re: Does Forth solve the paradox? rickman <gnuarm@gmail.com> - 2014-11-05 17:22 -0500
    Re: Does Forth solve the paradox? the_gavino_himself <visphatesjava@gmail.com> - 2014-11-05 18:54 -0800
    Re: Does Forth solve the paradox? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-06 09:22 +0000
      Re: Does Forth solve the paradox? Mark Wills <markwills1970@gmail.com> - 2014-11-06 03:20 -0800
      Re: Does Forth solve the paradox? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-11-06 10:18 -0600
        Re: Does Forth solve the paradox? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-11-06 18:30 +0000
          Re: Does Forth solve the paradox? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-11-07 03:22 -0600
        Re: Does Forth solve the paradox? "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-11-06 16:57 -0500
          Re: Does Forth solve the paradox? forthisit@gmail.com - 2014-11-06 14:38 -0800
          Re: Does Forth solve the paradox? "Elizabeth D. Rather" <erather@forth.com> - 2014-11-06 13:58 -1000
        Re: Does Forth solve the paradox? Paul Rubin <no.email@nospam.invalid> - 2014-11-07 10:40 -0800
          Re: Does Forth solve the paradox? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-11-08 02:36 -0600
          Re: Does Forth solve the paradox? "Elizabeth D. Rather" <erather@forth.com> - 2014-11-07 22:45 -1000
        Re: Does Forth solve the paradox? Bernd Paysan <bernd.paysan@gmx.de> - 2014-11-14 01:33 +0100
          Re: Does Forth solve the paradox? m.a.m.hendrix@tue.nl - 2014-11-14 02:34 -0800
          Re: Does Forth solve the paradox? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-11-14 05:07 -0600
            Re: Does Forth solve the paradox? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-15 16:21 +0000
              Re: Does Forth solve the paradox? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-11-15 11:52 -0600
              Re: Does Forth solve the paradox? hughaguilar96@yahoo.com - 2014-11-15 12:47 -0800
              Re: Does Forth solve the paradox? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-11-16 00:06 +0000
                Re: Does Forth solve the paradox? Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-11-16 00:45 +0000
                Re: Does Forth solve the paradox? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-11-16 13:39 +0000
      Re: Does Forth solve the paradox? Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-11-06 19:54 +0000
  Re: Does Forth solve the paradox? Ilya Tarasov <ilya74.tarasov@gmail.com> - 2014-11-06 08:26 -0800
    Re: Does Forth solve the paradox? "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-11-06 16:57 -0500

csiph-web