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


Groups > comp.lang.forth > #47282 > unrolled thread

Was just wondering when people started using C to write forth languages and not assembly?

Started byDarin Murphy <murphy.darin@gmail.com>
First post2016-05-18 11:31 -0700
Last post2016-05-20 22:27 -0400
Articles 20 on this page of 75 — 20 participants

Back to article view | Back to comp.lang.forth


Contents

  Was just wondering when people started using C to write forth languages and not assembly? Darin Murphy <murphy.darin@gmail.com> - 2016-05-18 11:31 -0700
    Re: Was just wondering when people started using C to write forth languages and not assembly? visualforth@rocketmail.com - 2016-05-18 13:11 -0700
    Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-18 12:42 -1000
    Re: Was just wondering when people started using C to write forth languages and not assembly? Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-18 20:38 -0400
      Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-18 18:00 -1000
      Re: Was just wondering when people started using C to write forth languages and not assembly? pahihu <pahihu@gmail.com> - 2016-05-19 01:00 -0700
        Re: Was just wondering when people started using C to write forth languages and not assembly? Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-05-19 19:14 -0400
          Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-19 14:44 -1000
      Re: Was just wondering when people started using C to write forth languages and not assembly? Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-19 13:28 +0000
      Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-19 11:29 -0700
    Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-18 17:56 -0700
      Re: Was just wondering when people started using C to write forth languages and not assembly? Darin Murphy <murphy.darin@gmail.com> - 2016-05-18 19:26 -0700
        Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-18 20:16 -0700
        Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-18 17:51 -1000
          Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-18 20:54 -0700
          Re: Was just wondering when people started using C to write forth languages and not assembly? JUERGEN <epldfpga@aol.com> - 2016-05-20 10:49 -0700
        Re: Was just wondering when people started using C to write forth languages and not assembly? humptydumpty <ouatubi@gmail.com> - 2016-05-19 01:59 -0700
          Re: Was just wondering when people started using C to write forth languages and not assembly? Darin Murphy <murphy.darin@gmail.com> - 2016-05-19 12:04 -0700
        Re: Was just wondering when people started using C to write forth languages and not assembly? Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-19 13:58 +0000
          Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-19 15:07 +0000
            Re: Was just wondering when people started using C to write forth languages and not assembly? Ron Aaron <rambamist@gmail.com> - 2016-05-19 19:21 +0300
              Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 12:44 +0000
                Re: Was just wondering when people started using C to write forth languages and not assembly? Ron Aaron <rambamist@gmail.com> - 2016-05-20 16:14 +0300
                  Re: Was just wondering when people started using C to write forth languages and not assembly? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-05-20 15:28 +0200
                    Re: Was just wondering when people started using C to write forth languages and not assembly? stephen@mpeforth.com (Stephen Pelc) - 2016-05-20 13:50 +0000
                      Re: Was just wondering when people started using C to write forth languages and not assembly? Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-05-20 07:31 -0700
                        Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-20 08:39 -1000
                          Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-21 18:04 -0700
                            Re: Was just wondering when people started using C to write forthlanguages and not assembly? "WJ" <w_a_x_man@yahoo.com> - 2016-05-23 14:04 +0000
                        Re: Was just wondering when people started using C to write forth languages and not assembly? stephen@mpeforth.com (Stephen Pelc) - 2016-05-20 20:48 +0000
                        Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-22 20:38 -0700
                          Re: Was just wondering when people started using C to write forth languages and not assembly? Ron Aaron <rambamist@gmail.com> - 2016-05-23 07:03 +0300
                            Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-22 21:22 -1000
                              Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-23 23:21 -0700
                                Re: Was just wondering when people started using C to write forth languages and not assembly? stephen@mpeforth.com (Stephen Pelc) - 2016-05-24 09:36 +0000
                                  Re: Was just wondering when people started using C to write forth languages and not assembly? foxaudioresearch@gmail.com - 2016-05-24 08:02 -0700
                                    Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-24 15:34 +0000
                                      Re: Was just wondering when people started using C to write forth languages and not assembly? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-05-25 05:43 -0500
                                        Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-25 13:43 +0000
                                    Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-24 09:40 -0700
                                  Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-24 10:09 -0700
                                    Re: Was just wondering when people started using C to write forth languages and not assembly? stephen@mpeforth.com (Stephen Pelc) - 2016-05-24 20:24 +0000
                                      Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-24 14:32 -0700
                                        Re: Was just wondering when people started using C to write forth languages and not assembly? stephen@mpeforth.com (Stephen Pelc) - 2016-05-25 09:34 +0000
                                          Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-25 09:52 -0700
                                            Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-26 10:02 +0000
                                              Re: Was just wondering when people started using C to write forth languages and not assembly? hughaguilar96@gmail.com - 2016-05-26 10:19 -0700
                                      Re: Was just wondering when people started using C to write forth languages and not assembly? "WJ" <w_a_x_man@yahoo.com> - 2016-05-25 01:18 +0000
                          Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-22 21:15 -1000
                  Re: Was just wondering when people started using C to write forth languages and not assembly? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-05-20 09:47 -0500
                    Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 15:02 +0000
                      Re: Was just wondering when people started using C to write forth languages and not assembly? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-05-20 11:42 -0500
                        Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 16:52 +0000
                          Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-20 10:07 -0700
                            Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 17:12 +0000
                              Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-20 10:25 -0700
                                Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 17:41 +0000
                                  Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-20 11:12 -0700
                                    Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-21 05:33 +0000
                            Re: Was just wondering when people started using C to write forth languages and not assembly? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-05-20 21:13 +0200
                              Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-20 15:24 -0700
                      Re: Was just wondering when people started using C to write forth languages and not assembly? Paul Rubin <no.email@nospam.invalid> - 2016-05-20 09:45 -0700
                      Re: Was just wondering when people started using C to write forth languages and not assembly? Bernd Paysan <bernd.paysan@gmx.de> - 2016-06-02 01:01 +0000
                        Native Gforth Lars Brinkhoff <lars.spam@nocrew.org> - 2016-06-02 08:37 +0200
                          Re: Native Gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-02 12:54 +0000
                        Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-02 12:34 +0000
            Re: Was just wondering when people started using C to write forth languages and not assembly? Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-19 18:35 +0000
              Re: Was just wondering when people started using C to write forth languages and not assembly? Darin Murphy <murphy.darin@gmail.com> - 2016-05-19 12:07 -0700
              Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-20 12:48 +0000
            Re: Was just wondering when people started using C to write forth languages and not assembly? "Elizabeth D. Rather" <erather@forth.com> - 2016-05-19 10:33 -1000
    Re: Was just wondering when people started using C to write forth languages and not assembly? Ron Aaron <rambamist@gmail.com> - 2016-05-19 07:04 +0300
      Re: Was just wondering when people started using C to write forth languages and not assembly? Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2016-05-19 08:09 +0200
    Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-19 07:43 +0000
      Re: Was just wondering when people started using C to write forth languages and not assembly? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-19 08:13 +0000
        Re: Was just wondering when people started using C to write forth languages and not assembly? Darin Murphy <murphy.darin@gmail.com> - 2016-05-20 22:27 -0400

Page 1 of 4  [1] 2 3 4  Next page →


#47282 — Was just wondering when people started using C to write forth languages and not assembly?

FromDarin Murphy <murphy.darin@gmail.com>
Date2016-05-18 11:31 -0700
SubjectWas just wondering when people started using C to write forth languages and not assembly?
Message-ID<622db793-14c4-48e5-a732-686c0b759db5@googlegroups.com>
Not trying to cause a flame-war only trying to understand this evolutionary change and the reasoning behind it.  Prior to the decision I made a couple of weeks ago to learn forth, I had read lots and lots of information about the forth programming language, including it's history. One thing that had repeatedly popped up was that forth and C where not very compatable with each other. The strange thing though was that everywhere I researched ansi-forth implementations I found that they were written in forth (i.e., gforth), but could not find out when this switch was made in the history of forth and more importantly why.  From what I've read about Mr. Moores forth, eforth, etc, was that only a small group of primatives need be written and forth would evolve from those primatives. Also I had studied 8086 and 8088 assembly in the past and found it rather easier to write and read than C, which can be very confusing at times. I've also studied and programmed in C (trival stuff) to learn whether or not it was the write language for me, but decided for what I want to do it wasn't. Anyway, I hope this question doesn't create a very heated debate and I am only trying to understand forth and it's history better.  Thanks in advance for any information given and please understand that I mean harm in asking these possibly explosive questions. Take care now.

[toc] | [next] | [standalone]


#47283

Fromvisualforth@rocketmail.com
Date2016-05-18 13:11 -0700
Message-ID<3abe55a2-54a6-4d5b-be85-2c411b66c8b9@googlegroups.com>
In reply to#47282
On Wednesday, May 18, 2016 at 2:31:47 PM UTC-4, Darin Murphy wrote:
> Not trying to cause a flame-war only trying to understand this evolutionary change and the reasoning behind it.  Prior to the decision I made a couple of weeks ago to learn forth, I had read lots and lots of information about the forth programming language, including it's history. One thing that had repeatedly popped up was that forth and C where not very compatable with each other. The strange thing though was that everywhere I researched ansi-forth implementations I found that they were written in forth (i.e., gforth), but could not find out when this switch was made in the history of forth and more importantly why.  From what I've read about Mr. Moores forth, eforth, etc, was that only a small group of primatives need be written and forth would evolve from those primatives. Also I had studied 8086 and 8088 assembly in the past and found it rather easier to write and read than C, which can be very confusing at times. I've also studied and programmed in C (trival stuff) to learn whether or not it was the write language for me, but decided for what I want to do it wasn't. Anyway, I hope this question doesn't create a very heated debate and I am only trying to understand forth and it's history better.  Thanks in advance for any information given and please understand that I mean harm in asking these possibly explosive questions. Take care now.

The problem with C is that C uses stack frames and parts of the CPU - registers etc. - which are used by Forth, too. If there would be a C which generates assembly code without restrictions hindering Forth, that would help, I guess.

[toc] | [prev] | [next] | [standalone]


#47285

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-05-18 12:42 -1000
Message-ID<Wpydncrop4B-cqHKnZ2dnUU7-KnNnZ2d@supernews.com>
In reply to#47282
On 5/18/16 8:31 AM, Darin Murphy wrote:
 > Not trying to cause a flame-war only trying to understand
 > this evolutionary change and the reasoning behind it.

 > Prior to the decision I made a couple of weeks ago to learn
 > forth, I had read lots and lots of information about the
 > forth programming language, including it's history. One
 > thing that had repeatedly popped up was that forth and C
 > where not very compatable with each other. The strange thing
 > though was that everywhere I researched ansi-forth
 > implementations I found that they were written in forth

I assume you meant to type "written in C"?

 > (i.e., gforth), but could not find out when this switch
 > was made in the history of forth and more importantly why.
 > From what I've read about Mr. Moores forth, eforth, etc,
 > was that only a small group of primatives need be written
 > and forth would evolve from those primatives. Also I had
 > studied 8086 and 8088 assembly in the past and found it
 > rather easier to write and read than C, which can be very
 > confusing at times. I've also studied and programmed in C
 > (trival stuff) to learn whether or not it was the write
 > language for me, but decided for what I want to do it
 > wasn't. Anyway, I hope this question doesn't create a
 > very heated debate and I am only trying to understand
 > forth and it's history better.  Thanks in advance for
 > any information given and please understand that I mean
 > harm in asking these possibly explosive questions. Take
 > care now.

Please limit your line length. I fixed the above, which came to my 
reader as one very long line.

Addressing your question, Chuck Moore's Forths (and all ever since at 
FORTH, Inc. and some other implementers) were, as you say, written with 
a few primitives and most of the rest built using them. The key element 
was that there was an assembler for the target processor written in 
Forth. The process of getting a Forth on a new machine involved using an 
existing Forth system to write an assembler for the new one, 
implementing a virtual machine design optimizing things like register 
use and memory organization for the target. The primitives were written 
using that assembler, with higher-level Forth definitions built using 
the primitives. This process generated a kernel that could be booted on 
the target, including disk and terminal drivers, and which would then be 
self-sufficient. Chuck could bring up a new processor in about two 
weeks; other good Forth programmers took a little longer. At one point, 
Chuck estimated that he may have written more assemblers than anyone 
else, ever (at that point, in the early 80's, the number was about 30). 
FORTH, Inc. has never used a externally-produced assembler or compiler.

This process has always yielded the fastest, most tightly-optimized 
Forth systems, features required for the professional market that we 
targeted. I believe the C-based Forths were developed to facilitate 
getting Forth on new architectures, trading runtime performance for 
portability.

Cheers,
Elizabeth
-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#47286

FromRod Pemberton <NoHaveNotOne@bcczxcfre.cmm>
Date2016-05-18 20:38 -0400
Message-ID<20160518203818.4fd0690d@_>
In reply to#47282
On Wed, 18 May 2016 11:31:46 -0700 (PDT)
Darin Murphy <murphy.darin@gmail.com> wrote:

> One thing that had repeatedly popped up was that forth and C where
> not very [compatible] with each other.

Versions of Unix-Forth for PDP-11 and VAX were posted to net.sources in
1984 and are coded in C and Forth.  So, that would be just a few years
after the release of the first fig-Forth in 1980 for the 6502 which was
coded in assembly.

As to why C was used here, my personal guess would be two-fold.  The
author probably knew how to code in C on mainframes.  Assembly on
mainframes is generally not that well known.  I.e., there is a
preference for programming in high-level languages on mainframes
instead of assembly.

Most implementations of Forth in C use a switch() statement instead of
implementing an actual interpreter using threaded code (ITC, DTC).

> From what I've read about Mr. Moores forth, eforth, etc, was that
> only a small group of primatives need be written and forth would
> evolve from those primatives.

Yes, the C.H. Ting variant of Bill Muench's eForth was coded in Forth
using only 36 primitives.  The remainder is in high-level Forth.  This
was considered to be the first Forth to use this method.  Before that,
most Forths were coded entirely in assembly.  Charles Moore has stated
that he considered 60 to 63 primitives to be the essence of Forth, but
I've never found out as to which.

Since the C.H. Ting eForth, there have been many other Forths using
this method, and they use from 13 to 72 primitives.  Ms. Rather prefers
the term low-level words instead of primitives, since the other words
will be coded in high-level Forth words when using this method to
implement Forth.


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#47293

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-05-18 18:00 -1000
Message-ID<zvGdnfxkp8_Np6DKnZ2dnUU7-afNnZ2d@supernews.com>
In reply to#47286
On 5/18/16 2:38 PM, Rod Pemberton wrote:
> On Wed, 18 May 2016 11:31:46 -0700 (PDT)
> Darin Murphy <murphy.darin@gmail.com> wrote:
>
>> One thing that had repeatedly popped up was that forth and C where
>> not very [compatible] with each other.
>
> Versions of Unix-Forth for PDP-11 and VAX were posted to net.sources in
> 1984 and are coded in C and Forth.  So, that would be just a few years
> after the release of the first fig-Forth in 1980 for the 6502 which was
> coded in assembly.
>
> As to why C was used here, my personal guess would be two-fold.  The
> author probably knew how to code in C on mainframes.  Assembly on
> mainframes is generally not that well known.  I.e., there is a
> preference for programming in high-level languages on mainframes
> instead of assembly.
>
> Most implementations of Forth in C use a switch() statement instead of
> implementing an actual interpreter using threaded code (ITC, DTC).
>
>> From what I've read about Mr. Moores forth, eforth, etc, was that
>> only a small group of primatives need be written and forth would
>> evolve from those primatives.
>
> Yes, the C.H. Ting variant of Bill Muench's eForth was coded in Forth
> using only 36 primitives.  The remainder is in high-level Forth.  This
> was considered to be the first Forth to use this method.  Before that,
> most Forths were coded entirely in assembly.  Charles Moore has stated
> that he considered 60 to 63 primitives to be the essence of Forth, but
> I've never found out as to which.
>
> Since the C.H. Ting eForth, there have been many other Forths using
> this method, and they use from 13 to 72 primitives.  Ms. Rather prefers
> the term low-level words instead of primitives, since the other words
> will be coded in high-level Forth words when using this method to
> implement Forth.

I'm not sure of the date of Ting's eForth, but the first Forth I saw in 
1971 (from Chuck Moore, of course) was coded using a Forth assembler for 
the lowest-level words as well as interrupt handlers and time-critical 
functions, and that was the model from the beginning of FORTH, Inc. 
(1973). I think Ting's work was at least 10 years later. The early 
FIGforth implementations in the late 70's were all assembler.

I think the difference between Chuck's estimate of 60+ primitives and 
Ting's much lower number is that Ting was trying to establish a minimum 
regardless of performance, and Chuck included things that really need to 
be fast. For example, you could write things like CMOVE in high-level, 
but it would be much faster in code, at least in the days of 
indirect-threaded implementations and before optimizing code compilers.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#47298

Frompahihu <pahihu@gmail.com>
Date2016-05-19 01:00 -0700
Message-ID<8b9720b7-0867-4376-b96a-2a151483b434@googlegroups.com>
In reply to#47286
> Charles Moore has stated
> that he considered 60 to 63 primitives to be the essence of Forth, but
> I've never found out as to which. 

Hi,

See Glen Haydon's "Levels of Forth"
http://www.forth.org/literature/forthlev.html

and in Vierte Dimension 3/87 "FORTH - eine persönliche Sprache"
(the same list as in Haydon's Level 0).

pahihu

[toc] | [prev] | [next] | [standalone]


#47331

FromRod Pemberton <NoHaveNotOne@bcczxcfre.cmm>
Date2016-05-19 19:14 -0400
Message-ID<20160519191406.2a774ee4@_>
In reply to#47298
On Thu, 19 May 2016 01:00:07 -0700 (PDT)
pahihu <pahihu@gmail.com> wrote:

> > Charles Moore has stated
> > that he considered 60 to 63 primitives to be the essence of Forth,
> > but I've never found out as to which.   
> 
> See Glen Haydon's "Levels of Forth"
> http://www.forth.org/literature/forthlev.html

I come up with a count of 38 for Glen Haydon's article.  The article
says that 45 are in the list and Chuck Moore used 63.

> and in Vierte Dimension 3/87 "FORTH - eine persönliche Sprache"
> (the same list as in Haydon's Level 0).
> 

I come up with a count of 46 for the Vierte Dimension article.

So, I'm still not sure which are the 63 that Chuck Moore used.


The Vierte Dimension 3/87 issue is here:
https://www.forth-ev.de/filemgmt/visit.php?lid=117

An archive of Vierte Dimension is here:
https://www.forth-ev.de/filemgmt/viewcat.php?op=&cid=1

Note the website and magazine are in German.


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#47332

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-05-19 14:44 -1000
Message-ID<ismdna3ioKWcw6PKnZ2dnUU7-SXNnZ2d@supernews.com>
In reply to#47331
On 5/19/16 1:14 PM, Rod Pemberton wrote:
> On Thu, 19 May 2016 01:00:07 -0700 (PDT)
> pahihu <pahihu@gmail.com> wrote:
>
>>> Charles Moore has stated
>>> that he considered 60 to 63 primitives to be the essence of Forth,
>>> but I've never found out as to which.
>>
>> See Glen Haydon's "Levels of Forth"
>> http://www.forth.org/literature/forthlev.html
>
> I come up with a count of 38 for Glen Haydon's article.  The article
> says that 45 are in the list and Chuck Moore used 63.

The article speaks of "the essence of Forth" which, to me, means the 
words one couldn't do without. That's not at all the same thing as being 
a "primitive" (a word coded in assembler or other implementing language 
such as C). A number of the words in this list would normally be 
high-level Forth definitions, such as DECIMAL, HEX, OCTAL (which is 
surely not essential!), CREATE, ALLOT, etc.

And I don't see @ ! c@ and c! which would surely be both essential and 
primitives.

I don't really see what the purpose of Haydon's list is, actually. The 
article itself appears to be sort of an early history of FIG and some 
other early public domain Forths.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#47307

FromAlbert van der Horst <albert@cherry.spenarnc.xs4all.nl>
Date2016-05-19 13:28 +0000
Message-ID<slrnnjrjev.c59.albert@cherry.spenarnc.xs4all.nl>
In reply to#47286
On 2016-05-19, Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> wrote:
> On Wed, 18 May 2016 11:31:46 -0700 (PDT)
<SNIP>

> Yes, the C.H. Ting variant of Bill Muench's eForth was coded in Forth
> using only 36 primitives.  The remainder is in high-level Forth.  This
> was considered to be the first Forth to use this method.  Before that,
> most Forths were coded entirely in assembly.  Charles Moore has stated
> that he considered 60 to 63 primitives to be the essence of Forth, but
> I've never found out as to which.

As you know I've made yourforth, the simplest possible Forth, with
careful pondering for each instruction whether it should be in assembler
or not.
The number of words coded in assembler is 62.
With the same design goals, simplicity-but-no-pseudo-simplicity you may
use yourforth as an example of what Chuck Moore had in mind.

(I don't think : -  NEGATE + ; makes a Forth simpler, even if it saves
one assembler instruction.).

<SNIP>

> Rod Pemberton
>

--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#47315

FromPaul Rubin <no.email@nospam.invalid>
Date2016-05-19 11:29 -0700
Message-ID<874m9tgauj.fsf@jester.gateway.pace.com>
In reply to#47286
Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> writes:
> Yes, the C.H. Ting variant of Bill Muench's eForth was coded in Forth
> using only 36 primitives.  The remainder is in high-level Forth.  This
> was considered to be the first Forth to use this method.  

What?  Forth-in-forth is/was very traditional and Figforth was written
that way long before eForth.  eForth went further than others to
minimize the number of primitives, but the basic approach was similar.

[toc] | [prev] | [next] | [standalone]


#47288

Fromhughaguilar96@gmail.com
Date2016-05-18 17:56 -0700
Message-ID<bab50d16-da18-4f2a-985a-ca6ba38655d0@googlegroups.com>
In reply to#47282
On Wednesday, May 18, 2016 at 11:31:47 AM UTC-7, Darin Murphy wrote:
> Not trying to cause a flame-war only trying to understand this evolutionary change and the reasoning behind it.  Prior to the decision I made a couple of weeks ago to learn forth, I had read lots and lots of information about the forth programming language, including it's history. One thing that had repeatedly popped up was that forth and C where not very compatable with each other. The strange thing though was that everywhere I researched ansi-forth implementations I found that they were written in forth (i.e., gforth), but could not find out when this switch was made in the history of forth and more importantly why.  From what I've read about Mr. Moores forth, eforth, etc, was that only a small group of primatives need be written and forth would evolve from those primatives. Also I had studied 8086 and 8088 assembly in the past and found it rather easier to write and read than C, which can be very confusing at times. I've also studied and programmed in C (trival stuff) to learn whether or not it was the write language for me, but decided for what I want to do it wasn't. Anyway, I hope this question doesn't create a very heated debate and I am only trying to understand forth and it's history better.  Thanks in advance for any information given and please understand that I mean harm in asking these possibly explosive questions. Take care now.

A lot of Forths (such as Raimond's LFTforth) are written in GCC --- GCC is a super-set of C with a lot of powerful features not provided in C, such as the use of registers as global variables --- the use of ANSI-C is going to result in a pretty slow Forth system.

[toc] | [prev] | [next] | [standalone]


#47289

FromDarin Murphy <murphy.darin@gmail.com>
Date2016-05-18 19:26 -0700
Message-ID<e8740f36-5269-4006-8a81-3a15bc816fbe@googlegroups.com>
In reply to#47288
Thanks everybody for getting me the low down. I was just curious as to why someone
would want to use anything other than forth, or assembly to write forth.  I don't
like C or C++ because I find them both very cryptic.

I have a more direct forth related question to ask if I may. Would anyone post few
short examples of "begin until" and "begin while repeat" loops please? I understand
"do loops" fairly well, but still a little fuzzy on understanding the use of the
other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
show examples of either of them.  Thank you in advance for any help, advice,
suggestions, and/or examples given.  Take care now.

[toc] | [prev] | [next] | [standalone]


#47290

Fromhughaguilar96@gmail.com
Date2016-05-18 20:16 -0700
Message-ID<3f797f0e-64b8-4586-a221-7987914f861b@googlegroups.com>
In reply to#47289
On Wednesday, May 18, 2016 at 7:26:53 PM UTC-7, Darin Murphy wrote:
> Thanks everybody for getting me the low down. I was just curious as to why someone
> would want to use anything other than forth, or assembly to write forth.  I don't
> like C or C++ because I find them both very cryptic.
> 
> I have a more direct forth related question to ask if I may. Would anyone post few
> short examples of "begin until" and "begin while repeat" loops please? I understand
> "do loops" fairly well, but still a little fuzzy on understanding the use of the
> other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
> show examples of either of them.  Thank you in advance for any help, advice,
> suggestions, and/or examples given.  Take care now.

There are a lot of examples of BEGIN WHILE REPEAT in the novice-package --- I rarely use BEGIN UNTIL (and I won't support it in my language).

I recommend against using the multiple exits from BEGIN WHILE REPEAT with THEN after the REPEAT --- that is a bizarre idea introduced in ANS-Forth --- when I need multiple exits from a loop I put the loop in a function by itself and use IF ... EXIT THEN to get out.

Anyway, here are a few examples copied form the novice-package:

: non-zeros ( 0 numbers... -- 0 numbers... count )                      
\ counts the non-zero numbers on the stack
    0                                           \ -- count
    0 >r  begin  over while  swap >r  1+ repeat nip
    0 swap  begin  r>  ?dup while  swap  repeat ;

: <reverse-stack> ( 0 numbers... count -- 0 numbers... )
    0 ?do  I roll  loop ;

: reverse-stack ( 0 numbers... -- 0 numbers... )                        
\ reverse the order of the non-zero numbers
    non-zeros  <reverse-stack> ;

: <dup-stack> ( 0 numbers... count -- 0 numbers... 0 numbers... )
    dup 1+  0  do  >r  r@ pick  r>  loop drop ;

: dup-stack ( 0 numbers... -- 0 numbers... 0 numbers... )               
\ duplicate the pile of numbers
    non-zeros  <dup-stack> ;

: <drop-stack> ( 0 numbers... count )
    0 do  drop  loop
    drop ;

: drop-stack ( 0 numbers... )                                           
\ drop the pile of numbers
    non-zeros  <drop-stack> ;

: <non-zeros,> ( 0 numbers... count -- )
    <reverse-stack>
    begin  ?dup while  ,  repeat ;

: non-zeros, ( 0 numbers... -- )                                        
\ comma the pile of numbers into the dictionary
    non-zeros  <non-zeros,> ;

macro: non-zeros>r ( 0 numbers... -- )
    0 >r  begin  ?dup while  >r  repeat ;

macro: r>non-zeros ( -- 0 numbers... )
    0  begin  r> ?dup while  repeat ;

macro: n>r ( numbers... count -- )
    begin  ?dup while  swap >r  1- repeat ;

macro: nr> ( count -- numbers... )
    begin  ?dup while  r> swap  1- repeat ;

[toc] | [prev] | [next] | [standalone]


#47291

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-05-18 17:51 -1000
Message-ID<iaadnXKjzIDcpaDKnZ2dnUU7-avNnZ2d@supernews.com>
In reply to#47289
On 5/18/16 4:26 PM, Darin Murphy wrote:
> Thanks everybody for getting me the low down. I was just curious as to why someone
> would want to use anything other than forth, or assembly to write forth.  I don't
> like C or C++ because I find them both very cryptic.
>
> I have a more direct forth related question to ask if I may. Would anyone post few
> short examples of "begin until" and "begin while repeat" loops please? I understand
> "do loops" fairly well, but still a little fuzzy on understanding the use of the
> other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
> show examples of either of them.  Thank you in advance for any help, advice,
> suggestions, and/or examples given.  Take care now.
>
May I highly recommend to you my book "Forth Application Techniques" 
(available from Amazon). It is the notebook for the beginning Forth 
course I and others from FORTH, Inc. taught for many years, and includes 
not only examples but also many simple exercises. Using this book in a 
5-day course was sufficient for most programmers to be productive in Forth.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#47292

Fromhughaguilar96@gmail.com
Date2016-05-18 20:54 -0700
Message-ID<6c4f43b3-d1f8-4f17-9396-07252d6896a6@googlegroups.com>
In reply to#47291
On Wednesday, May 18, 2016 at 8:51:30 PM UTC-7, Elizabeth D. Rather wrote:
> On 5/18/16 4:26 PM, Darin Murphy wrote:
> > Thanks everybody for getting me the low down. I was just curious as to why someone
> > would want to use anything other than forth, or assembly to write forth.  I don't
> > like C or C++ because I find them both very cryptic.
> >
> > I have a more direct forth related question to ask if I may. Would anyone post few
> > short examples of "begin until" and "begin while repeat" loops please? I understand
> > "do loops" fairly well, but still a little fuzzy on understanding the use of the
> > other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
> > show examples of either of them.  Thank you in advance for any help, advice,
> > suggestions, and/or examples given.  Take care now.
> >
> May I highly recommend to you my book "Forth Application Techniques" 
> (available from Amazon). It is the notebook for the beginning Forth 
> course I and others from FORTH, Inc. taught for many years, and includes 
> not only examples but also many simple exercises. Using this book in a 
> 5-day course was sufficient for most programmers to be productive in Forth.
> 
> Cheers,
> Elizabeth

Don't buy that book --- it is no good --- it will retard your effort at learning Forth.

Here is an example:

On Sunday, August 9, 2015 at 7:30:10 PM UTC-7, Elizabeth D. Rather wrote:
> Here's [an array definer] presented in my Forth Application Techniques that I think is
> far more useful than the FSL version:
>
> : ARRAY ( n -- )   CREATE DUP , CELLS ALLOT
>     DOES> ( n -- a)   SWAP OVER @ OVER < OVER
>        1 < OR ABORT" Out of Range" CELLS + ;

[toc] | [prev] | [next] | [standalone]


#47357

FromJUERGEN <epldfpga@aol.com>
Date2016-05-20 10:49 -0700
Message-ID<d62f4178-87a4-4dce-87b0-5b4fd15b1fe1@googlegroups.com>
In reply to#47291
On Thursday, May 19, 2016 at 4:51:30 AM UTC+1, Elizabeth D. Rather wrote:
> On 5/18/16 4:26 PM, Darin Murphy wrote:
> > Thanks everybody for getting me the low down. I was just curious as to why someone
> > would want to use anything other than forth, or assembly to write forth.  I don't
> > like C or C++ because I find them both very cryptic.
> >
> > I have a more direct forth related question to ask if I may. Would anyone post few
> > short examples of "begin until" and "begin while repeat" loops please? I understand
> > "do loops" fairly well, but still a little fuzzy on understanding the use of the
> > other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
> > show examples of either of them.  Thank you in advance for any help, advice,
> > suggestions, and/or examples given.  Take care now.
> >
> May I highly recommend to you my book "Forth Application Techniques" 
> (available from Amazon). It is the notebook for the beginning Forth 
> course I and others from FORTH, Inc. taught for many years, and includes 
> not only examples but also many simple exercises. Using this book in a 
> 5-day course was sufficient for most programmers to be productive in Forth.
> 
> Cheers,
> Elizabeth
> 
> -- 
> ==================================================
> Elizabeth D. Rather   (US & Canada)   800-55-FORTH
> FORTH Inc.                         +1 310.999.6784
> 5959 West Century Blvd. Suite 700
> Los Angeles, CA 90045
> http://www.forth.com
> 
> "Forth-based products and Services for real-time
> applications since 1973."
> ==================================================

eBooks and the web are fine and there is a lot around about Forth, but having the Forth Application Techniques as real book in your hand - ordered together with Leo's Thinking Forth book ( my Starting Forth is falling apart now ) is really fun to look at and to read. Thanks for the effort of writing and publishing them. I wonder which better Forth books are around ( not omitting Chucks books obviously )

[toc] | [prev] | [next] | [standalone]


#47302

Fromhumptydumpty <ouatubi@gmail.com>
Date2016-05-19 01:59 -0700
Message-ID<bfd11f2e-789b-4d24-aaed-4f64674e8492@googlegroups.com>
In reply to#47289
On Thursday, May 19, 2016 at 5:26:53 AM UTC+3, Darin Murphy wrote:
> Thanks everybody for getting me the low down. I was just curious as to why someone
> would want to use anything other than forth, or assembly to write forth.  I don't
> like C or C++ because I find them both very cryptic.
> 
> I have a more direct forth related question to ask if I may. Would anyone post few
> short examples of "begin until" and "begin while repeat" loops please? I understand
> "do loops" fairly well, but still a little fuzzy on understanding the use of the
> other two.  The copy of "Staring Forth" I've been reading from Forth Inc. doesn't
> show examples of either of them.  Thank you in advance for any help, advice,
> suggestions, and/or examples given.  Take care now.

Hi!
If you understand '..IF...THEN',
you should quickly understand 'BEGIN..WHILE...REPEAT'.

'..IF...THEN' :

( input-parameters ) test IF action THEN

Now, if 'action' modifies 'input-parameters' so that there
exists cases when 'test' do not pass (loop termination condition!),
could be written then:

( input-parameters ) BEGIN test WHILE action REPEAT,

where 'input-parameters', 'test' and 'action' are the same
sequences data/code as for  '..IF...THEN' case presented before.

Have a nice day,
humptydumpty

[toc] | [prev] | [next] | [standalone]


#47318

FromDarin Murphy <murphy.darin@gmail.com>
Date2016-05-19 12:04 -0700
Message-ID<c62f7ede-b184-4ba0-abd8-27c2cae9ffc8@googlegroups.com>
In reply to#47302
Thanks Hugh and Humptydumpty for showing me other examples of "begin while repeat".
They helped me a lot in understanding it. Brodie's example threw me because it used
xxxx and ffff which was rather vague. Humptydumpty's was very clear and to the point,
which pretty much was all I needed.  Thanks again both of you for your help! 

[toc] | [prev] | [next] | [standalone]


#47308

FromAlbert van der Horst <albert@cherry.spenarnc.xs4all.nl>
Date2016-05-19 13:58 +0000
Message-ID<slrnnjrl6f.c59.albert@cherry.spenarnc.xs4all.nl>
In reply to#47289
On 2016-05-19, Darin Murphy <murphy.darin@gmail.com> wrote:
> Thanks everybody for getting me the low down. I was just curious as
> to why someone > would want to use anything other than forth, or
> assembly to write forth. I don't > like C or C++ because I find them
> both very cryptic.

As an author of an assembler based Forth (ciforth) I find opinions of
authors of c-based Forth's (gforth, Anton Ertl) concerning this
subject partly incorrect.
It is generally assumed that assembler causes portability problems.
However that is offset by the greater effort needed to keep a huge
system (gforth) based on an even larger system (the gnu compiler
collection) afloat, versus the ultimate transparency of assembler
language.  A defect in an obscure corner of gcc can cause problems
for gforth. There can be doubt about whether a particular change
is a defect or not. Also there are other changes that are considered
an improvement by some, and a miscompilation by others.
A defect in fasm directly contradicts Intel data sheets, there is no
weasling out.

IMO the decisive argument for using C as an implementation language
lies elsewhere. ciforth is outside of the main stream, and I feel it.
Complicated processors like the latest 64-bit Intel, need so many
expert knowledge to get optimal code, that it is likely to be spent
only once. In the case of gcc that is around C, with benefits
spreading out to related languages like C++.
Languages like Python, Perl and Factor all are c-based, even if
the bulk of the compiler is in the language itself.

There is also the ease of integrating c-libraries. So much code
e.g. graphics and numeric libraries is written in C, and is
unlikely to ever be duplicated in Forth. This is less forceful,
because calling c-libraries from Forth is commonplace.
(That may be so, but I've not come around adding c-calls to linux
ciforth. I've added  c-calls to 32-bit MS-Windows and it turned out
less difficult than I imagined. )

<SNIP>

Groetjes Albert
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#47311

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2016-05-19 15:07 +0000
Message-ID<2016May19.170745@mips.complang.tuwien.ac.at>
In reply to#47308
Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> writes:
>It is generally assumed that assembler causes portability problems.

So, how many (and which) targets do you maintain for your
assembly-based Forth systems.

>However that is offset by the greater effort needed to keep a huge
>system (gforth) based on an even larger system (the gnu compiler
>collection) afloat, versus the ultimate transparency of assembler
>language.  A defect in an obscure corner of gcc can cause problems
>for gforth. There can be doubt about whether a particular change
>is a defect or not. Also there are other changes that are considered
>an improvement by some, and a miscompilation by others.

Yes, the recent (actually, not that recent anymore, but more recent
than our decision to use GNU C) attitude problems of C compiler
maintainers are a problem, and that's why we plan to move away from C.
But these problems did not exist when we and most other people who
wrote Forth systems that use C for the primitives decided to use C.

>A defect in fasm directly contradicts Intel data sheets, there is no
>weasling out.

Yes, with the current attitude of C compiler maintainers, assembly
language is much more reliable and solid than C.  Also, the number of
relevant architectures is shrinking, so the additional portability
effort for assembly language is getting smaller.

>Complicated processors like the latest 64-bit Intel, need so many
>expert knowledge to get optimal code, that it is likely to be spent
>only once. In the case of gcc that is around C, with benefits
>spreading out to related languages like C++.

Except that the GCC maintainers don't have that expert knowledge (I
certainly have not seen any evidence of such knowledge, and have seen
evidence of lack of such knowledge). Instead, they (and their brethren
in mind from the LLVM/Clang camp) prefer to play around with enhancing
the intermediate representation with "knowledge" about undefined
behaviour and how they can use that for "optimizations" rather than
concentrating on real optimizations, where expert knowledge about
processors would be useful.

However, the thing about expert knowledge is not new.  E.g., when we
started with Gforth, we made a performance comparison with a Forth
system written in assembly language by Bernd Beuster, and Gforth was
faster.  Why?  Because Beuster's Forth used LODS (4 cycles on the 486)
in NEXT, while GCC used two simpler instructions (each 1 cycle on the
486) instead.  This was on the 486, a CPU introduced in 1989.  Bernd
Beuster fixed his system, but many systems continued to use LODS for a
long time, because once, on the 8086, it was a good idea.

Intel and AMD are publishing nice optimization manuals.  Read them!

- 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: http://www.forth200x.org/forth200x.html
   EuroForth 2016: http://www.euroforth.org/ef16/

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.forth


csiph-web