home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / compiler / 1382 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  2.1 KB

  1. Xref: sparky comp.compilers:1382 comp.lang.c:12388
  2. Newsgroups: comp.compilers,comp.lang.c
  3. Path: sparky!uunet!decwrl!world!iecc!compilers-sender
  4. From: maniattb@cs.rpi.edu (Bill Maniatty)
  5. Subject: Two-pass C compilers
  6. Reply-To: maniattb@cs.rpi.edu (Bill Maniatty)
  7. Organization: Compilers Central
  8. Date: Sat, 15 Aug 1992 20:45:24 GMT
  9. Approved: compilers@iecc.cambridge.ma.us
  10. Message-ID: <92-08-081@comp.compilers>
  11. Keywords: C
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Re: Why is compiled basic slower than C? (Basic is the future)
  14. Lines: 32
  15.  
  16. |> C requires more than one pass for compilation, and
  17. |> therefore compiles slower than Basic.
  18.  
  19.     Some of the wise guys (I mean friends) in my office challenged my
  20. assertion that C requires more than one pass to compile.  I'm of the
  21. impression that C compilers use more than one pass.  Since they challenged
  22. me, I get to make up the rules of this contest which are:
  23.     1). Ansi 'C' is the grammar.
  24.     2). If we skip optimization, is there any construct in C that would
  25.     require multiple passes, and if not how do we avoid many passes?
  26.     3). How about if we perform optimization (specify the optimizations
  27.         please), can it be done in 1 pass?
  28.     4). Are there any one pass C compilers out there. (That is C done with
  29.         2+ pass compilers for purely historical reasons?)
  30.  
  31. If I was wrong, I apologize for misleading anyone, but if I'm correct then
  32. in their face! :-)
  33.  
  34. Bill
  35. -- 
  36. maniattb@cs.rpi.edu - in real life Bill Maniatty
  37. [Depends on what you mean by pass.  Most C compilers I know turn C into
  38. assembler and only read the source once.  Whether you think of the
  39. assembler as a second pass is a matter of semantics.  Some compilers, e.g.
  40. Turbo C, go directly from C to object code, again only reading the source
  41. once.  In this regard I can't see any way that C differs from Basic or
  42. Fortran, both of which are about equally easy or hard to process in one
  43. pass.  PL/I is a little harder to do in one pass since you're allowed to
  44. declare variables after you use them.  -John]
  45. -- 
  46. Send compilers articles to compilers@iecc.cambridge.ma.us or
  47. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  48.