home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19520 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.5 KB

  1. Xref: sparky comp.lang.c:19520 comp.lang.pascal:8025 comp.lang.prolog:2348
  2. Path: sparky!uunet!munnari.oz.au!goanna!ok
  3. From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
  4. Newsgroups: comp.lang.c,comp.lang.pascal,comp.lang.prolog
  5. Subject: Re: Assessing a language
  6. Message-ID: <16332@goanna.cs.rmit.oz.au>
  7. Date: 11 Jan 93 06:28:24 GMT
  8. References: <nharvey.726285484@probitas>
  9. Followup-To: comp.lang.prolog
  10. Organization: Comp Sci, RMIT, Melbourne, Australia
  11. Lines: 35
  12.  
  13. In article <nharvey.726285484@probitas>, nharvey@probitas.cs.utas.edu.au (Nicole Harvey) writes:
  14. > hi,
  15. >    I am involved in assessing a language. Does anyone know of a standard
  16. > set of problems that I could use to judge the languages compabilities?
  17. >    Can anyone think of a problem that represents a real need in a language?
  18. > For example, we have tested it for the eight queens problem to show that 
  19. > it can do state space searches. We have also made sure it can generate the 
  20. > Fibonacci numbers. Can you think of any other well known problems?
  21.  
  22. I note that this is posted to comp.lang. c, pascal, prolog.
  23. Obviously, to be fair to Prolog, you should include something like
  24.     - a parser for a large fragment of a human language; Chat-80 is
  25.       available for research use and you might try to adapt that grammar
  26.     - a nonlinear planner
  27.     - a polynomial manipulation package (got to have SOMETHING C can do...)
  28. and in order to be fair to C, you should include something like 
  29.     - the X window system
  30. and in order to be fair to Pascal, a Pascal compiler.
  31.  
  32. If you expect to get anything meaningful out of a handful of toy problems,
  33. forget it.  The results would be a far worse joke than my first paragraph.
  34. ANY programming language can do state space searches, and how hard it is
  35. depends largely on how much of a library you have, not on the syntax of
  36. the language.  ANY programming language (even BASIC restricted to 26
  37. scalar variables) can compute Fibonacci numbers.  I can solve a set of
  38. linear equations in Prolog in two lines (one line to load the appropriate
  39. library package and one line to call the appropriate routine).  The same is
  40. true in TURBO Pascal, or Fortran, or C.  
  41.  
  42. As for Fibonacci numbers, consider the following lazy functional definition:
  43.     let fib = 1 : 1 : map2 (+) fib (tl fib);
  44. Hard to beat that.  It has been argued that lazy evaluation is extremely
  45. important, yet there are no lazy languages in your list, not even Scheme
  46. with "streams" (see Abelson & Sussman, Structure & Interpretation of
  47. Computer Programs).
  48.