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


Groups > comp.lang.forth > #15596

Re: Forth as a polarising language

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: Forth as a polarising language
References (16 earlier) <2370419.WlZCQYq3kg@sunwukong.fritz.box> <7xzk4y8vuu.fsf@ruckus.brouhaha.com> <44911562.uCePkysVEk@sunwukong.fritz.box> <7xa9wy6kqv.fsf@ruckus.brouhaha.com> <1651452.CLfWVFRu8b@sunwukong.fritz.box>
Date 2012-09-10 18:47 -0700
Message-ID <7x1ui9tjoa.fsf@ruckus.brouhaha.com> (permalink)
Organization Nightsong/Fort GNOX

Show all headers | View raw


Bernd Paysan <bernd.paysan@gmx.de> writes:
>> What do you mean about inspecting the program being easier in Forth
> You have an interactive shell.  You have self-inspecting capability like 
> SEE.  There are other languages like Lisp with similar self-inspecting 
> capabilities, and those tend to not quit on errors, too. 

OK, but that presumes there's a person around to interact with the
stopped program.  I was thinking more of the situation where your
embedded box crashes in the field.  There's not much to do but restart
it, and try to figure out later what happened.

> However, in most Algol-like languages, you have nothing, and therefore, 
> you can only print a backtrace and quit.

That's why we have debuggers.  Just run the program under one.  In ITS,
the standard shell was a debugger and all programs ran under it.

> Backtrace:
> $7FA9FFBBF720 @  ...
> I find this quite useful.  It tells me that @ failed with an invalid 

How do you map $7FA9FFBBF720 back to a Forth word so you can know where
the error happened?

> People still can make mistakes in Forth, but our mentality is not to 
> bury tools, and therefore, this sort of refactoring isn't necessary that 
> often.  Writing a Forth program is about finding good factors.

I would have expected it to be worse in Forth, because there are so many
more nested words, communicating through the stack.  Maybe you have to
pass a new parameter from a higher level to a lower level, and that
means all the intervening words change their signature.  Or maybe you
combine a few variables or stack slots into a structure or object, and
again everything that touches that data has to change.

> The whole data starts in a Java object, gets converted to a C++
> object, and then is accessed by C functions, which presume this C++
> object is a struct.

Is it so awful to write some Forth code that pulls the relevant fields
out of the struct?

> We hate writing "onion code", where you have layers and layers on top
> of each others, and the smell alone makes you cry.

I thought the opposite: the Forth approach is to factor everything
into tiny little words, nested much more deeply than subroutines of
traditional languages, with data abstraction implicit in the factoring.

>> Slow simulations I can understand, but that argues for more error
>> checks at compile time.
>
> No, this is that fallacy.  The error checks at compile time don't find 
> the logical errors you make, 

The exception in your example with the 4-bit binary counter would have
been spotted by a totality checker, that makes sure there is a
meaningful output for every possible input.  I'm pretty sure there are
Ada tools for that.

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


Thread

Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-08-29 23:00 -0700
  Re: Article Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-30 01:47 -0700
    Re: Article anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-30 12:13 +0000
  Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-08-30 11:31 -0400
    Missing from USENET - was [Re: Article] Richard Owlett <rowlett@pcnetinc.com> - 2012-08-30 10:37 -0500
      Missing from USENET - was [Re: Article] Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-30 10:30 -0700
  Re: Article hughaguilar96@yahoo.com - 2012-08-30 19:56 -0700
    Re: Article awegel@arcor.de (Alex Wegel) - 2012-08-31 12:35 +0200
  Re: Article "Greg Bailey" <greg@greenarraychips.com> - 2012-08-31 17:51 -0700
    Re: Article Whammo <sidciavic@gmail.com> - 2012-08-31 18:22 -0700
    Re: Article Mark Wills <forthfreak@gmail.com> - 2012-09-01 01:04 -0700
      Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-02 16:18 -0700
    Re: Article Alex McDonald <blog@rivadpm.com> - 2012-09-01 01:48 -0700
    Re: Article rickman <gnuarm@gmail.com> - 2012-09-02 18:38 -0400
    Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-02 16:59 -0700
    Re: Article Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-03 13:07 -0500
      Re: Article Alex McDonald <blog@rivadpm.com> - 2012-09-03 14:25 -0700
      Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-04 17:04 -0700
        Re: Article Ron Aaron <rambamist@gmail.com> - 2012-09-05 06:23 +0300
    Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-03 18:17 -0400
      Re: Article "Elizabeth D. Rather" <erather@forth.com> - 2012-09-03 12:37 -1000
        Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-04 04:48 -0400
          Re: Article Alex McDonald <blog@rivadpm.com> - 2012-09-04 03:39 -0700
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 02:48 -0400
          Re: Article awegel@arcor.de (Alex Wegel) - 2012-09-04 13:18 +0200
            Re: Article Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-04 16:03 +0200
              Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 03:29 -0400
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 03:24 -0400
          Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-04 08:12 -0700
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 16:06 -0400
          Re: Article Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-04 11:35 -0500
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 02:40 -0400
              Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-05 13:28 -0700
          Re: Article "Elizabeth D. Rather" <erather@forth.com> - 2012-09-04 08:32 -1000
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 02:22 -0400
              Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-05 10:08 -0700
                Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 16:07 -0400
                Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-05 13:39 -0700
              Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-05 13:35 -0700
            Re: Article "Ed" <invalid@nospam.com> - 2012-09-07 17:24 +1000
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-07 05:28 -0400
              Re: Article Mark Wills <markrobertwills@yahoo.co.uk> - 2012-09-07 03:28 -0700
              Re: Article Ron Aaron <rambamist@gmail.com> - 2012-09-07 13:31 +0300
                Re: Article jacko <jackokring@gmail.com> - 2012-09-07 06:33 -0700
                Re: Article Howerd <howerdo@yahoo.co.uk> - 2012-09-07 09:06 -0700
              Re: Article Howerd <howerdo@yahoo.co.uk> - 2012-09-07 09:03 -0700
        Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-04 16:45 -0700
      Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-03 21:38 -0700
        Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 02:51 -0400
          Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-05 10:49 -0700
            Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 16:20 -0400
        Re: Article "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-05 16:06 -0400
          Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-05 13:32 -0700
            Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-05 13:50 -0700
              Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-05 22:34 -0700
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-07 14:05 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-08 01:53 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-07 18:22 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 00:08 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-08 17:34 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 15:57 +0200
                Re: Forth as a polarising language Mark Wills <markrobertwills@yahoo.co.uk> - 2012-09-09 08:12 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 22:07 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-09 15:14 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-10 01:52 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-09 19:17 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-10 15:01 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-10 07:00 -0700
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-11 01:07 +0200
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-10 18:47 -0700
                Re: Forth as a polarising language Elizabeth D Rather <erather@forth.com> - 2012-09-10 16:08 -1000
                Re: Forth as a polarising language anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-11 07:51 +0000
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-11 19:24 +0200
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-11 21:40 +0200
                Re: Forth as a polarising language "Elizabeth D. Rather" <erather@forth.com> - 2012-09-09 14:58 -1000
                Re: Forth as a polarising language Paul Rubin <no.email@nospam.invalid> - 2012-09-09 18:24 -0700
                Re: Forth as a polarising language Anonymous <nobody@remailer.paranoici.org> - 2012-09-09 13:42 +0000
                Re: Forth as a polarising language mhx@iae.nl (Marcel Hendrix) - 2012-09-08 10:34 +0200
                Re: Forth as a polarising language Doug Hoffman <glidedog@gmail.com> - 2012-09-08 07:06 -0400
                Re: Forth as a polarising language mhx@iae.nl (Marcel Hendrix) - 2012-09-08 16:14 +0200
                DEFER (was: Forth as a polarising language) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-08 16:47 +0000
                Re: Forth as a polarising language Doug Hoffman <glidedog@gmail.com> - 2012-09-09 04:22 -0400
                OOP (was: Forth as a polarising language) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-08 11:38 +0000
                Re: OOP Doug Hoffman <glidedog@gmail.com> - 2012-09-08 08:19 -0400
                Re: OOP mhx@iae.nl (Marcel Hendrix) - 2012-09-08 16:41 +0200
                Re: OOP Doug Hoffman <glidedog@gmail.com> - 2012-09-09 04:24 -0400
                Re: Forth as a polarising language mhx@iae.nl (Marcel Hendrix) - 2012-09-09 12:03 +0200
                Re: Forth as a polarising language "A. K." <akk@nospam.org> - 2012-09-09 13:20 +0200
                Re: Forth as a polarising language Doug Hoffman <glidedog@gmail.com> - 2012-09-10 08:33 -0400
                Re: OOP mhx@iae.nl (Marcel Hendrix) - 2012-09-08 16:54 +0200
                Re: OOP Doug Hoffman <glidedog@gmail.com> - 2012-09-09 04:12 -0400
                OOP (was: Forth as a polarising language) mhx@iae.nl (Marcel Hendrix) - 2012-09-08 16:28 +0200
                Re: OOP (was: Forth as a polarising language) mhx@iae.nl (Marcel Hendrix) - 2012-09-08 16:56 +0200
                Re: OOP (was: Forth as a polarising language) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-08 15:00 +0000
                Re: OOP (was: Forth as a polarising language) Roger Ivie <rivie@ridgenet.net> - 2012-09-08 11:56 -0500
                Re: OOP Doug Hoffman <glidedog@gmail.com> - 2012-09-09 04:20 -0400
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 00:15 +0200
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 00:50 +0200
                Re: Forth as a polarising language mhx@iae.nl (Marcel Hendrix) - 2012-09-09 03:12 +0200
                Re: Forth as a polarising language Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-09 16:01 +0200
                Re: Forth as a polarising language "Elizabeth D. Rather" <erather@forth.com> - 2012-09-09 14:54 -1000
                [OT] Newsreader problem - was [Re: Forth as a polarising language] Richard Owlett <rowlett@pcnetinc.com> - 2012-09-10 06:33 -0500
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Doug Hoffman <glidedog@gmail.com> - 2012-09-10 08:16 -0400
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Doug Hoffman <glidedog@gmail.com> - 2012-09-10 08:28 -0400
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-10 12:43 +0000
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Doug Hoffman <glidedog@gmail.com> - 2012-09-10 09:24 -0400
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Richard Owlett <rowlett@pcnetinc.com> - 2012-09-10 08:12 -0500
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Doug Hoffman <glidedog@gmail.com> - 2012-09-10 09:32 -0400
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] "Elizabeth D. Rather" <erather@forth.com> - 2012-09-10 07:40 -1000
                Re: [OT] Newsreader problem - was [Re: Forth as a polarising language] Richard Owlett <rowlett@pcnetinc.com> - 2012-09-10 14:42 -0500
                Re: Forth as a polarising language Doug Hoffman <glidedog@gmail.com> - 2012-09-10 07:59 -0400
                Re: Forth as a polarising language rickman <gnuarm@gmail.com> - 2012-09-10 12:27 -0400
                Re: Forth as a polarising language "Elizabeth D. Rather" <erather@forth.com> - 2012-09-10 07:44 -1000
                Re: Forth as a polarising language rickman <gnuarm@gmail.com> - 2012-09-10 12:30 -0400
            Re: Article "Ed" <invalid@nospam.com> - 2012-09-09 14:13 +1000
              Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-11 11:26 -0700
                Re: Article "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2012-09-11 21:02 +0100
                Re: Article vandys@vsta.org - 2012-09-11 20:37 +0000
                Re: Article "Ed" <invalid@nospam.com> - 2012-09-12 20:01 +1000
              Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-11 16:50 -0700
                Re: Article Mark Wills <forthfreak@gmail.com> - 2012-09-12 00:45 -0700
                Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-12 18:44 -0700
                Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-12 20:26 -0700
                Re: Article "Ed" <invalid@nospam.com> - 2012-09-12 20:47 +1000
    Re: Article Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-09-06 19:28 -0700
      Re: Article John Passaniti <john.passaniti@gmail.com> - 2012-09-07 09:57 -0700

csiph-web