home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / eiffel / 1080 next >
Encoding:
Text File  |  1992-08-23  |  3.4 KB  |  84 lines

  1. Newsgroups: comp.lang.eiffel
  2. From: tcn@holon.demon.co.uk (Trevor Nash)
  3. Path: sparky!uunet!pipex!demon!holon!tcn
  4. Subject: system-level validity 
  5. Distribution: world
  6. References: <mod.714411318@cs.man.ac.uk>
  7. Organization: .
  8. Lines: 71
  9. Date: Sun, 23 Aug 1992 16:00:01 +0000
  10. Message-ID: <714585601snx@holon.demon.co.uk>
  11. Sender: usenet@gate.demon.co.uk
  12.  
  13.  
  14. In article <mod.714411318@cs.man.ac.uk> mod@cs.man.ac.uk writes:
  15.  
  16. >    "Does ISE Eiffel 3.0 perform system-level validity checking?"
  17.  
  18. Fair question, but poorly phrased: having read the definition of system
  19. validity in Eiffel The Language, a yes or no to this is inadequate: see
  20. later.  And why pick on ISE - I'd like to hear what Sig have to say.
  21. In particular it is important to know what the compiler does with programs
  22. which are system invalid: its not clear that refusing to compile them is
  23. a good idea.
  24.  
  25. > I only ask because I strongly believe that 3.0 vendors should be up
  26. > front about this very important issue; after all, is a compiler that
  27. > only performs 99% of the possible static checking any long term use,
  28. > especially when Eiffel is trumpeted as robust?
  29.  
  30. Come on Mike, this is a bit OTT isnt it?  Eiffel claims to be more robust
  31. than most other languages, not that it is impossible to write an incorrect
  32. Eiffel program.  I wonder how many real errors you expect to find with the
  33. system-level checks that are not trapped by the class-level checks?  And
  34. do you realise that a system-invalid program is not necessarily incorrect?
  35.  
  36. You seem to view the question of system validity as if it was simply a 
  37. further type-check that the compiler writer has chosen not to implement.  
  38. Its actually much more complicated than this:
  39. I would like to quote the example from ETL to clarify this and bring out a
  40. couple of other points for discussion.
  41.  
  42. (this is abridged from p359 of ETL)
  43.  
  44.     a:X    -- exports feature 'proc'
  45.     b:Y    -- Y is an hier of X, and hides (does not export) 'proc',
  46.         -- which thus allows 'proc' to violate the class invariant
  47.     !!b
  48.     if false then a:=b end
  49.     a.proc
  50.  
  51. Cleary if when a.proc is executed, a is ever dynamically of type Y you get
  52. into trouble through a broken class invariant.  But I can prove this 
  53. never happens.  A compiler writer can either:
  54.  
  55. 1) Not bother to check system validity, and silently generate correct code.
  56. 2) Flag it as system invalid, but generate correct code anyway.
  57. 3) Flag it as system invalid and refuse to generate code.
  58. 4) Implement a cleverer system validity check than that defined by ETL, and
  59.    silently generate correct code (i.e. it does the flow analysis)
  60.  
  61. Which of these solutions conform to the standard defined by ETL, and thus
  62. earn the name Eiffel?  I would say all with the possible exception of 3 since
  63. this seems to go against the reasoning in ETL for leaving the 'type holes' in
  64. the language in the first place, i.e. it rules out a significant number of 
  65. useful programs.
  66.  
  67. A couple of options which I think should be ruled out:
  68. 5) Flag it as system invalid, and generate bad code -- i.e. the code 
  69.    generated for a.proc gets it wrong even when a is dynamically of type X
  70. 6) Silently generate bad code.
  71.  
  72. How useful is 2?  In ETL Meyer puts forward the view that in practice very
  73. few programs are class valid but system invalid (p364).  I would add the
  74. further conjecture that of these most are also correct.  
  75.  
  76.  
  77. > ps. I know the people at ISE are doing a very difficult job, no
  78. > criticism is intended.
  79.  
  80. Seconded.  I only hope they read this far :-)
  81.  
  82. Trevor Nash
  83. tcn@holon.demon.co.uk
  84.