home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / forth / 3143 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  7.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!mtxinu!sybase!hamish
  2. From: hamish@sybase.com (Just Another Deckchair on the Titanic)
  3. Newsgroups: comp.lang.forth
  4. Subject: Re: Sampler Forth
  5. Message-ID: <23375@sybase.sybase.com>
  6. Date: 13 Sep 92 23:13:42 GMT
  7. References: <1992Sep9.174552.22223@tree.UUCP> <1992Sep10.142241.11172@exu.ericsson.se>
  8. Sender: news@Sybase.COM
  9. Organization: Sybase Inc, Emeryville CA USA
  10. Lines: 163
  11.  
  12. In article <1992Sep10.142241.11172@exu.ericsson.se> exuhag@exu.ericsson.se writes:
  13. >Excellent post, Alan, which hit the nail right on the head.
  14. >
  15. >I agree that most Forth implementations are severely misguided.
  16. >(I am not talking about Forths for embedded use here, but Forth
  17. >as a general purpose programming language.)  I'm of the "Forth
  18. >should be small and understandable" school, but this doesn't
  19. >mean that a Forth system has to be as rickety as the Apple II
  20. >ML monitor.
  21.  
  22.     [Rest of James's points deleted]
  23.  
  24. I'm a long-time lurker in this group, and I've watched the postings
  25. about Forth and its status in the world of general purpose programming
  26. go by for a long while without commenting. I used to use Forth way back
  27. in the good old days (a decade or more ago, I can't remember...), and
  28. I've got to admit I'm bemused by the thought that it could ever be
  29. pushed as a "general purpose" language. It's great for specific
  30. applications in a limited mileu (we used it as a meta-machine
  31. language), but in general? I can't see it, I'm afraid, for a variety
  32. of language and implementation reasons.
  33.  
  34. Let's look at this from my point of view (as a software designer and
  35. implementer working as part of a large team), and from the top down
  36. (i.e. from the team leader or company level rather than the individual
  37. programmer's). I help develop kernel-level software for a large group;
  38. the sort of things programmed actually amount to virtual database
  39. machines, with lots of tasking, I/O,  a bit of math, etc. A nice place
  40. for Forth, you might think?  No.
  41.  
  42. We use C, or C++ and would never seriously contemplate Forth. What do
  43. we look for in a programming language?  Not usually "speed" (in the
  44. first instance anyway), not usually things like the behaviour of
  45. language-specific editors, not whether a specific implementation does
  46. or does not offer a particular extension; we're more concerned with
  47. more abstract things like:
  48.  
  49. * Is the language (relatively) well standardized?
  50.  
  51.     This is a good indicator of portability and overall language
  52.     implementation reliability - something *really* important to
  53.     us in general. We would not consider a language that has a lot
  54.     of widely-differing implementations of the core language.
  55.  
  56.     Note that "standardized" doesn't necesarily mean by (say) ISO
  57.     or Ansi - it really just means that the variations between
  58.     different implementations are small (in context) and
  59.     well-understood and documented.
  60.  
  61. * Is it widely available and supported on all the likely target systems?
  62.  
  63.     A language that is not available on all our target platforms
  64.     will simply not be considered; similarly, unless full
  65.     commercial-level support is part of the package, we're highly
  66.     unlikely to use it. "Support" here means being able to phone
  67.     the vendor with specific questions and requests and to know
  68.     that the answers will be both reasonable and useful, and that
  69.     if we are in trouble due to the vendor's implementation, we can
  70.     expect timely help. This is simply crucial for most software
  71.     products in the real world - compiler experts cost money we'd
  72.     rather spend somewhere else - compilers are our *tools*, not
  73.     our products.
  74.     
  75.     (We're talking systems ranging from VMS throught the various
  76.     Unices through Windows/NT through Mach etc, in UP and MP
  77.     versions, on a variety of hardware types, etc. here).
  78.  
  79. * Is it widely known and understood?
  80.  
  81.     This makes our job a lot easier - we don't need to explain C
  82.     (or, increasingly, C++) to new hires. C is (relatively)
  83.     standardized - we do not need to explain particular
  84.     implementations to newcomers; they can start on day 1.
  85.  
  86. * Is it "open" in the sense that it can use or be used by
  87.   other language modules and/or libraries, etc, on all target
  88.   systems?
  89.  
  90.     This is simply crucial. For most applications we would never
  91.     seriously consider a language that did not allow us to (say)
  92.     call the already existing extensive C libraries in a simple,
  93.     straightforward, hopefully portable manner. Similarly, any
  94.     language must be able to produce these libraries - software
  95.     must be reusable on the target systems, in the format and
  96.     manner supported by those systems.
  97.  
  98.     This also implies that the languages have enough *standard*
  99.     concepts in common that this is easy - any language had better
  100.     standardly understand C-like structures on the host system, for
  101.     example.
  102.  
  103.     This isn't really one of Forth's strong points....
  104.  
  105. * Can it allow us to simply use all the host system facilities
  106.   (esp. system calls)?
  107.  
  108.     Any language that didn't allow us to use all available host
  109.     system calls, *and that did not have documentation for using
  110.     these facilities from within that language as a standard part
  111.     of the language*, would not be seriously considered.
  112.  
  113.     The system, including all file, signal, socket (etc), window,
  114.     process, task, internationalization, etc, facilities is there
  115.     to be used, not reinvented. The proposed language must
  116.     understand the host system conceptual blocks (structures, for
  117.     example), in a standardized manner, and have a well-defined,
  118.     supported, fully-implemented and easily-used interface to these
  119.     facilities - and preferably one that doesn't change from system
  120.     to system.
  121.  
  122.     This does not, of course, apply just to system calls - *any*
  123.     system facility (math, windowing, error-logging, etc) must be
  124.     visible and easily usable (implying well-documented), at least
  125.     as easy to use as a C library call.
  126.  
  127.     Again, this isn't really one of Forth's strong points....
  128.  
  129. * Is the language reasonably "safe"?
  130.  
  131.     This is pretty important (though this isn't exactly C's
  132.     greatest strength...) - if the language itself isn't
  133.     particularly safe (e.g. allows aliasing, random pointer
  134.     arithmetic, etc) then does the support environment give us
  135.     tools to analyse and/or enforce code safety? Can we enforce
  136.     (say) bounds checking, or floating point arithmetic error
  137.     checking?
  138.  
  139.     Bugs from unsafe code are catastrophically more important (and
  140.     more common...) commercially than performance problems caused
  141.     by a slightly slower language implementation.
  142.  
  143. * Does it support our design methodologies and programming models?
  144.  
  145.     This is pretty important - it's the design that matters, and if
  146.     someone's just produced a nice object-oriented server kernel
  147.     design, it's a lot easier to implement it in an appropriately
  148.     (and standardized...) OO language than it would be in a
  149.     language whose paradigm is not at all OO or has had OO tacked
  150.     on to the top of it (shame about C++, really...).
  151.  
  152. * Can it be used to produce standalone applications?
  153.  
  154.     This is pretty obvious - can I make a host system application
  155.     that can be called from (say) a Unix shell without a
  156.     specialized environment? Without any specialized calling
  157.     procedure? Etc....
  158.  
  159. * What environments (debuggers, profilers, etc) are available for it?
  160.  
  161. * ...etc.
  162.  
  163. Remember, most general programming is done in teams, and most software
  164. projects are more concerned about specification, design, testability,
  165. etc, than the actual programming language and programming itself.
  166.  
  167. C is hardly brilliant at this, but it says volumes that a Forth hacker
  168. like myself, working in a software domain that seems ideally suited to
  169. Forth programming, would never seriously consider Forth for the task.
  170.  
  171.     Hamish
  172. ---------------------------------------------------------------------------
  173. Hamish Reid       Sybase Inc, 6475 Christie Ave, Emeryville CA 94608 USA
  174. +1 510 596-3917   hamish@netcom.com  hamish@sybase.com  uunet!sybase!hamish
  175.