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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 109fba,cd8ed9115942852f X-Google-NewGroupId: yes X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gid4f1905883f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 13 Aug 2011 13:02:03 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110613 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> <150vz10ihvb5a.1lysmewa1muz4$.dlg@40tude.net> <1q4c610mmuxn7$.1k6s78wa0r8fj.dlg@40tude.net> <4e44e50a$0$7619$9b4e6d93@newsspool1.arcor-online.net> <4e4560e7$0$6546$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4e4659ab$0$6545$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 13 Aug 2011 13:02:03 CEST NNTP-Posting-Host: 2c24272b.newsspool4.arcor-online.net X-Trace: DXC=I3;Yg5F_Ymk]BlmkiiU@Bi4IUKeaBb3jcPCY\c7>ejVh0[gA\o5>0[lDU\oFPid70e X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.c++:92683 comp.lang.ada:21570 Date: 2011-08-13T13:02:03+02:00 List-Id: On 12.08.11 21:51, Jed wrote: > I like the semantic also (not the syntax though). I still don't have a > feel for the scope of the desired (your) semantics and the compiler > implementation effort requited though. So far, I'm clear on "ranged > integers + size attribute". As others have argued, and as has come out of the study mentioned earlier, the language should allow specifying types by referring to those properties of the solution that are descriptive of the envisioned type's properties. That's rarely int alone, but rather what the programmer has in mind. Sorry, I can't present to you a complete and consistent summary of the world's programmers' ideas about whole number types in their programs, other than in the negative: they are rarely covered by int, as is exemplified in this thread. A positive addition: we already have alternative ways of declaring types and they lead to exactly as efficient programs. These types are an interesting challenge, anyway. A few compiler writers have done some homework and decided that cyclic types (beyond wrapping ones such as unsigned int) would be nightmarish to implement. At least efficiently, IIUC. But do they have to implement all kind of ideas, or should a language just offer building blocks for the type system? For example, offer a set membership operation, one that can no just be tacked onto operator=, but such that the compiler can infer things systematically, guided by standard rules whenever it meets =. Is there a way, for example, to define a type system that keeps HALT out of operator=? > So, a control panel on top of the low-level things. (4GL vs. 3GL). int refers only to what the C++ standard has to say about minimal properties of int. Simply being more specific about what values I have in mind is far, far away from a 4GL language. Even WRT GL time. The idea is at least as old as 3GL, and has been implemented long ago. The difference in concept between int and integer types flowing from programmer's specification need not be huge: Writing "int" gives permissions to the implementation, so do "n1 .. n2" etc. Only that a C++ compiler cannot but conflate the value set the programmer had in mind and the value set that happens to be that of int in a given implementation.