home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19784 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  18.7 KB

  1. Path: sparky!uunet!fedfil!news
  2. From: news@fedfil.UUCP (news)
  3. Newsgroups: comp.lang.c++
  4. Subject: Need help justifying C++ over ADA?
  5. Message-ID: <242@fedfil.UUCP>
  6. Date: 22 Jan 93 21:57:20 GMT
  7. Organization: HTE
  8. Lines: 476
  9.  
  10.  
  11. The following first appeared around May of 1990 and may be of some assistance;
  12. I post it on the Ada group on occasion just for effect.
  13.  
  14. ..............
  15.  
  16. I and a number of my associates, as well as a number of the most
  17. prominent computer scientists of our age, most notably Charles Anthony
  18. Richard Hoare, the inventor of the quick-sort process (Turing Award
  19. Lecture, 1980), believe the Ada programming language to be not only a
  20. major source of frustration and unnecessary cost to everybody involved
  21. with it, but an actual threat to the security of the United States and
  22. of any other nation which might become involved with it.
  23.  
  24. The following is from usenet:
  25.  
  26.  
  27.  From: Nigel Tzeng, NASA
  28.  
  29.  
  30. >Oh yes...on the other front...executable size...we are sometimes space limited
  31. >on the size of the programs we can have in the on-board systems...how do the
  32. >C vs ADA sizes compare?
  33.  
  34. >This information is important to know...otherwise we cannot make an intelligent
  35. >decision on which language to use in the future.  NASA is trying to figure out
  36. >if they should adopt ADA as the single official language.  Developers at NASA
  37. >need to know the hard data in order to decide whether to support such a stand.
  38.  
  39. Good thinking.  With enough work and most Ada features turned off, Ada speeds
  40. for some tasks should approach those of C.  This has little or nothing to do
  41. with the BIG problems of Ada, which are philosophical/economic in nature
  42. and not easily amenable to technical solution.  Executable size is a
  43. symptom of one such problem.
  44.  
  45.  
  46. From: Jim Harkins, Scientific Atlanta, San Diego, CA
  47.  
  48. >(Bill Wolfe) writes:
  49. >>   There is a great need for a single production programming language
  50. >>   which supports good software and code engineering practices.
  51.  
  52. >Yep, and there is great need for a single type of automobile.  Any idiot can
  53. >see that not only is it extremely dangerous for a person to go from driving
  54. >a Hyndai Excel to a Ford Aerostar, as a nation we are wasting an awful lot
  55. >of time both in learning new skills and in designing automobiles that differ
  56. >in several respects.  I think a good compromise would be the Ford Escort...
  57.  
  58. This is a REAL good analogy, but I'm afraid Jim doesn't carry it far
  59. enough, simply because he can't conceive of it actually happening.
  60. Problem is, the Ada crew CAN.  You have to put yourself in their
  61. shoes;  they want to control the two extremes of programming, embedded
  62. systems and mainframe/database work, and everything in between and,
  63. hence, they need every feature in the world in their CORE LANGUAGE.
  64. Letting people make up their own libraries for applications (as per C/UNIX)
  65. would be too much like a free system.  Logical consequence:
  66.  
  67.  
  68.   "My only problem with Ada at this point is the cost ($ and hardware
  69.   resources) of a compiler for my XT clone.  Both IntegrAda and Janus require
  70.   more memory than DOS 4.01 leaves available.  This is BAD DESIGN.  There
  71.   is no excuse for a 551K executable in a PC (pass 2 of Integrada).  Janus
  72.   Ada requires > 580K available to run, and rumor has it that the Integrada
  73.   compiler is a repackaged Janus compiler."
  74.              
  75. From a recent comp.lang.ada posting.
  76.  
  77.  
  78. Everybody begins to realize: "Hey!, looks like Ada's the only
  79. thing I'm ever gonna have, so I'd better see to it that everything I
  80. ever plan on doing is part of Ada...", and we get Ada-9x, the language
  81. which will include all the great features that Ada left out.  Kind of like
  82. quick-sand or one of those old Chinese finger traps... the more you
  83. struggle, the worse it gets.
  84.  
  85. The good news is that, given the speed at which these things happen,
  86. Ada-9x is probably 10 years away.  The bad news is two-fold:  first,
  87. Ada-9x will probably break all existing Ada code and, second, the clunk
  88. factor will likely be so great (1,000,000+ bytes for "HELLO WORLD" might
  89. actually be achieveable), that no more working Ada code will ever be written
  90. afterwards.  Total paralysis.
  91.  
  92. Several times recently, Ada affectionados have posted articles
  93. concerning the national information clearinghouse for Ada-9x, including
  94. the phone-modem number (301) 459-8939 for Ada-9x concerns.  This BBS
  95. contains 744 recent user comments on Ada in it's present state; true life
  96. experiences of actual Ada sufferers.  These are grouped in bunches of 50
  97. in self-extracting zip files (e.g. 101-150.exe) and may be downloaded.
  98. For instance:
  99.  
  100.  
  101. complaint #0300
  102.  
  103.  
  104.    PROBLEM:
  105.  
  106.    Currently, to create and mature an Ada compiler, it takes from
  107.    3..5 years.  For the new architectures of the future and rapid
  108.    compiler development, the language needs to be expressed in terms
  109.    that are easy to parse and to generate code.
  110.  
  111.    The definition should be revamped so that the grammar in Ada to
  112.    conform to LR(m,n) for consistent/complete parsing rules -- the
  113.    most efficient and accurate compiler techniques.  Move more
  114.    semantics to the grammar specification to rid the language
  115.    definition of so many special cases.
  116.  
  117. The solution proposed, unless I'm missing something, would break nearly
  118. all existing Ada code, hence it isn't likely to happen.  Doesn't say
  119. much for the basic design of Ada either, does it?
  120.  
  121. Add the time to finish the 9x standard and the 2 - 3 year time between
  122. first-compiler <--> compiler-which-anybody-can-stand-to-use, and you get
  123. my ten year figure for 9x.  Sort of;  there may never actually be a 9x
  124. compiler which anybody can stand to use.
  125.  
  126. Here's the rub:  a casual reading of the 744 little "problems" would
  127. lead one to believe that 1 out of every ten or so was a show-stopper, and
  128. that nine of ten are just people whining for new features.  This would
  129. be a misinterpretation.  In fact, it's probably all of those new
  130. features which are the big serious problem, given past history.  The ten
  131. year problem, however, says that anybody figuring to use Ada starting
  132. now had best get used to the more minor problems (the 1 out of 10).
  133. These include:
  134.  
  135.  
  136. complaint #0237
  137.  
  138.     We cannot adequately configure large systems as the language now
  139.     stands.  There are no standard means of performing the kind of
  140.     operations on library units generally considered desirable.  These
  141.     include:
  142.     -     creating a new variant or version of a compilation unit;
  143.     -     mixed language working, particularly the use of Ada units by
  144.           other languages;
  145.     -     access control, visibility of units to other programmers;
  146.     -     change control and the general history of the system.
  147.     The inability to do these things arises out of a few loosely worded
  148.     paragraphs in the LRM (in 10.1 and 10.4), which imply the existence
  149.     of a single Ada program library, whose state is updated solely by
  150.     the compiler.  This can be an inconvenient foundation on which to
  151.     build.  The relationships between compilations in a project will be
  152.     determined by the problem and the organization of work, and any
  153.     automatic enforcement of a configuration control regime must come
  154.     from a locally chosen PSE.  Ada especially, as a language with large
  155.     and diverse application, must have a separate compilation system
  156.     which gives the greatest freedom possible in this area.
  157.  
  158.  
  159.     IMPORTANCE:
  160.  
  161.     ESSENTIAL
  162.  
  163.     Ada was intended for use in large projects, involving many people,
  164.     possibly at different centers.  These are precisely the projects
  165.     which will collapse if the programming support technology is
  166.     inadequate.
  167.  
  168.  
  169.  
  170. That is, Ada can't realistically be used for large systems.
  171.  
  172.  
  173. complaint #0150
  174.  
  175.     Due to the availability of virtual memory, most minicomputer
  176.     and mainframe programmers rarely consider the size of main memory
  177.     as a limiting factor when creating their programs.  In contrast,
  178.     th size of main memory is a major concern of microcomputer
  179.     programmers.  The most widely used microcomputer operating
  180.     systems, MS-DOS, does not have virtual memory capabilities.
  181.     Without the availability of special programming techniques to get
  182.     around this limitation, microcomputer programmers would have to
  183.     severely limit the functionality of their programs, and, it would
  184.     be impossible to create large, integrated information systems for
  185.     microcomputers.  One of most widely used of these programming
  186.     techniques is the "chaining" capability provided in many
  187.     programming languages.  "Chaining" gives a programmer the ability
  188.     to break down large integrated information systems into separate
  189.     executable programs, and, then, when the system is operated, swap
  190.     these programs in and out of main memory as the need arises.
  191.     "Chaining", in effect, simulates virtual memory.  Ada does not
  192.     have the capability to chain programs.  As a result,
  193.     microcomputer programmers who use Ada must severely limit the
  194.     functionality of their programs.
  195.  
  196.     Importance (1-10)
  197.  
  198.     1 - Microcomputer programmers who use Ada will have to
  199.     continue limiting the functionality of their programs.
  200.     Current Workarounds
  201.  
  202.     Programmers must either limit the functionality of their Ada
  203.     programs or use a proprietary CHAIN command supplied by the
  204.     compiler manufacturer - which hurts portability.
  205.  
  206.  
  207. I.e., Ada can't be used for small systems... klunk factor's too high.
  208.  
  209.  
  210. Consider the one feature which might come remotely close to justifying
  211. this giant klunk factor:  object-oriented capabilities.
  212.  
  213. complaint #0599
  214.  
  215.  
  216.     PROBLEM:
  217.  
  218.     Inheritance has become one of the standard attributes of
  219.     modern object-oriented programming languages (such as C++
  220.     and Smalltalk-80).  Unfortunately, Ada is quite deficient in
  221.     its support for inheritance ( it is based primarily on
  222.     derived types, and then not particularly well),  and this is
  223.     a valid criticism leveled at the language by critics (and C
  224.     bigots who, if forced to learn a new language, simply prefer
  225.     to learn C++).  There are currently many proposals to add
  226.     full-blown inheritance (and other standard object-oriented
  227.     attributes, such as polymorphism) to Ada; the scope of this
  228.     revision request is much more modest, intended only to make
  229.     the derived type mechanisms that already exist work better.
  230.  
  231.     IMPORTANCE: ESSENTIAL
  232.  
  233.     If the lack of modern object-oriented attributes is not
  234.     addressed in Ada 9X, Ada will almost certainly become the
  235.     FORTRAN of the '90's.
  236.  
  237.     CURRENT WORKAROUNDS:
  238.  
  239.     Be thankful for what limited object-oriented support is
  240.     offered by the current language.
  241.  
  242.  
  243.  
  244.  
  245. Consider Ada's original primary mandate:  embedded systems:
  246.  
  247.  
  248. complaint #0021
  249.  
  250.  
  251.       PROBLEM:
  252.  
  253.     A high priority task may be suspended because it needs to rendezvous with
  254.     a low priority task.  That low priority task does not get scheduled
  255.     promptly because of its priority.  However this causes the high priority
  256.     task to be suspended also.
  257.  
  258.     IMPORTANCE:  (7)
  259.  
  260.     This problem makes the use of task priorities extremely difficult to apply
  261.     correctly in a large system.  It limits the ability to use task priorities
  262.     to improve throughput in a system.
  263.  
  264.  
  265. complaint #0072
  266.  
  267.  
  268.  
  269.    PROBLEM:
  270.  
  271.    The Ada priority system has proved quite inadequate for the
  272.    needs of certain classes of hard realtime embedded systems.
  273.    These are applications where a high degree of responsiveness
  274.    is required.
  275.  
  276.    For example, there is a major conflict between the fifo
  277.    mechanism prescribed for the entry queue and the need for the
  278.    highest priority task to proceed wherever possible.
  279.  
  280.  
  281. complaint #0084
  282.    
  283.    problem
  284.  
  285.    Ada tasking involves too much run-time overhead for some high-performance
  286.    applications, including many embedded systems applications for which the
  287.    language was designed. This overhead not only slows down the program in
  288.    general, but may also occur at unpredictable times, thus delaying response at
  289.    critical times. To avoid the overhead, real-time programmers frequently
  290.    circumvent Ada tasking.
  291.  
  292.    The problem is exacerbated by Ada's lack of support for those who do try to use
  293.    tasking in an efficient manner. There is no standard set of guidelines to
  294.    programmers for writing optimizable tasking code, or to language implementors,
  295.    for deciding which optimizations to perform. Also, there is no simple way for a
  296.    programmer who is concerned with writing portable high-performance code to
  297.    check that optimizations applied under one implementation will be applied under
  298.    different implementations.
  299.  
  300.    The consequences of Ada tasking overhead have not gone unnoticed in higher
  301.    circles of government. A recent General Accounting Office report [1] noted that
  302.    Ada has limitations in real-time applications that require fast processing
  303.    speed, compact computer programs, and accurate timing control. All three of
  304.    these requirements are directly and adversely affected by Ada's current
  305.    tasking overhead.
  306.  
  307.  
  308. complaint #0278
  309.  
  310.  
  311.    PROBLEM:
  312.  
  313.    In the last 5 years, tomes have been written on the Ada tasking
  314.    model.  It is too complex and has too much overhead for embedded
  315.    systems to utilize effectively.  It also does not fit well with
  316.    architectures found in embedded systems, e.g., multiprogramming/
  317.    distributed processing.  The control mechanisms are not
  318.    responsive to realtime needs.  Applications programs are
  319.    responsible for housekeeping on context switches where the
  320.    process will not return to the previously selected context.  The
  321.    model does not support the well-known basic scheduling
  322.    disciplines, e.g., preempt or nonpreempt and resume or nonresume,
  323.    see Conway's Theory of Scheduling.  The problems with tasking
  324.    efficiency is not the maturity of the compilers, but in the
  325.    underlying model defined in the language and the validation
  326.    requirements for the compilers.
  327.  
  328.    importance:  very high, one of the major goals for the Ada 9x
  329.  
  330.    current workarounds: Programming standards to avoid tasking or
  331.    only initiate a single task and to not use rendezvous of any kind
  332.    as they are too unpredictable and require too much overhead.
  333.    Allow the ACVC not to test this section so that the application
  334.    does not have to absorb a runtime system from a compiler vendor
  335.    that has little experience with the applications.
  336.  
  337.    Or, write in a language like Modula-2 or object oriented C++ that
  338.    does not interfere in the target architecture.
  339.  
  340.  
  341.  
  342. i.e. Ada can't really be used for embedded systems, its original mandate.
  343. How about something simple like string handling?
  344.  
  345.  
  346. complaint #0163
  347.  
  348. Problem: 
  349.   Strings are inadequate in Ada.  It is very frequently the case that
  350.   the length of a string is not known until it is formed...after it
  351.   has been declared.  This leads to ugly, clumsy constructions (blank
  352.   pad everything, keep track of length separately, play tricks with
  353.   DECLARE's and constant strings, etc.).  The obvious solution of
  354.   writing a variable-length string package (see LRM, section 7.6) is
  355.   unsatisfactory:  you are lead to a limited private type because
  356.   neither the standard equality test nor assignment are appropriate.
  357.   (you want the both to ignore everything beyond the actual length of
  358.   the strings)  For limited private types, however, you have no
  359.   assignment statement at all.  We implemented such a package and
  360.   found that using a procedure (SET) for assignment was error-prone
  361.   and hard-to-read.  This even for experienced programmers and even
  362.   after getting beyond the initial learning curve for the package.
  363.  
  364.  
  365. How about something REAL SIMPLE, like argc/argv?
  366.  
  367. complaint #355
  368.  
  369.  
  370.    PROBLEM:
  371.  
  372.    It is difficult, in a standard manner, to get at the operating
  373.    system command line arguments supplied when the program is invoked.
  374.  
  375.  
  376.    IMPORTANCE:
  377.  
  378.    (Scale of 1 - 10, with 10 being most important):
  379.    <<8>>
  380.  
  381.  
  382.    CURRENT WORKAROUNDS:
  383.  
  384.    Look up in vendor-specific manuals the method of accessing the
  385.    command line parameters and access them differently on different
  386.    operating systems.
  387.  
  388.  
  389. What about writing an OS in Ada (so that real "software engineers" won't have
  390. to screw around with UNIX anymore)?
  391.  
  392. complaint #0186
  393.  
  394.  
  395.     It is difficult, if not impossible, to use Ada to write an operating
  396.     system.  For example, a multiprocessor naval command and control
  397.     system might need basic software, comparable in complexity to a
  398.     minicomputer network operating system, to support fault tolerance,
  399.     load sharing, change of system operating mode etc.  It is highly
  400.     desirable that such important software be written in Ada, and be
  401.     portable, i.e. be quite independent of the compiler supplier's Ada
  402.     run time system.  Currently, it would be very difficult to do this
  403.     in Ada, because of the difficulty of manipulating tasks of arbitrary
  404.     type and parentage.
  405.  
  406.     IMPORTANCE: 7.
  407.  
  408.  
  409.     CURRENT WORKAROUNDS:
  410.  
  411.     Use operating systems written in C or assembler.
  412.  
  413.     Write the operating system as an extension of the Ada run time
  414.     system - this is undesirable because it is non-portable and
  415.     unvalidated.
  416.  
  417.  
  418. What about basic portability?
  419.  
  420.  
  421. complaint #0365
  422.  
  423.  
  424.    Problem:
  425.    Implementation Options Lead to Non-Portability and
  426.    Non-Reusability.
  427.  
  428.    Discussion:     The LRM allows many implementation
  429.    options and this freedom has lead to numerous
  430.    "dialects" of Ada.  As programs are written to rely on
  431.    the characteristics of a given implementation,
  432.    non-portable Ada code results.  Often, the programmer
  433.    is not even aware that the code is non-portable,
  434.    because implementation differences amy even exist for
  435.    the predefined language features.  Further, it is
  436.    sometimes not impossible to compile an Ada program with
  437.    two different implementations of the same vendor's
  438.    compiler.
  439.  
  440.    Another kind of non-portability is that of the programmer's
  441.    skills,  The user interfaces to Ada compilers have become so
  442.    varied that programmers find it very difficult to move from
  443.    one Ada implementation to another,  Not only does the
  444.    command line syntax vary, but so do program library
  445.    structures, library sharability between users, compiler
  446.    capabilities, capacity limits. etc.
  447.  
  448.    Importance:     ESSENTIAL
  449.  
  450.    Current Workarounds:
  451.  
  452.    Significant amounts of code rewriting, recompilation, and
  453.    testing must be done to get a given Ada program to compile
  454.    and to run successfully using another compiler, if at all
  455.    possible, even on the same host-target configuration.  It
  456.    is very difficult to write a truly portable Ada program.
  457.  
  458.    Another possible solution to porting an Ada program is for
  459.    a customer to carefully choose a compiler to suit the given
  460.    Ada program, or perhaps collaborate with a vendor to tailor
  461.    the compiler to suit these needs.
  462.  
  463.    Significant amounts of programmer retraining must occur
  464.    when a different Ada compiler is used.
  465.  
  466.  
  467.  
  468. Somehow, all of this is beginning to remind me of a song I used to hear in
  469. the late 60's/early 70's (roughly paraphrased):
  470.  
  471.  
  472.   "ADA! - KUH! - Yeah!, what is it GOOD for, absolutely NOTHIN!, say
  473.   it again...  ADA! - KUH! - Yeah..."
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482. -- 
  483. Ted Holden
  484. HTE
  485.  
  486.