home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / compiler / 2256 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.2 KB  |  47 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!world!iecc!compilers-sender
  3. From: kieron@root.co.uk (Kieron Drake)
  4. Subject: Re: [TDR] Token-Based Compilers
  5. Reply-To: kieron@root.co.uk (Kieron Drake)
  6. Organization: UniSoft Ltd., London, England
  7. Date: Mon, 25 Jan 1993 18:22:55 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <93-01-182@comp.compilers>
  10. References: <93-01-143@comp.compilers>
  11. Keywords: C, interpreter
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Lines: 32
  14.  
  15. tdarcos@mcimail.com (Paul Robinson) writes:
  16. >I'd like to ask what people think of the idea of Compilers that generate
  17. >ficticious machine code, i.e. tokens for an optimized machine which is
  18. >then interpreted on the target.
  19.  
  20. One of the classic early uses of this technique was by Martin Richards
  21. when he used OCODE as the intermediate code for BCPL compilers. The first
  22. issue (I think it's the first issue) of Software Practice & Experience has
  23. a discussion of the portability issues. (actually it's a bit more complex
  24. than that: he used two levels of intermediate code; intcode & OCODE with
  25. intcode being amazingly simple to interpret so you could get the intcode
  26. version of the compiler up a.s.a.p. and then take time to get your
  27. OCODE-driven back end working). Another reference is "BCPL: The Language
  28. and its Compiler", Richards & Whitby-Strevens.
  29.  
  30. OCODE is for a fairly simple stack based virtual machine. One can get
  31. pretty good code generated for modern architectures, which have lots of
  32. registers, by simulating register contents as long as possible and using
  33. graph-colouring techniques for register allocation.  That gives a fairly
  34. simple back-end which is reasonably configurable across machines of
  35. similar architecture, produces reasonable code quickly and can be
  36. implemented fairly fast. All my opinion/experience, of course.
  37.  
  38.     kieron
  39. --
  40. kieron@root.co.uk    Tel: +44 71 729 3773 (or 071 729 3773 in the UK)
  41. Kieron Drake        Fax: +44 71 729 3273 (or 071 729 3273 in the UK)
  42. Senior Consultant, UniSoft Ltd., Spa house, Chapel Place, Rivington Street,
  43. London EC2A 3DQ, UK
  44. -- 
  45. Send compilers articles to compilers@iecc.cambridge.ma.us or
  46. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  47.