home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / misc / old / gnatchat.1 < prev    next >
Encoding:
Text File  |  1996-04-29  |  12.4 KB  |  251 lines

  1. GNAT CHAT #1 23 Apr 1993
  2. ------------------------
  3.  
  4. GNAT CHAT is an abstract of discussion items sent to gnat-world@cs.nyu.edu.
  5. Since this is a rather giant mailing list, rather than let a free for all
  6. interaction occur on it, we will abstract comments we receive, and then mail
  7. them out from time to time. As you see above, they are numbered, so that you
  8. can make sure you haven't missed one. If you don't want to receive GNAT CHAT
  9. notes, but only the main technical reports and progress reports that we send
  10. out, let us know. I am currently adding the headers, whose format is presumably
  11. clear. I won't object if poeple want to add such headers to their messages to
  12. save me a bit of time, but I won't insist on it! (I = Robert Dewar, for the
  13. moment moderator for GNAT-CHAT). Messages to gnat-chat can either be sent to
  14. gnat-chat@cs.nyu.edu, or as noted above, to gnat-world@cs.nyu (the latter
  15. address makes it convenient for those who just like to press the reply key!)
  16.  
  17. ------------------------------------------------------------------------------
  18.  
  19. Reference: GC-1.1
  20. Date: 23 Apr 1993
  21. Author: Richard Stallman
  22. Subject: Syntax checking only mode
  23. References: GNOTE1, April 12
  24.  
  25.  [referring to the point that the checks for one compilation unit per file
  26.  and the matching of compilation unit names and file names are omitted in
  27.  syntax check only mode]
  28.  
  29.  >It is unclean for an option for "syntax checking only" to have also
  30.  >the effect of allowing syntax that is normally forbidden!
  31.  >That should be a separate option.
  32.  
  33.  Robert Dewar replies:
  34.  
  35.    That's reasonable. The multiple compilation units per file is
  36.    a special check that probably should be controlled by a separate
  37.    switch. The naming convention is actually a semantic check for us,
  38.    so it falls out free for it not to be performed in syntax only mode
  39.    and would be extra work to check during the syntax phase (after all the
  40.    division between syntax and semantics is a little arbitrary, and in
  41.    syntax only mode, there are after all a lot of checks that get omitted!)
  42.  
  43. ------------------------------------------------------------------------------
  44.  
  45. Reference: GC-1.2
  46. Date: 23 Apr 1993
  47. Author: Richard Stallman
  48. Subject: Names of files
  49. References: GNOTE1, April 12
  50.  
  51.  [referring to the suggested convention in GNOTE1 for distiguishing spec and
  52.  body names, i.e. to add different suffixes to the names with the default being
  53.  a dash after the end of the spec name]
  54.  
  55.  >It seems more natural to me to use a different extension for spec
  56.  >files, rather than a dash.
  57.  
  58.  >  The corresponding object file has the same file name with the extension .o
  59.  >  (which is why the spec and body of a file have to have different file names,
  60.  >  not just different extensions).
  61.  
  62.  >This is not a necessary consequence. If a spec file is named foo.spc,
  63.  >its .o file does not *have* to be named foo.o. It could be named
  64.  >foo-.o or foo.so.
  65.  
  66.  > ABC.DEF.GHI (child spec)     abc-def.ghi-.ada
  67.  
  68.  >Wouldn't this be abd-def-ghi-.ada according to the current rules?
  69.  
  70.  Robert Dewar replies:
  71.  
  72.    Current typical Ada usage is divided between the two conventions. For
  73.    example, Dec's standard convention is to add a trailing underscore. We
  74.    changed this to a trailing minus, because otherwise the new Ada 9X feature
  75.    allowing trailing underscores causes confusion (flames to dev/null please!)
  76.  
  77.    It is also our intention to allow user specification of arbitrary suffixes,
  78.    allowing for example following the Verdix convention which adds a separate
  79.    suffix to specs and bodies.
  80.  
  81.    However, the convention that Richard mentions is also very common. For
  82.    example, in the Alsys world, a common usage is .ada for a spec, and .adb
  83.    for a body.
  84.  
  85.    Our general philosophy in GNAT should be to satisfy as wide a variety of
  86.    styles as possible, so it indeed seems a good idea to allow this possibility
  87.    and we will implement this. Actually we discussed this earlier, and the
  88.    only reason we didn't do it was because we were a little nervous about
  89.    introducing object files not called .o, or object files whose name didn't
  90.    match the source name.
  91.  
  92.    Clearly some tools might be discombobulated by violating either of these
  93.    two standard conventions for object file names, but if it's only one of
  94.    the possible options, I don't see any objection.
  95.  
  96.    The abc-def.ghi-.ada is a typo, it should indeed be abc-def-ghi-.ada
  97.  
  98. ------------------------------------------------------------------------------
  99.  
  100. Reference: GC-1.3
  101. Date: 23 Apr 1993
  102. Author: Richard Stallman
  103. Subject: "Subversion" of consistency checking rules
  104.  
  105. [in response to the discussion of situations in which the consistency
  106.  checking rules stop you doing things which would actually work. In
  107.  particular adding an entity to a package is often safe]
  108.  
  109.  >This case is so common that I added a feature to GNU Make just for its
  110.  >sake. This is the -o FILE option, which says, "pretend file FILE is
  111.  >very old (i.e., older than everything that depends on it)". I use
  112.  >this frequently when working on GCC.
  113.  
  114.  >The time stamps in Ada .o files will make -o useless. To me, this seems
  115.  >like a shame. I understand some Ada users are determined to have no way
  116.  >to do what -o is intended for; but I think we should provide a way for
  117.  >users who share my attitude.
  118.  
  119.  >Perhaps the binder should also have an -o FILE option to disable
  120.  >checking of the timestamps that refer to FILE. Use of this option could
  121.  >be considered "deliberate subversion of the defenses"; also, to get an
  122.  >executable that certainly had the right compilation order, you need only
  123.  >rerun the binder and not specify -o.
  124.  
  125.  Robert Dewar replies:
  126.  
  127.    First, the -o option in the binder seems perfectly reasonable. Perhaps in
  128.    contrast with some other Ada thinking in the past, we have no objections
  129.    to options that extend or modify Ada behavior, as long as there is a mode
  130.    in which things work "properly" then that's good enough. [if we abbreviate
  131.    this option to "p" then you can think of it as meaning either "proper" or
  132.    "pedantic" depending on your point of view!]
  133.  
  134.    An aside here. There has long been a feeling in the Ada community that it
  135.    is somehow improper to have switches of this kind. This feeling comes
  136.    partly from the "Declaration of Conformance" that vendors have to sign
  137.    to get a validation certificate which says that they have not implemented
  138.    extensions. What the DOC means is that you have to have a "proper" mode in
  139.    which Ada works as specified without extensions, and that the validation
  140.    must run in this mode (remember that the validation status report includes
  141.    the options used to run the validation suite). It does NOT mean that you
  142.    can't have switches, that modify normal behavior, and indeed many vendors
  143.    have implemented such switches as "all-checks-off" which clearly is outside
  144.    normal Ada semantics. The 9X reference manual, as well as the 9X validation
  145.    policy, will try to avoid conveying the incorrect impression that such
  146.    "extensions" are somehow immoral or illegal. The no supersets policy of Ada
  147.    is not meant to outlaw such switches, but rather to ensure the existence of
  148.    a mode in which maximum portability is guaranteed. In this respect Ada is
  149.    in practice not so different from say COBOL with its FIPS flag which has a
  150.    similar intention. The difference is that the FIPS flag in COBOL is part of
  151.    the validation procedure, and is not mentioned in the standard itself.
  152.  
  153.    As an example of another such switch, consider the switch in GNAT which
  154.    specifies the character set to be used for identifiers. The 9X RM requires
  155.    that the standard mode allow only Latin-1 letters in identifiers, however,
  156.    it quite explicitly suggests that other modes might be appropriate,
  157.    depending on local character set usage. The explicit permission here is
  158.    not necessary, since, as described above, even Ada 83 has always had
  159.    general permission for this sort of thing. The statement is however added
  160.    to the 9X reference manual to emphasize that this switch in particular
  161.    is appropriate. In GNAT, we have a switch with the current settings:
  162.  
  163.        1  Latin-1
  164.        2  Latin-2
  165.        3  Latin-3
  166.        4  Latin-4
  167.        5  IBM PC
  168.        6  Allow all possible upper half ASCII characters
  169.        7  Allow no upper half ASCII characters (like Ada-83)
  170.  
  171.    The default is Latin-1, except on PC's where the default is IBM PC. Of
  172.    course if anyone ever tried to validate GNAT (we have no current intention
  173.    of doing so, and it's not part of our project), then of course they would
  174.    have to specify Latin-1 as part of the validation switch choice.
  175.  
  176.    Going back to the original item of discussion, there certainly are cases
  177.    in which it works fine to ignore the consistency checking. Adding an entity
  178.    to a package often, but not always is harmless. Adding an entity to the
  179.    end of a package is always harmless (at least we haven't run into any
  180.    violations of this so far). The -o option of the binder is a reasonable
  181.    way of just doing away with a check on an "I-assume-all-risks" basis.
  182.  
  183.    As Richard points out there are however, probably many Ada programmers
  184.    who would feel uncomfortable using such an option. After all one of the
  185.    major attractions of Ada over other languages is precisely that it ensures
  186.    safety in such situations. Consequently, while we have no objections to
  187.    the -o switch (in fact I'm writing the binder right now, and I already
  188.    put this switch in earlier this morning!) we are also exploring other
  189.    less drastic options in this area.
  190.  
  191.    A relatively simple approach is to implement a tool that does the
  192.    following:
  193.  
  194.      Input:
  195.     Old version of some spec
  196.     New version of some spec
  197.     ADL information from compilation of new spec
  198.  
  199.      Output:
  200.     Possibly modified version of ADL information for spec
  201.  
  202.    The idea is to compare the two source files and determine if the changes
  203.    to the new spec are harmless. A very obvious case is a change in comments
  204.    (it's *so* annoying to have to recompile the world because you fix a typo
  205.    in a comment in an important spec!) A more ambitious case is adding an
  206.    entity at the end of a package. One can go further. Examples of possible
  207.    harmless changes are:
  208.  
  209.     o  Adding a default expression for a subprogram parameter where none
  210.         was present before
  211.  
  212.     o  Adding an entity in the middle of a package which is not referenced
  213.         later on in the same package
  214.  
  215.     o  Adding a with clause to a package that was not present before
  216.  
  217.     o  Adding a pragma Inline to an existing subprogram
  218.  
  219.     o  Reformatting which does not change the actual program
  220.  
  221.     o  Uniform name change for a local variable
  222.  
  223.         (and, to paraphrase Tom Lehrer, "these are the only ones of which the
  224.          news has come to GNAT, there may be many others but we don't know
  225.          where they're at")
  226.  
  227.    If the new source is found to be compatible with the old source, then the
  228.    modified ADL file contains the time stamps of BOTH the new and old source
  229.    files, with the implication that anyone compiled with either of these
  230.    versions is consistent with the new object module. This will take a very
  231.    minor change in GNAT itself to accomodate the multiple time stamps.
  232.  
  233.    Obviously implementing a comprehensive tool of this type is a huge
  234.    undertaking, but a simple tool that just took care of some of the most
  235.    common cases would be very useful and would take care of many of the common
  236.    cases of the existing "-o" usage without sacrificing safety. Can this
  237.    behavior be reconciled with the 83 or 9X RM chapter 10? We are not quite
  238.    sure and it really doesn't matter that much, since of course it's only an
  239.    option!
  240.  
  241.    Going on to more ambitious thinking, Cyrille Comar, a new member of the
  242.    GNAT group, has been investigating the general issues of specification of
  243.    minimal required interfaces in the GNAT context. The general idea is that
  244.    when you with a spec, you don't use all of it, and you really only need to
  245.    be recompiled if the part of the spec you use is modified. This is the
  246.    kind of approach used by the smart recompilation approaches of Dec and
  247.    Rational (is that a Dec trademark? if so, please consider it labeled as
  248.    such!) Although we don't anticipate actually implementing such an approach
  249.    in the immediate future, we want to be sure that nothing in our approach
  250.    precludes it. We'll be distributing a GNAT note on this subject later on!
  251.