Re: C++ vs C compiler on size

fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
12 Jan 1997 10:47:07 -0500

          From comp.compilers

Related articles
C++ vs C compiler on size yeh@netcom.com (1997-01-07)
Re: C++ vs C compiler on size robison@kai.com (Arch Robison) (1997-01-09)
Re: C++ vs C compiler on size fjh@mundook.cs.mu.OZ.AU (1997-01-12)
Re: C++ vs C compiler on size bill@amber.ssd.csd.harris.com (1997-01-12)
Re: C++ vs C compiler on size jlilley@empathy.com (1997-01-12)
Re: C++ vs C compiler on size schow@nortel.ca (Stanley Chow) (1997-01-14)
Re: C++ vs C compiler on size jwdonah@ibm.net (Joseph Donahue) (1997-01-14)
Re: C++ vs C compiler on size aeb@saltfarm.bt.co.uk (1997-01-16)
Re: C++ vs C compiler on size edi-c@algonet.se (Kurt Svensson) (1997-01-16)
| List of all articles for this month |

From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.compilers
Date: 12 Jan 1997 10:47:07 -0500
Organization: Comp Sci, University of Melbourne
References: 97-01-048 97-01-058
Keywords: C, C++, performance

Arch Robison <robison@kai.com> writes:


>[1] Separate discussion issue: Is it theoretically possible for a C++
>compiler to always generate machine code linear in the size of the
>source?


Yes, in fact this is possible for almost all languages -- a "linear"
compiler can just generate an executable that includes both a
conventional (or bytecode) compiler and the original source code; this
executable will invoke the conventional (or bytecode) compiler at
runtime, to generate code on-the-fly, and will then execute (or interpret)
that code. Since the size of the conventional (or bytecode) compiler
is constant, the size of the executable generated by the linear
compiler is linear in the size of the source code.


Now, that this is perhaps not quite in the spirit of "generating
machine code", but I think you will have difficulty in phrasing your
question in a way that avoids answers like this.


--
Fergus Henderson <fjh@cs.mu.oz.au>
WWW: <http://www.cs.mu.oz.au/~fjh>
PGP: finger fjh@128.250.37.3
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.