home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / misc / 1008 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.4 KB

  1. Xref: sparky comp.os.misc:1008 comp.theory:2805 comp.lang.misc:4089 alt.lang.asm:533
  2. Newsgroups: comp.os.misc,comp.theory,comp.lang.misc,alt.lang.asm
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!uotcsi2!news
  4. From: cbbrowne@csi.uottawa.ca (Christopher Browne)
  5. Subject: Re: PROTOLO A FUTURISTIC OBJECT-CODE FORMAT
  6. Message-ID: <1993Jan6.185513.15335@csi.uottawa.ca>
  7. Keywords: languages,objectcode
  8. Sender: news@csi.uottawa.ca
  9. Nntp-Posting-Host: prgf
  10. Organization: Dept. of Computer Science, University of Ottawa
  11. References: <1993Jan6.172707.14435@ifi.uio.no>
  12. Date: Wed, 6 Jan 93 18:55:13 GMT
  13. Lines: 71
  14.  
  15.  
  16. This sounds very much like some languages that already exist:
  17.  
  18. 1) The GNU Project internal language called RTL
  19.  
  20. The compiler front end generates code in RTL.  An internal optimizer
  21. then wrenches it apart, puts it back together again, and translates it
  22. into the assembly language of the target computer.  There's then some
  23. further peephole optimization, and eventually you get executable
  24. object code.
  25.  
  26. There's this theory that they're going to eventually have a whole
  27. family of front ends.  Right now, there are front ends for C, C++ and
  28. Objective C.  There may be an alpha version of a FORTRAN front end.
  29. There has been talk about Pascal, Modula-2, COBOL (!) and Ada front
  30. ends, but this seems to be just talk at this point.
  31.  
  32. RTL seems to be fairly LISP-like.
  33.  
  34. 2) Some European compiler project involving A. Tanembaum
  35.  
  36. In an old SIGPlan, I've got an article on a project that Tanembaum (of
  37. Minix/Amoeba fame) worked on a few years ago.
  38.  
  39. The basic idea was that they generated compiler front ends (very
  40. similar to the GCC idea described above) that would produce as output
  41. a "machine independent" language.  In this case, it was a "stack
  42. oriented" language.  (FORTH and PostScript are examples of stack
  43. oriented languages, but have many more op-codes than Tanembaum's
  44. system.)
  45.  
  46. A second program would then generate code for the actual CPU.
  47.  
  48. Much of the paper talked about how they had to do some pipelining to
  49. it, combining multiple passes into one in order to improve the speed
  50. of compilation.
  51.  
  52. For BOTH of these systems, the advantages to the "internal language"
  53. were:
  54.  
  55. a) It makes it easy to use "multiple front ends," which means that you
  56. can more easily produce compilers for SEVERAL languages, targetted
  57. towards SEVERAL platforms.
  58.  
  59. I.e.:  If you want compilers for three languages that will run on 6
  60. different computers, you only need to write 9 programs.  The
  61. conventional "monolithic" method would require 18 compilers.
  62.  
  63. It gets REALLY worthwhile if you look at having a dozen computers, and
  64. a dozen languages.  It cuts the work by a factor of about 6.
  65.  
  66. b) Optimization can take place at THREE levels:
  67. 1) Language level
  68. 2) Internal pseudo-machine level
  69. 3) Object code level
  70.  
  71. which can be very helpful.  It may be possible to do MORE
  72. optimizations, and at the least, it means that each optimizer is
  73. simpler, and is targetted at ONE of those levels.  You're not doing
  74. variable folding simultaneously with peephole optimization, which cuts
  75. down on bugs.
  76.  
  77. Your idea is fairly well understood; I suggest you check out the way
  78. one of these implementations does things, and try to find ways of
  79. making it BETTER.
  80.  
  81. -- 
  82. Christopher Browne                |     PGP 2.0 key available
  83. cbbrowne@csi.uottawa.ca           |======================================
  84. University of Ottawa              | Genius may have its limitations, but
  85. Master of System Science Program  | stupidity is not thus handicapped.
  86.