From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Mon, 29 Oct 2012 19:10:55 EDT." <0f05642b113b3ecfc160e82a9ca4db32@brasstown.quanstro.net> References: <15723310.yIARpoJMSL@coil> <4824335454f1b1d47dbc8439b4af8ea3@kw.quanstro.net> <20121029223541.8C198B827@mail.bitblocks.com> <0f05642b113b3ecfc160e82a9ca4db32@brasstown.quanstro.net> Date: Mon, 29 Oct 2012 16:26:52 -0700 From: Bakul Shah Message-Id: <20121029232652.5160BB827@mail.bitblocks.com> Subject: Re: [9fans] caveat... optimizer? the `zero and forget' thread on HN Topicbox-Message-UUID: cc7e1a1a-ead7-11e9-9d60-3106f5b1d025 On Mon, 29 Oct 2012 19:10:55 EDT erik quanstrom wrote: > On Mon Oct 29 18:37:11 EDT 2012, bakul@bitblocks.com wrote: > > On Mon, 29 Oct 2012 09:35:00 EDT erik quanstrom wr > ote: > > > On Mon Oct 29 05:47:10 EDT 2012, dexen.devries@gmail.com wrote: > > > > http://news.ycombinator.com/item?id=4711346 > > > > > > > > 9fans says, ``no room in the compiler world for amateurs''. what's your > tak > > > e > > > > on the above fubar? > > > > > > any sort of "advanced" code-moving optimization is confusing. but the > > > way c/c++ are used in linux, bsd & osx, there is a noticable benefit to > > > optimizing calls away. it takes smarts to optimize away those recursive > > > wrapper macros. so they're in a bit of a pickle. > > > > It has nothing to do with "how" C/C++ are used in linux, bsd & > > osx -- you forgot windows! The C standard allows a lot of > > leeway in optimization. Consider this: > > my point was that the attitude that every optimization allowed is required is > not > helpful and is in the end counter productive. No disagreement there on "requiring" optimization. But my point was that a programmer should understand the standard rather than complain when he gets "surprised" due to his lack of knowledge. > actually, to be a bit cute about it, i should announce the first > international obfuscated c compiler contest. the goal of the contest > is to write a c99-compliant compiler that breaks every program in /sys/src/cm > d. > the winner will be chosen based on highest percentage of programs broken, > with the tie going to the most devious tricks for remaining standards complia > nt > while missing the spirit completely. /sys/src/cmd follows plan9 c, not c99, right? But pick a similar set of programs. If this happens, I claim it would be because programs assume something not guaranteed by the compiler. > > > it goes without saying, i think a compiler that largely does what you > > > ask it to optimizes the scarce resource: developer time. > > > > That is a separate issue. > > actually, i think it *is* the issue. Best way to save developer time is to program in a HLL and not worry about bit fiddling. C is not a HLL.