From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ab1d177a5a26577d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!2a02:590:1:1::196.MISMATCH!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: What's wrong with C++? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1ee1a434-4048-48f6-9f5e-d8126bebb808@r19g2000prm.googlegroups.com> Date: Thu, 17 Feb 2011 17:12:37 +0100 Message-ID: <17coueqbf1p27.1g0wj3010saxe$.dlg@40tude.net> NNTP-Posting-Date: 17 Feb 2011 17:12:33 CET NNTP-Posting-Host: e69ab2df.newsspool1.arcor-online.net X-Trace: DXC=;`K9jIn6BZHWDmlTRbh@=Iic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBUVH`WNGKX]F[6LHn;2LCVN[1ehZ;J\QI X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:18309 Date: 2011-02-17T17:12:33+01:00 List-Id: On Thu, 17 Feb 2011 08:38:25 -0500, Peter C. Chapin wrote: > On Thu, 17 Feb 2011, Dmitry A. Kazakov wrote: > >> The flaw here is structural equivalence and, more generally, type >> inference. Not everybody agree that type inference is bad. I do believe >> that it is. > > Could you elaborate a little on why you think type inference is bad? In the > functional languages that support it, type inference is completely type safe > (for example: Haskell, OCaml, Scala). Perhaps you mean something different. The first notice is that inferred types cannot be safe per definition. There is no additional information involved. What is inferred, already is. To me safety is when some a-priori information unknown to the compiler (and to the language designers) is used to detect sematic problems. The second note is that if types are not the things from the problem space (of which the compiler knows little or nothing), then what kind of stuff is there in their place? I presume that nothing. The third note is that if inferred, then why should we care of types? Anything that goes automatically does not bother me. I should care of something else: cryptic declarative language constructs of sematic, which cannot be clearly recognized. Now the main objection is computability and decidability. Only "simple" things can be inferred. The compiler cannot solve problems beyond Turing-completeness. The most problem spaces are out compiler's reach, and if they weren't we would need to program anyway. Since there is a programmer here, then how inference made by the compiler correlate with the inference done by the program reader. Do they infer same things from same code? I bet they don't if inference is non-trivial. How is it better than hexadecimal code, anybody is free to infer whatever he wants from it. This returns us to the second note. What is the metalanguage here if not the language of types, expressing incomputable semantics? > I do agree that type annotations can be useful documentation for the > programmer trying to read the program, but a program won't "go wrong" > because of type inference. It won't, but maybe just because there is no way to determine what it actually does. (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de