home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / compiler / 2114 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  3.6 KB

  1. Path: sparky!uunet!usc!rpi!uwm.edu!ogicse!das-news.harvard.edu!spdcc!iecc!compilers-sender
  2. From: TDARCOS@MCIMAIL.COM (Paul Robinson)
  3. Newsgroups: comp.compilers
  4. Subject: Compile Time vs. Run Time
  5. Keywords: optimize
  6. Message-ID: <93-01-041@comp.compilers>
  7. Date: 8 Jan 93 02:25:46 GMT
  8. Article-I.D.: comp.93-01-041
  9. Sender: compilers-sender@iecc.cambridge.ma.us
  10. Reply-To: Paul Robinson <TDARCOS@MCIMAIL.COM>
  11. Organization: Compilers Central
  12. Lines: 59
  13. Approved: compilers@iecc.cambridge.ma.us
  14.  
  15. In a comparison of Compile Time vs. Run Time, you have to take a look at
  16. what is _really_ going on as opposed to what you _think_ is going on.
  17.  
  18. There are some compilers out there that they "compile" the code almost as
  19. soon as you hit the return key after selecting "Compile" or "Execute" from
  20. a menu or a command.  Even if the code is 1,000 lines, the code is
  21. compiled at "superhuman" speeds.
  22.  
  23. They cheat.  The code is actually "compiled" as it is typed in, and the
  24. compiler in effect does internal multitasking, in that a line of code is
  25. passed to the compiler for analysis and if it's okay it's compiled either
  26. to tokens or into machine code.  (The editor TECO for the DEC 10 used to
  27. actually _compile_ the teco macros; they ran fast but it took a few
  28. seconds for the macros to be accepted.)
  29.  
  30. If someone punches a program onto cards and submits it to a mainframe (I
  31. know this usually ended about 5 years ago but bear with me a moment), they
  32. aren't going to care about how long the compile takes, whether it takes 10
  33. minutes or 20 is really irelevant.
  34.  
  35. On a terminal, a 100% increase in time could be intolerable unless the
  36. user expects it.  On the other hand, if response is _too_ fast, it can
  37. disrupt one's concentration.  RSTS/E had a basic interpreter that scanned
  38. your program as you entered it.  If there was an error in a line, the
  39. *instant* you pressed return, it *BANG*ed back with a message of a syntax
  40. error.  This forced a lot of people to use TECO or some other editor to
  41. write their programs then read them in under Basic Plus.  This caused the
  42. authors of TECO to put in a "BASIC" switch to indicate you were reading a
  43. Basic program rather than other text and it handled it according to the
  44. rules for the interpreter, mainly to put lines without numbers (which were
  45. continuation lines) to NOT be prefixed by a CR.
  46.  
  47. If I was selling compilers, I'd try and make a "double vision" version;
  48. one that was a dog on the code it created but it compiled *fast* and
  49. another that was slow in compiling but put out excellent code.  Or a
  50. compile time switch to select one or the other.
  51.  
  52. The reason for doing this is that at an educational installation, the
  53. usual practice is called "compile-link-bomb" as opposed to
  54. "compile-link-go" in commercial organizations.  As a large majority of the
  55. compiles are done for syntax checks and bug eradication, this is what
  56. should be done fast and the code doesn't have to be all that hot since the
  57. user isn't going to use it in 90% of the runs.
  58.  
  59. This option is even *more* critical in compilers which are used at a PC
  60. and Terminal.  I personally wish Borland would bring back something akin
  61. to their old version 3 of Turbo Pascal.  The compilation speed was
  62. tremendous even on a 4MHZ PC.  And the generated code was surprisingly
  63. good, people who analyzed disassembled code from the program said that it
  64. would be difficult to write the code it generated much better.  I'd like
  65. to see compilers that are much faster in detecting errors and scanning
  66. source, then give you the option to go on and compile for better code
  67. generation.
  68. ---
  69. Paul Robinson
  70. TDARCOS@MCIMAIL.COM
  71. -- 
  72. Send compilers articles to compilers@iecc.cambridge.ma.us or
  73. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  74.