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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af247e41be5f18ab X-Google-Attributes: gid103376,public From: dewar@gnat.com Subject: Re: simple question - how to emulate void * ? Date: 1998/10/25 Message-ID: <710353$522$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 404949465 References: <9v6hGdgMLuwN-pn2-Oc41W71Dq3U9@dt182n2f.tampabay.rr.com> <36308AA6.86327E09@spam.innocon.com> X-Http-Proxy: 1.0 x3.dejanews.com:80 (Squid/1.1.22) for client 202.135.41.156 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sun Oct 25 20:53:55 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.0 (Win95; I) Date: 1998-10-25T00:00:00+00:00 List-Id: In article , dale@cs.rmit.edu.au (Dale Stanbrough) wrote: > You should also be careful of scaring people away. Many people want to > know if they can do a task in a particular way, i replied that they > could (I often get asked "can Ada call "system"?" - there is a hell of > a lot of ignorance out there (well, amongst students at least, but I > would imagine that exactly the same happens elsewhere). Showing people > that yes, Ada can do it in exactly this way _is_ a useful thing to show. > > People can then walk away and say > > "ok, so i can do all of those things that C can. Maybe it's not > so bad...". Dale certainly has a point. On the other hand, if you end up sending a message that Ada can do anything you can do in C, and do not emphasize the advantages of Ada, then a reasonable reaction is "well if Ada can do anything that C can do [and implicitly vice versa, since I haven't heard anything to the contrary] I might as well stick with C". So it is important to emphasize the Ada way of doing things. In general people tend to ask how to do something in Ada and tell you the solution they already figured out in some other language, rather than the original problem, which probably has a better solution. After all if you really want to write a program full of address arithmetic and low level C-style mucking (as opposed to using these features only at critical points where they are justified), then I think you indeed should stick to C, there is no point in writing C-style code in Ada. Interestingly the converse is not true, there *is* a point in writing Ada-style code in C. If you know Ada, and then force yourself to do things in a stylized way in Ada style, you can get some of the advantages of Ada in C, at least at a readability level (however, note the use of the word "some" here!) Tucker Taft claims that the Intermetrics front end, which is written in C, follows such style rules, but since few people have seen these sources it is hard for people to judge how well this was achieved. My own feeling is that even if you do try to write C in a restricted, "nice" style, and enforce this with tools (the enforcement is very important or long term maintenance by C programmers not so committed to the stylistic decisions of the original will ruin things), you still have something that is far short of satisfactory. One of the best decisions we made in the GNAT project was to implement the front end and library entirely in Ada 95. Interestingly this was a decision forced on us by Chris Anderson, as our project manager at DoD when then GNAT project was at NYU. She couldn't justify spending their money on writing C code. We had originally intended to migrate the original Ada-Ed front end (written in C in the early 80's) to Ada 95, but I think we would never have succeeded following that path. Indeed the GNAT project itself is one of those anecdotal cases of C programmers being forced to use Ada, and pretty quickly being VERY happy with the change :-) We certainly regard it as an important strength that we write in Ada 95, and we believe in our own tools for building our tools. It would of course be nice to rewrite gcc in Ada 95, but as in many other circumstances, one cannot justify a major rewrite effort of this kind just to change languages. Of course if one could find the resources for a major reengineering effort for the GCC backend at the same time, that would be interesting. However, even though the GCC backend is in C, the strong capabilities for interfacing Ada 95 and C make it very easy to marry the Ada 95 front end with the C backend (indeed GNAT itself is a very nice example of the ease of such mixed language programming with Ada 95!) Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own