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-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Jed" Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Fri, 12 Aug 2011 00:15:05 -0500 Organization: A noiseless patient Spider Message-ID: References: <4209d782502610f6dbc08933d358b6d6@dizum.com> Injection-Date: Fri, 12 Aug 2011 05:14:48 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="bUZkUS1QLqpHyXuWevVWHQ"; logging-data="5708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2xyBc6fwb1fWFNu1IzdeQ" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 Cancel-Lock: sha1:zxFSnjGXInkVOBjiztmLX8qPyHY= X-Priority: 3 X-MSMail-Priority: Normal Xref: g2news2.google.com comp.lang.c++:92595 comp.lang.ada:21522 Date: 2011-08-12T00:15:05-05:00 List-Id: "Nomen Nescio" wrote in message news:4209d782502610f6dbc08933d358b6d6@dizum.com... > "Jed" wrote: > >> I know a little bit (enough to "be dangerous") of Intel assembly, and >> it >> looks like C/C++ integer types are a direct reflection of what is at >> that >> level. Even the fact that by default, integer literals are signed. So >> in >> that respect, I think they are special. They are chosen for efficiency >> as >> a direct reflection of hardware (I'm not saying all hardware is the >> same, >> mind you). > > What? What what? > > Of course there are unsigned integers even in the twisted world of > Intel. > What's more C/C++ integer types are not a direct reflection of anything > except the language spec otherwise the code would be completely not > portable. I didn't say it was. I said it probably arose from that. I'll bet integer literals are signed in most assembly languages (going out on a limb with this, because I really don't know). Hence, a no-brainer translation of HLL code to assembly (recognizing, of course, that compilers are free to generate machine code directly, rather than generating assembly). > >> You have to build those types though based upon the built-in ones, >> yes? >> If so, aren't modular, wrapping and overflow-checked equally good for >> something and all worthy of being in a language? Of course there is >> signed, unsigned and the different bit widths as candidates also. And >> are >> not those built-ins good to use "raw" in many cases? Are you >> suggesting >> that a language have NO types? There is assembly language for that >> (and >> the instruction set pretty much dictates what types you have to work >> with >> at that level). > > It's not true assembly language has no types, It's generally considered "typeless" from the POV of HLL programmers. It has relative meaning. No need to be pedantic about it. > especially with certain > systems and certain assemblers. The type in assembly language *does* > usually reflect the native types of the underlying machine very > closely, > obviously. And I'll bet, more often than not, C/C++ built-in types reflect that also. It would be "silly" to specify a language to what is uncommon.