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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-06 06:15:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!p62.246.105.17.tisdip.tiscali.DE!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Mon, 06 Jan 2003 15:16:04 +0100 Organization: At home Message-ID: References: <3E147D79.2070703@cogeco.ca> <4519e058.0301031434.51a0c880@posting.google.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: p62.246.105.17.tisdip.tiscali.de (62.246.105.17) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1041862535 14805993 62.246.105.17 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:32613 Date: 2003-01-06T15:16:04+01:00 List-Id: Kevin Cline wrote: > "Dmitry A. Kazakov" wrote in message > news:... >> Kevin Cline wrote: >> >> > Today, the features that Ada provides have little value >> > compared with the features that C++ provides and Ada lacks: >> > the STL, automatic template function instantiation, >> >> Generics in any form is an illness of programming languages. >> >> > smooth integration of user-defined and primitive datatypes, >> >> Why do you think C++ is better in that respect? > > Because all operations applicable to C++ fundamental types can be made > to work for user-defined types. Ada's fundamental types have > attributes, but those attributes can not be provided for user-defined > types. Some of them, to be correct. There are overridable attributes. Note also that Ada offers much more "standard" operations than C++. I agree that every of them has to be a primitive overridable operation, but the burden of Ada 83 is heavy. Then some of things are difficult to make. Consider aggregates. Can C++ override them? Consider indefinite types. Does C++ have them? Consider short circuit operations. In C++ you can override it but you loose its property. > This makes generic programming in Ada more difficult than > generic programming in C++. I disagree. Generic programming is not equal to programming with generics. It is programming for type sets. Ada's class-wide types are much more consistent and powerful that flawed C++ OO model. >> C++ OO model is badly flawed >> as compared with Ada's one. In any case both Ada and C++ have primitive >> types separated from user-defined types by a fire wall. The difference is >> that Ada's design potentially allows to mend this, while in C++ it is >> beyond repair. > > You need to substantiate this claim; I have found the opposite to be > true. 1. C++ does not distingush a specific type from a types set. 2. In C++ you can dispatch on exactly one parameter 3. The dispatching parameter cannot be result. So all functions are contravariant 4. In C++ you cannot return a class-wide parameter otherwise than through a pointer 5. Because of 1. there is no way to deal with ALL types in same way. For instance, int is not a class and will never be one. 6. Because of 2. you cannot implement binary operations properly >> > and bindings to every API in existence. >> >> That's not language fault. > > I didn't say that it was a language flaw. But it makes Ada more > difficult > to integrate with existing APIs. > >> This can be addressed to any language except C. > >> Even C++ suffers from that: you might need 'extern "C" {}' to call most >> of API functions. > > Generally I don't have to supply "extern C ... " because the most > header > files handle the problem. Even if they don't, I can simply say: > > extern "C" { > #include "someAPI.h" > } > > rather than redeclaring every one of the functions needed. Really? And what about stdcall vs. cdecl? Parameter passing conventions could be well different from what extern "C" does. I would agree with you, should you say: many API are written in C which allows a smooth integration into a C program provided that the compiler and linker are of same vendor as API, or a sort of standard was involved. Then because MS is a monopolist and all poor programmers have to use MS VC++, then ... -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de