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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Alexander Van Hecke Subject: Re: bitwise comparators Date: 2000/01/17 Message-ID: <38838846.2787AD1A@hotmail.com>#1/1 X-Deja-AN: 573926128 Cache-Post-Path: marvin!root@tvd-10-67-20-018.tvd.kotnet.kuleuven.ac.be Content-Transfer-Encoding: 7bit References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <85vmn2$ki1$1@nnrp1.deja.com> <38836CF2.AB738B8B@hotmail.com> <85vr1s$9qe1@news.cis.okstate.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@belnet.be X-Trace: naxos.belnet.be 948144293 3267 134.58.127.3 (17 Jan 2000 21:24:53 GMT) Organization: KULeuvenNet X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Mime-Version: 1.0 NNTP-Posting-Date: 17 Jan 2000 21:24:53 GMT Newsgroups: comp.lang.ada Date: 2000-01-17T21:24:53+00:00 List-Id: > > C has access control? Where? the items you put in a struct are default public. private is a C keyword though. It is perfectly possible to hide some data items. > > > >> exceptions, > > > >you can program exceptions in C. > But it doesn't have them, and good exception handling needs to > be handled by the compiler. > > >> generics, > > > >use structs and callback functions and you have perfect generic types! > No type safety, large runtime overhead, and poor readibility is perfect? > > >> tasks, > > > >threads > Which aren't a part of C, and most thread libraries aren't portable among > systems (Unix -> Windows -> Mac -> bare hardware). > I understand what you're saying, and you're right too! As I already said, Ada is a programming language of a later generation, and thus has more features ( = things you could do with previous generation languages, but were perhaps difficult / erroneous to program) that the compiler does for you. Never forget that this almost always has a direct impact on the speed of your programs (cfr. Java which resembles C++ (not in every point of course) but is WAY slower because of all kinds of automatic checking / copying / testing ...)! However, this does not mean that you can do 'more' with this language. I think I should have explained more carefully what I mean by 'powerful' : it has nothing to do with how complicated your compiler is (and I will be fair, it's very good if your compiler checks for errors (like typing errors) that are otherwise hard to find), but I'd say it's the ability of a language to be _able_ to program everything you want to, _even if the language was not designed to solve the problem you're trying to solve_! In this way Prolog is a very powerful language for AI programs, but it's really poor when it comes to, let's say, string manipulation. I think that is a good point for C : easy to learn, possibilities are enormous, used everywhere (OSses, programs, ...), and very extendible. I can't think of anything that can not be written in C. I must say, I had never heard of Ada except for the context of embedded systems. > > >With true arrays, do you mean out of bound checking, etc? This can be done > >with _proper_ programming in C! > So in other words, with enough work, you can add real arrays to C? The point > is you have to add them, they don't come with the language. Indeed you're right. > >Don't forget that > >ANY C++ code can be easily translated into C? > No. With sufficent work, C++ code can be translated into C, but you're > going to rewrite several core systems in process. You're going to have > to munge names, write vtables and all sorts of grungy stuff. I know with certainty that the first couple of versions of the GNU C++ compiler, which is by the way a very respected and widespread compiler, did just that : converting C++ to C and then compiling this code with the usual gcc compiler. I rephrase : 'any C++ code can be translated to C code'. I do not want to start a war here between C/C++ and Ada! Both of the languages have their pro and cons. greetings, alex