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: 103376,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.de!news.teledata-fn.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: memory management in Ada: tedious without GC? 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: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <482E8A9D.5040401@obry.net> <8640a12f-da99-435f-8eb6-372e175cd5b9@z72g2000hsb.googlegroups.com> <482F19CE.7060306@obry.net> <87d4nkzhtn.fsf@willow.rfc1149.net> <2545491.n7xu0MFufK@linux1.krischik.com> Date: Sun, 18 May 2008 11:31:15 +0200 Message-ID: <143d9t4zvr3jh$.1iwejgp9vpckx$.dlg@40tude.net> NNTP-Posting-Date: 18 May 2008 11:31:15 CEST NNTP-Posting-Host: 308e7f0f.newsspool2.arcor-online.net X-Trace: DXC=e^P]3`\LXNmJ00P1S40fZgA9EHlD;3Ycb4Fo<]lROoRa8kF1;=NBj[6LHn;2LCVn[H On Sun, 18 May 2008 01:50:21 -0700 (PDT), jhc0033@gmail.com wrote: > On May 18, 12:03 am, Martin Krischik > wrote: >> #include is missing for it to become "perfectly legal". This is the >> typical cheat of C++ advocates - selling there standart library as >> languages features. > > So if the C++ standard said: " is included by default", that > would make C++ a better language in your opinion? Right, actually less built-in types a language has, the better the language is. The problem with C++ and vector is not that vector is not built-in. It is that vector cannot have a treatment fully equal to a built-in type: 1. Its body cannot be allocated on the stack. 2. It is not a proper type (requires parametrization) 3. Optimization. I have doubts that small vectors could be passed by value, loops over them unrolled, values cached in registers, that static bounds checking could be enforced at compile time and skipped at run-time etc. Further, the array abstraction is incomplete: 4. It does not have a class over the element type 5. It does not have a class over the index type (Ada does not have 4-5 either) >> But that is unfair as vector<> can be implemented in any language including >> assember. > > Oh, panlinguistic guru, I'd like to see you try to implement "STL" in > C! I wonder if you'll go for macros or void* type casts with type > sizes as explicit parameters. How will you implement automatic memory > management and deep copy semantics for arbitrary user-constructed type > parameters? This is a misunderstanding. Clearly, it is doable in any Turing-complete language. The problem is how much an implementation could be disguised as a normal array type. However, because assembler does not have much types anyway, where is a problem? (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de