Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Hans-Peter Diettrich Newsgroups: comp.compilers Subject: Re: Optimization techniques and runtime checks Date: Wed, 8 May 2019 02:27:36 +0200 Organization: Compilers Central Lines: 53 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-05-059@comp.compilers> References: <72d208c9-169f-155c-5e73-9ca74f78e390@gkc.org.uk> <19-04-021@comp.compilers> <19-04-023@comp.compilers> <19-04-037@comp.compilers> <19-04-046@comp.compilers> <19-05-052@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="98816"; mail-complaints-to="abuse@iecc.com" Keywords: arithmetic, standards, comment Posted-Date: 07 May 2019 22:57:06 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2294 Am 07.05.2019 um 16:29 schrieb David Brown: > On 29/04/2019 22:36, Hans-Peter Diettrich wrote: >> Am 28.04.2019 um 23:49 schrieb David Brown: >>> This is exactly the same as mathematics. The "square root" function, >>> for real numbers, is defined for non-negative numbers. If someone asks >>> you for "sqrt(-4)", then the question is meaningless. Any answer given >>> can be considered incorrect - equally, any answer given can be >>> considered correct. >> >> That's a cheap excuse for poor language design, aimed at sloppy compiler >> implementation. >> > > You are saying that mathematics is a poor language design? No, I criticize the lack of restricted (non-negative...) types for such purposes. > Different languages have different purposes and trade-offs. This is > important to accept when discussing them. No doubt :-) So I wonder why the topic (optimization...) drifted into a discussion of almost only the C language. I also wonder where runtime efficiency nowadays is really so important, that safety and security breaches are considered acceptable? > Every language has its oddities, and there are always things that some > people thing are terrible design. For example, it is truly weird that > "const x : int = 10;" is one of Delphi's way of making "x" a variable > with an initialised value. (In older Delphi, it was the only way!) This makes the different evolution visible: Pascal started as a tutorial language, C as a production language. Evolution added features of great demand - in the case of Pascal many features had to be added to Wirth's academic language(s) before it became usable outside education. I definitely prefer a safe language, which can be tuned later for efficieny. Lowering requirements and checks in specific parts of a program is doable and acceptable easier than introducing requirements that were not anticipated in the basic language design. DoDi [These days I write just about everything in python. Occasionally I'll rewrite something in C if python can't do it but that's pretty rare. The python implementation everyone uses is written in C but it does a pretty good job of managing storage and arithmetic. -John]