home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / forth / mac / 39 < prev    next >
Encoding:
Text File  |  1992-12-21  |  4.7 KB  |  93 lines

  1. Newsgroups: comp.lang.forth.mac
  2. Path: sparky!uunet!think.com!sdd.hp.com!ux1.cso.uiuc.edu!news.iastate.edu!bible
  3. From: bible@iastate.edu (Anthony E Bible)
  4. Subject: Re: Stand-alone code segments in Forth
  5. Message-ID: <BzIG0v.BwL@news.iastate.edu>
  6. Keywords: Pocket Forth WDEF XCMD blah blah blah
  7. Sender: news@news.iastate.edu (USENET News System)
  8. Organization: Iowa State University, Ames, IA
  9. References: <BzH7AK.5s7@news.cso.uiuc.edu>
  10. Date: Sat, 19 Dec 1992 14:24:30 GMT
  11. Lines: 80
  12.  
  13. In article <BzH7AK.5s7@news.cso.uiuc.edu> schalk@symcom.math.uiuc.edu (Ken Schalk) writes:
  14. >    I'm new to Forth and enjoying it immensely, but I have a question
  15. >about stand-alone code segments, such as WDEFs and XCMDs.  Let me just
  16. >say that I experienced in other languages (Pascal, C, C++, ...) and
  17. >the Mac Toolbox, and have written both WDEFs and XCMDs in the past.
  18. >    What I'm wondering is, is it possible to build such things with
  19. >any of the Mac Forth incarnations?  (Personally, I am toying with
  20. >Pocket Forth currently, as it is free.)  If so, how does the
  21. >implementation go about building the code resource?  Does it just take
  22. >a copy of the dictionary and add some setup code and a jump to the
  23. >entry-point word at the beginning?  If not, what the heck does it do?
  24. >
  25. >    My guess is that it probably hasn't been done, as I think it might
  26. >be kind of painful to turn a Forth dictionary (or some subset thereof)
  27. >into a stand-alone code resource.  However, I think it would be
  28. >wonderful if it were possible.  Having written these things in the
  29. >past, I think the concept of a WDEF in Forth is a beautiful thing.
  30. >(Heck, once you had the basics laid out, you could churn out WDEF
  31. >after WDEF all the time, leading to a distinctive look for your apps,
  32. >albeit a degeneration of the interface standard. :-)
  33. >
  34.  
  35.     The following is excerpted from the MacForth 4 manual:
  36.  
  37. Stand-Alones: XCMD's, Drivers, ...
  38.  
  39. Overview
  40.  
  41. MacForth Plus 4.0 provides the capability of creating small stand-alone code
  42. units, such as HyperCard XCMD's, FKEY's and drivers, from high-level MacForth.
  43. Stand-Alones (or "SA's") run completely independent of MacForth and can be as
  44. small as a few hundred bytes.  They do, however, execute code in the same
  45. manner as MacForth (ie, using 16-bit tokens that are offsets from NEXT).  Most
  46. words that are defined in MacForth can become part of a stand-alone; however,
  47. there are some cases that require special care, as described below.  Additional
  48. words are provided specifically to support XCMD's and drivers (which include
  49. desk accessories).
  50.  
  51.  
  52.  
  53.     Although I have programmed in several languages on several different
  54. machines I am relatively new to the Macintosh programming environment (and to
  55. programming in Forth, for that matter) so I cannot respond to your other
  56. questions.  Sorry.
  57.  
  58.  
  59.     I guess I should put a disclaimer in here.  I have no connection with
  60. Creative Solutions (the mother of MacForth) other than having purchased the
  61. package from them and being glad that I did.
  62.  
  63.  
  64.     I will also make a personal observation about PD versus Commercial
  65. Forth packages.  I have used some PD Forth's in the past when I first
  66. encountered the language.  Some are better than others (or vice-versa) and
  67. they do provide you with a chance to get some hands-on experience with the
  68. language; however, the ones I have used have tended to be pretty buggy and/or
  69. have no (or little, or poor) documentation.  Consequently, I was never sure
  70. whether the errors were mine (usually) or the Forth's (not un-usually).
  71. Furthermore, when you are programming in the context of an operating system you
  72. need tools to interact with the operating system.  Again, this tends to be a
  73. weak area for PD Forth's in my (limited) experience.  I only have experience
  74. with two commercial packages (one direct, the other second hand).  My direct
  75. experience is with MacForth.  Although I am still learning my way around with
  76. it, I have to say that it makes programming the Mac extremely easy.  The second
  77. example was, a few years back when one of the professors on campus had just 
  78. obtained -- ummm, memory fault; well, FORTH, Inc.'s package -- and he was 
  79. ecstatic about it.  The *only* negative he had to say was something like: Gee, 
  80. I'm sure glad I didn't have to buy this with my own money.  This was exceeded
  81. by far with comments about how easy it was to use and how he could concentrate
  82. on his project rather than fighting the language implementation.
  83.     Well, this has been hashed over on comp.lang.forth before, and I don't
  84. really want to restart that thread.  I just want to emphasize that you will
  85. probably have to come up with money for a commercial product if you want to do
  86. anything significant -- unless part of the attraction is to develop all your
  87. own tools and debug Forth also.
  88.  
  89. Just my own thoughts.
  90.  
  91. Regards,
  92. tony
  93.