[comp.lang.forth] Object Oriented Forth..

rfl@oddjob.UChicago.EDU (Bob Loewenstein) (03/09/88)

The implementation of Neon on the Mac is a very nice object
oriented implementation of forth.  The company gives out the
high level code{ which is loaded onto a near fig kernel. The
major difference in the kernel is the addition of a third
stack (great with 68000 machines) for object and method use
as well as named input parameters and local variables inside of
forth words.

wmb@SUN.COM (Mitch Bradley) (04/15/89)

There are lots of object oriented packages for Forth.  Dick Pointain
wrote a book about object oriented Forth extensions.  Forthtalk is an
object-oriented extension package for MacForth.  There is a language
called NEON which is an object-oriented Forth for the Mac.  Dr. Steven
Lewis wrote an enhanced version called Boron, which runs on my
Forthmacs Forth implementation for Atari ST, Mac, and Suns.  It has
been described in several journals, most recently in the 1989
Rochester Forth Conference proceedings.

Mitch

ForthNet@willett.UUCP (ForthNet articles from GEnie) (01/21/90)

 Date: 01-19-90 (08:19)              Number: 2799
   To: GENE LEFAVE                   Refer#: 2793
 From: RAY DUNCAN                      Read: NO
 Subj: POLYFORTH OBJECTS             Status: PUBLIC MESSAGE

 For users of LMI's UR/FORTH systems, a version of Dick Pountain's object
 word set has been available on the LMI Forth Board for some months. It
 can be downloaded from the file URPOUN.ARC in conference 4 on the LMI
 Forth Board.

 NET/Mail : LMI Forth Board, Los Angeles, CA (213) 306-3530             
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (01/21/90)

Category 3,  Topic 41
Message 12        Sat Jan 20, 1990
D.RUFFER [Dennis]            at 22:02 EST
 
Gene, I've been doing a little bit of playing with you POLYOBJ file. It has a
couple of problems with working on 8086 PolyForth.  I've tried to make the
changes, but now the system isn't working anymore. It might be easier if you
make a few changes and re-post it, since you know what makes it tick and how
to check it.  I'm just getting to lost in it to trust my changes anymore.

First, it is not recommended to change the function of existing words.  You
change to the nucleus is ok, but I would call it another name instead of using
an existing name.  I changed your definition of -FIND to -FINDS and left the
original -FIND alone.

Next, in quite a few places, you used 4 or 4+ where you should have used 1
CELL and CELL+.  I made the changes, but I'm not sure I hit them all.  Most of
your stuff was ok, but blocks 1 and 2 were the worst cases.  It is particulary
difficult to know what to do with user variables, but the best bet is to use 1
CELLS instead of a literal number.

On the user variables, a relatively standard way to start them off is with the
following statement:

STATE STATUS -  CELL+  ( last  user offset from block 198)

Then, at the end of the block you can use the following to let you know how
many have been used:

CR .( Last USER =) .

You appear to have added the definition CELLS+ that is not standard. I've just
returned that to CELLS + as it should have been.

The definition L@ uses a thing called -LINKS to remove some of the bits of the
link field.  That is only needed on the 386 version.  I believe that L@ can be
defined as AKA @ L@ for the 8086.

The definition SEAL is just too large and I get an "out of range" error on the
/LOOP.  I tried to refactor it, but I think that is where I messed up.  Try
your hand at seeing if you can keep the DO and the /LOOP a little closer
together.  I think I can see what you are doing there, but you can do a better
job a factoring it than I can and you know how to test it.

That's as far as I got, but now the dictionary links are messed up after I
load block 7.  I believe the END> is the one that is doing it, which uses my
butchered SEAL, but finding the problem is more than I want to deal with right
now.

Thanks.   DaR
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (02/03/90)

 Date: 02-02-90 (02:23)              Number: 2842 (Echo)
   To: DENNIS RUFFER                 Refer#: 2804
 From: GENE LEFAVE                     Read: NO
 Subj: OBJECT ORIENTED FORTH         Status: PUBLIC MESSAGE

 Sorry Dennis, I didn't realize just how incompatible with 8086 pF
 it was.  I just got back from vacation so give me a few days to
 look it over.
 .
 Just for starters the 17 CELLS used through out is wrong. This 
 should be CURRENT  CONTEXT -  assuming that  context preceeds
 the threads and current follows.  The 17 is from 16 threads plus
 CONTEXT
 .
 What I think would be a better solution is a whole new version
 of -FIND that takes an address of a single dictionary
 thread and searches fig style.  This would save a lot of trouble.
 .
 The problem with SEAL is probably related to the 17 CELLS.  I don't
 off hand recall what is after CURRENT but I'm sure setting it to 0
 will cause a lot a problems.  SEAL scans down all the threads
 and creates a little mini dictionary for the object.
 .
 I'll try to post a new version shortly.
 .
 Gene

 ---
  ~ EZ-Reader 1.13 ~ 
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (03/17/90)

 Date: 03-13-90 (16:23)              Number: 134 (Echo)
   To: ALL                           Refer#: NONE
 From: IAN GREEN                       Read: (N/A)
 Subj: OOPS AND FRAMEWORK III        Status: PUBLIC MESSAGE

    Anybody ever try using FW to do object oriented programming? After 
 all FW itself is an object oriented system in itself.
    A little while ago I found an archive called HELPMAN that contained 
 some old but interesting material describing some Knowledge Oriented 
 Programming Systems and a few sample FW files. After converting the old 
 FW2 stuff to FW3 (easy) I decided to try it out. Has anybody else ever 
 tried this stuff out?

 Ian Green

 NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886   
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/02/90)

Category 3,  Topic 41
Message 16        Sun Jul 01, 1990
GARY-S                       at 06:44 EDT
 
  
  PORTED FROM Wetware =>
              -------
 --------------------
 Item 13 by Luther Huffman (luther), on Sat, Jun 16, 1990 (08:49)
 Object-Oriented Forth?

 I've read about Dick Pountain's "Object-Oriented Forth" book.I was wondering
 if anybody has actually included his features into their compilers/inter-
 preters?  Do you think they might be useful features or take away from the
 use of Forth as a quick tool akin to a super assembler.  

 My thoughts on this is that OO would be useful, at least as an option.
 After all, object-oriented techniques are useful even in assembly
programming.
 I've also always been reminded by Forth of Lisp and OO libraries are "hot"
 right now in Lisp (CLOS and the like).
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/03/90)

Category 3,  Topic 41
Message 17        Mon Jul 02, 1990
GARY-S                       at 06:46 EDT
 
             
  PORTED FROM Wetware =>
              -------

 --------------------
 Item 13 by Luther Huffman (luther), on Sat, Jun 16, 1990 (08:49)
 Object-Oriented Forth?

 1 new of 2 responses total.

 #13.2 (2) by Luther Huffman (luther), on Sat Jun 30 07:15:43 1990:
    Is Weinstein's OOF based on Pountain's ideas?  Do you know whether an OOF
  has been ever implemented as a compiler or are they all implemented as
  interpreters?

 Response by Gary Smith:
 To my best knowledge (often suspect) there are no compiler implementations
 >of OOF.
 >Dave's OOF is more akin to SmallTalk than to Ada. He has full object and
 >message support, inheritance... etc. The revised version is not out, but
 >I believe it will be quite impressive. Those who read 'THe Computer Journal'
 >have been able to follow Dave's plans in print, in his Forth column. TCJ
 >is probably the last true grass roots Computer Magazine around since the
 >death of 'MicroCornucopia' last year.
 >  gars
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

dwp@willett.UUCP (Doug Philips) (07/03/90)

>  Response by Gary Smith:
>  To my best knowledge (often suspect) there are no compiler implementations
>  >of OOF.
>  >Dave's OOF is more akin to SmallTalk than to Ada. He has full object and
>  >message support, inheritance... etc. The revised version is not out, but
>  >I believe it will be quite impressive. Those who read 'THe Computer Journal'
>  >have been able to follow Dave's plans in print, in his Forth column. TCJ
>  >is probably the last true grass roots Computer Magazine around since the
>  >death of 'MicroCornucopia' last year.
>  >  gars

First, MicroCornucopia didn't die last year.  It did a couple of months
ago.  But, would someone please post or email to me the address / phone
number for 'The Computer Journal'?  Do they have Forth columns very
frequently?  I still scan Computer Language hoping to find something
there upon occasion.  BTW:  I thought that the last two issues of FD
were particularly juicy.  Thanks to the editors/publishers, and esp. to
the writers!

-Doug

---
Preferred: willett!dwp@hobbes.cert.sei.cmu.edu OR ...!sei!willett!dwp
Daily: ...!{uunet,nfsun}!willett!dwp   [in a pinch: dwp@vega.fac.cs.cmu.edu]

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/05/90)

 Date: 07-02-90 (08:39)              Number: 3448 (Echo)
   To: GARY SMITH                    Refer#: 3437
 From: JACK WOEHR                      Read: NO
 Subj: OBJECT ORIENTED FORTH         Status: PUBLIC MESSAGE

 >  
 >  PORTED FROM Wetware =>
 >              -------
 > --------------------
 > Item 13 by Luther Huffman (luther), on Sat, Jun 16, 1990 (08:49)
 >
 > I've read about Dick Pountain's "Object-Oriented Forth" book.I was won
 > if anybody has actually included his features into their compilers/int
 > preters?  Do you think they might be useful features or take away from
 > use of Forth as a quick tool akin to a super assembler.  
 >

        JForth on the Amiga features ODE, the Object Development
 Environment, a great Object Oriented loadable option. See my file
 JAXBOXES.whatever-compression floating around better ForthNet
 BBSes everywhere.

                =jax= 

 NET/Mail : RCFB Golden, CO (303) 278-0364 VESTA & Denver FIG for Forth!
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/11/90)

 Date: 07-06-90 (18:29)              Number: 3467 (Echo)
   To: GARY SMITH                    Refer#: 3437
 From: GENE LEFAVE                     Read: NO
 Subj: OBJECT ORIENTED FORTH         Status: PUBLIC MESSAGE

 GS> I've read about Dick Pountain's "Object-Oriented Forth" book.I was
wondering
 GS> if anybody has actually included his features into their compilers/inter-
 GS> * Origin: GEnie and the Forth Interest Group

 I've implemented most of Pountains words in 32 bit polyFORTH.  I haven't had
a 
 chance to give them a good workout yet.  I'm using them to implement a
database 
 program.   It's very conveniant not to have to remember what the data type is

 for every field in the database.   Also, in my case, I can now completely
hide 
 the access method for data fields that are reached via links and/or 
 computations.   I'm working on some screen stuff now to hide the display and 
 input functions.

 ---
  ~ EZ-Reader 1.13 ~ 
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/11/90)

Category 3,  Topic 41
Message 20        Sat Jul 07, 1990
GARY-S                       at 07:58 EDT
 
             
   To: GENE LEFAVE  
 Subj: OBJECT ORIENTED FORTH 

 In a message from ECFB Gene Lefave writes:
 >I've implemented most of Pountains words in 32 bit polyFORTH.  I haven't 
 >had a chance to give them a good workout yet.  I'm using them to implement
 >a database program.

   I hope you'll share the code with all of us in the near future, Gene. A
   database sounds like an excellent oof application.
    Gary
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/11/90)

Category 3,  Topic 41
Message 21        Sun Jul 08, 1990
D.RUFFER [Dennis]            at 01:41 EDT
 
Gary, Gene has given us his code.  In fact, we have quite a few object
oriented extensions to Forth in the libraries.  Here is a list of some of
them:

[If anyone wants these items, drop me a message at one of the
 addresses at the end of this message.  I cannot process any requests
 which do not include the two-line description of the files you want.
 The files will be mailed to UUENCODED.  --dwp]

  No. File Name      Type Address       YYMMDD    Bytes Accesses Lib
 1977 POLYOBJ.ZIP     X   J.SHIFRIN     900120     6300     19     5
    KEEP  Desc: polyFORTH objects - Obj Oriented
 1895 OO4TH21.ARC     X   OLORIN        891118    15120     53     5
    KEEP  Desc: Version 2.1: Complete OOPS for Forth
 1879 OOFORTH.ARC     X   OLORIN        891102    15120     39     5
    KEEP  Desc: Object Oriented Forth Extension(PD)
 1630 INTR_OOP.ARC    X   B Newburger   890318    10080     23     3
    KEEP  Desc: Introduction to Object-Oriented Prog
 1497 OOPS.ARC        X   ECFB          890131     7560     47     5
    KEEP  Desc: OBJECT ORIENTED PROGRAMMING SYSTEM
 1473 LOCALOBJ.ARC    X   R Bicknell    890121     6300     22     5
    KEEP  Desc: Locals and Objects for Atari ST
 1256 UR-POUN.ARC     X   J.NELSON5     880923    20160      7     5
    KEEP  Desc: Pountain Types in UR/FORTH: JGN
 1255 UR-OBJS1.ARC    X   J.NELSON5     880923    12600      4     5
    KEEP  Desc: UR/FORTH object descriptions: JGN
 1254 JGN-EG1.ARC     X   J.NELSON5     880923    39060     18     5
    KEEP  Desc: Objects in Real Time Control: JGN
 1152 BINDING.ARC     X   DHWEINSTEIN   880821     3780      6     5
    KEEP  Desc: Changes Forth to a late binding lang
 1150 EDO.ARC         X   G HAWKINS     880821    15120     10     5
    KEEP  Desc: EXTENDED DATA OBJECTS IN FORTH
 1127 OBJECTS.TXT     X   R HOSELTON    880808    31500     22     5
    KEEP  Desc: OBJECT PROGRAMMING SUPPORT TOOLS
 1124 OBJECTS.ARC     X   R HOSELTON    880807     6300     30     5
    KEEP  Desc: OBJECT PROGRAMMING SUPPORT TOOLS
 1016 DIMARRAYS8.ARC  X   JAX           880420     2520     14     6
    KEEP  Desc: N-dimensional self-indexing objects
 1015 NU-DIMARRAYF83  X   JAX           880417     2520     21     6
    KEEP  Desc: N-dimensional self-indexing objects
 1014 NU-DIMARRAYJ4T  X   JAX           880417     2520     12     6
    KEEP  Desc: N-dimensional self-indexing objects
 1011 DIMARRAYALL.AR  X   JAX           880416     2520      7     6
    KEEP  Desc: Combined file DIMARRAY + DIMLIMS

DaR
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.UUCP (ForthNet articles from GEnie) (07/16/90)

 Date: 07-14-90 (03:40)              Number: 3501 (Echo)
   To: GARY SMITH                    Refer#: 3469
 From: GENE LEFAVE                     Read: NO
 Subj: OBJECT ORIENTED FORTH         Status: PUBLIC MESSAGE

 To: Gary Smith   c/o Genie

 GS>   I hope you'll share the code with all of us in the near future, Gene. A
 GS>   database sounds like an excellent oof application.

 Much of the internals have more than a passing resemblence to Forth Inc's 
 DataBase facility.  I'm not sure what they would think about posting it. 
Also, 
 providing docs for their words would be a big undertaking.

 A working 32 bit version of Pountain's wordset is on ECFB.   There's a couple

 of spots where I didn't use the new CELL words correctly for 16 bit Forth.  I

 was planning on posting it one of these days real soon now.  You must have
the 
 book to even think about understanding the code.  In addition the code is set

 up for multiuser polyFORTH, which means lots of fiddling with dictionary 
 threads.

 Gene


 ---
  ~ EZ-Reader 1.13 ~ 
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

dwp@willett.pgh.pa.us (Doug Philips) (05/29/91)

In article <1991May28.203116.23910@ecst.csuchico.edu>,
	fish@ecst.csuchico.edu (Kevin Haddock) writes:
> Now how this relates to FORTH coding conventions and readability.  First
> thing I have against FORTH syntax and all the OOPS I have run across
> is they all have the syntax BACKWARDS!  The VERB COMES FIRST!!!!

I'm not sure what you are saying here.  Are you saying that having the
verb come first is backwards (SmallTalk has the object first) or that
having the object come first is backwards and the verb *should* be
first?

> The biggest problem I see with FORTH is that you have to make up
> so many names and concatenate all kinds of wierd 'jerry rigged' syntax
> around them to convey what they are.  Either that or you have
> to resort to long-hyphenated-names and the vertical code that
> goes along with it.  I have been working on a parser that I believe
> corrects that problem.  It works something like this: The verb is
> an object who's behavior when parsed/interpreted is to put it's
> selector object (the token that represents the message) on the stack.
> Whenever a noun is interpreted it's behavior is to send itself to
> the verb object on top of the stack (or does the second send itself to the
> first, I can't remember; it's been awhile since I played with this).
> At the end of the processing of a method the remaining objects on
> the stack are sent to each other until just 'inert' objects remain
> as results.  Those 'inert' objects are basically those that have had
> all their argument needs satisfied.

I very much dislike active message names.  They are too clumsy to pass
around as parameters.  Same goes for active object names (you have to
name every object or special case arrays and records/structures and...)

> With this type of parser/interpreter and an object oriented system,
> a FOOL could be very readable because you would re-use lots of little
> verbs, create a few short sweet nouns, and the source code would not
> look like some kind of reverse-polish-greek-form-of-hyphenated-pig-latin!

I don't think you've made the case for having to have long hyphenated
names.  And reverse polish is the nature of Forth.  

> Another quick note:  In a true object oriented system the objects are
> created unbound and float on the stack until they are either no longer
> needed (90% of the cases) or are bound to a name.  I haven't seen
> too many FORTH OOP's that do this (but then again I haven't seen too
> many FORTH OOPS!).

The question is really one of what OOP oughta look like in Forth.

OOP requires knowing the types of things.
	Forth is traditionally untyped.

OOP usually requires automatic memory management.
	Forth is traditionally very flexible in letting you roll
	    your own memory management.

Therefore adding OOP to Forth is _not_ just adding a few new defining
words (object, class, message, whatever), but requires an integrated
effort to achieve a typed _and_ memory managed system onto which an OOP
can be added.  That is, if you want to go the whole nine yards and have
a full blown OOP Forth.  (IMNSHO).

-Doug
---
Preferred:  dwp@willett.pgh.pa.us	Ok:  {pitt,sei,uunet}!willett!dwp