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


Groups > comp.lang.forth > #16706

Re: I Don't Make Mistakes. I Use C

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: I Don't Make Mistakes. I Use C
References (2 earlier) <arKdnVMSfeE6rRXNnZ2dnUVZ_s6dnZ2d@supernews.com> <k6ael5$j60$1@speranza.aioe.org> <8fSdnSe9ZpDgcxXNnZ2dnUVZ_oCdnZ2d@supernews.com> <7xmwzae7kc.fsf@ruckus.brouhaha.com> <F7CdnfKu9NzOFRTNnZ2dnUVZ_rOdnZ2d@supernews.com>
Date 2012-10-25 12:18 -0700
Message-ID <7xehkme4xe.fsf@ruckus.brouhaha.com> (permalink)
Organization Nightsong/Fort GNOX

Show all headers | View raw


"Elizabeth D. Rather" <erather@forth.com> writes:
> Forth mostly fits #3, but I think the common understanding of
> "interpreter" is 1 or 2.

No really, that's a rationalization that we hear on comp.lang.python all
the time too (CPython is a bytecode interpreter).  More commonly, an
interpreter is a program that loops over some representation of the user
program and executes the stuff in the representation.  E.g. CPython uses
bytecodes as the representation, a naive Lisp recursively evaluates
trees of cons cells in memory, and ITC has lists of addresses.
Something like Swift is an actual compiler.

> Particularly when you say something like, "Interpreted Forth has no
> error checking whatsoever" (in this thread) or "Forth is slow, because
> it's interpreted" (a common statement from people with only a vague
> understanding of Forth)

"No error checking whatsoever" is certainly bogus.  "Slow" is relative
to compiled code and I don't think an ITC Forth can avoid a substantial
speed disadvantage compared to compiled Forth or C.

> Even 70's ITC Forths had a very useful level of error checking (I
> don't consider type checking useful :-) and good implementations had
> excellent performance.

From what I can tell, they did have excellent performance compared to
other interpreted languages of the era, such as BASIC.  I don't see how
they could have approached the performance of competitive compiled code
even from that era (I guess that means Fortran etc.)

> How does a compiler detect that the programmer wasn't thinking clearly
> about how to do this operation?

Unclarity of thought often results in a type error that the compiler can
catch.  A trivial C example: you have a data structure with the address
of a float, and that slot containing the address itself has an address,
that might be held in some variable:

   float **p;  // p is a pointer to a pointer to a float

Now if you get confused about the data layout, you might dereference p
expecting to get the float directly, when in fact you have to
dereference it again:

   float x = *p;  // ERROR

the compiler spots that dereferencing p once gets you another pointer,
not a float, and tells you what went wrong.

> A good Forth implementation has a useful level of error checking. We
> just disagree on what constitutes "useful".

C programmers say things like that all the time too ;-). 

http://www.altdevblogaday.com/2011/12/24/static-code-analysis/
is by a well-known C programmer who recently saw the light ;-).

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


Thread

I Don’t Make Mistakes. I Use C visualforth@rocketmail.com - 2012-10-23 16:09 -0700
  Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-23 16:43 -0700
  Re: I Don’t Make Mistakes. I Use C jacko <jackokring@gmail.com> - 2012-10-23 16:50 -0700
    Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-23 18:58 -0700
      Re: I Don’t Make Mistakes. I Use C jacko <jackokring@gmail.com> - 2012-10-24 15:12 -0700
  Re: I Don’t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-23 14:02 -1000
    Re: I Don’t Make Mistakes. I Use C Bernd Paysan <bernd.paysan@gmx.de> - 2012-10-24 02:51 +0200
      Re: I Don’t Make Mistakes. I Use C Mark Wills <forthfreak@gmail.com> - 2012-10-24 04:23 -0700
    Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-23 19:20 -0700
    Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-24 05:04 -0500
      Re: I Don?t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-24 08:04 -1000
        Re: I Don?t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-24 13:11 -0700
          Re: I Don?t Make Mistakes. I Use C Pavel Klinkovsky <pavel.klinkovsky@gmail.com> - 2012-10-24 13:21 -0700
          Re: I Don?t Make Mistakes. I Use C Fritz Wuehler <fritz@spamexpire-201210.rodent.frell.theremailer.net> - 2012-10-25 20:00 +0200
            Re: I Don?t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 11:30 -0700
              Re: I Don?t Make Mistakes. I Use C Anonymous <nobody@remailer.paranoici.org> - 2012-10-26 09:00 +0000
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-26 05:01 -0500
                Re: I Don?t Make Mistakes. I Use C Brad Eckert <hwfwguy@gmail.com> - 2012-10-26 08:46 -0700
            Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-25 23:05 -0500
              Re: I Don?t Make Mistakes. I Use C Anonymous <nobody@remailer.paranoici.org> - 2012-10-28 15:35 +0000
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-28 12:06 -0500
                Re: I Don?t Make Mistakes. I Use C Bernd Paysan <bernd.paysan@gmx.de> - 2012-10-28 21:38 +0100
                Re: I Don?t Make Mistakes. I Use C jacko <jackokring@gmail.com> - 2012-10-28 16:34 -0700
                Re: I Don?t Make Mistakes. I Use C Anonymous <nobody@remailer.paranoici.org> - 2012-10-29 10:56 +0000
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-29 06:11 -0500
                Re: I Don?t Make Mistakes. I Use C rickman <gnuarm@gmail.com> - 2012-10-29 13:51 -0400
                Re: I Don?t Make Mistakes. I Use C Anonymous <nobody@remailer.paranoici.org> - 2012-10-29 20:45 +0000
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-30 04:20 -0500
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-30 04:16 -0500
    Re: I Don’t Make Mistakes. I Use C rickman <gnuarm@gmail.com> - 2012-10-25 10:04 -0400
      Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 14:16 -0700
        Re: I Don’t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-25 15:51 -1000
          Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 20:14 -0700
            Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-25 23:11 -0500
              Re: I Don?t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 21:53 -0700
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-26 01:27 -0500
                Re: I Don?t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-26 07:06 -0700
                Re: I Don?t Make Mistakes. I Use C Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-26 11:34 -0500
                Re: I Don?t Make Mistakes. I Use C Bernd Paysan <bernd.paysan@gmx.de> - 2012-10-26 19:13 +0200
                Re: I Don?t Make Mistakes. I Use C Alex McDonald <blog@rivadpm.com> - 2012-10-27 04:49 -0700
                Re: I Don?t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-25 21:20 -1000
            Re: I Don’t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-25 21:23 -1000
              Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-26 00:53 -0700
          Re: I Don’t Make Mistakes. I Use C "Stanley Daniel de Liver" <notagoodone@invalid.org.invalid> - 2012-11-21 16:21 +0000
  Re: I Don't Make Mistakes. I Use C "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-24 06:55 -0400
    Re: I Don't Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-24 08:17 -1000
      Re: I Don't Make Mistakes. I Use C "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-25 00:23 -0400
        Re: I Don't Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-24 22:18 -0700
        Re: I Don't Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-24 21:47 -1000
          Re: I Don't Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 11:21 -0700
            Re: I Don't Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-25 08:43 -1000
              Re: I Don't Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-25 12:18 -0700
              Re: I Don't Make Mistakes. I Use C "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-26 19:55 -0400
                Re: I Don't Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-26 17:38 -1000
            Re: I Don't Make Mistakes. I Use C Brad Eckert <hwfwguy@gmail.com> - 2012-10-26 09:07 -0700
          Re: I Don't Make Mistakes. I Use C "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-26 19:56 -0400
            Re: I Don't Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-26 17:47 -1000
              Re: I Don't Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-26 22:04 -0700
                Re: I Don't Make Mistakes. I Use C visualforth@rocketmail.com - 2012-10-27 07:27 -0700
                Re: I Don't Make Mistakes. I Use C Bernd Paysan <bernd.paysan@gmx.de> - 2012-10-27 19:14 +0200
    Re: I Don't Make Mistakes. I Use C Brad Eckert <hwfwguy@gmail.com> - 2012-10-24 11:48 -0700
      Re: I Don't Make Mistakes. I Use C rickman <gnuarm@gmail.com> - 2012-10-25 19:14 -0400
  Re: I Don’t Make Mistakes. I Use C Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-10-24 10:41 -0700
    Re: I Don’t Make Mistakes. I Use C Pavel Klinkovsky <pavel.klinkovsky@gmail.com> - 2012-10-24 13:10 -0700
      Re: I Don’t Make Mistakes. I Use C "Elizabeth D. Rather" <erather@forth.com> - 2012-10-24 14:00 -1000
        Re: I Don’t Make Mistakes. I Use C Pavel Klinkovsky <pavel.klinkovsky@gmail.com> - 2012-10-24 23:54 -0700
      Re: I Don't Make Mistakes. I Use C "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-25 00:29 -0400
        Re: I Don't Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-24 22:25 -0700
          Re: I Don't Make Mistakes. I Use C Pavel Klinkovsky <pavel.klinkovsky@gmail.com> - 2012-10-24 23:57 -0700
        Re: I Don't Make Mistakes. I Use C Pavel Klinkovsky <pavel.klinkovsky@gmail.com> - 2012-10-25 00:11 -0700
    Re: I Don’t Make Mistakes. I Use C visualforth@rocketmail.com - 2012-10-24 16:14 -0700
      Re: I Don’t Make Mistakes. I Use C Paul Rubin <no.email@nospam.invalid> - 2012-10-24 17:16 -0700
        Re: I Don’t Make Mistakes. I Use C visualforth@rocketmail.com - 2012-10-24 17:47 -0700
      Re: I Don’t Make Mistakes. I Use C rickman <gnuarm@gmail.com> - 2012-10-25 10:17 -0400

csiph-web