Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!timbuk!shamash!hare!ddh From: ddh@hare.cdc.com (Dan Horsfall) Newsgroups: comp.lang.c Subject: Re: Expressions in initializers Message-ID: <31134@shamash.cdc.com> Date: 7 Mar 91 18:21:21 GMT References: <17270@crdgw1.crd.ge.com> <760@ajpo.sei.cmu.edu> <1991Mar4.144939.8311@ux1.cso.uiuc.edu> <1032@caslon.cs.arizona.edu> <3599.27d3ca8a@iccgcc.decnet.ab.com> <1043@caslon.cs.arizona.edu> Sender: usenet@shamash.cdc.com Reply-To: ddh@dash.udev.cdc.com (Dan Horsfall) Organization: Control Data Corp, Arden Hills, MN Lines: 31 In article <1043@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes: > > ... the logical conclusion of "constant" evaluation at compile-time > will make C compiler into a C interpreter as well. I have been reminded in > the past that C is supposed to be a small language (when wishing for a > largest-of operator on enums). Think how much more work the compiler must > do to evaluate constant-parameter functions at compile time, even if you > limited this to standard library functions. > > Dave Schaumann dave@cs.arizona.edu OK, heres my $0.02. How many of you out there really want "constant expressions" evaluated over and over again at run-time?? How many times will your code be run, vs. how many times will be it be compiled? I know I'll attract flames galore with this attitude, but I expect, even assume decent compilers to eliminate this stuff without being told (i.e., without the higher optimization levels). In this shop, the goal is NOT performance for the developer -- it's meeting the needs of the fur-bearing, revenue-producing, end user -- the Customer! I admit, of course, that not every one needs to write code as if his livlihood depended on it. -- Horse + Control Data Corporation Dan Horsfall +1-612-482-4622 + 4201 Lexington Ave North Internet ddh@dash.udev.cdc.com + Arden Hills MN 55126 USA