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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92640d662fc31a03 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-04 13:58:07 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: howto make system calls (newbie question) Date: Fri, 4 May 2001 16:56:29 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 989009886 80837 137.194.161.2 (4 May 2001 20:58:06 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 4 May 2001 20:58:06 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: newsfeed.google.com comp.lang.ada:7179 Date: 2001-05-04T16:56:29-04:00 I totally agree with Marin. Frank -----Original Message----- From: Marin David Condic [mailto:marin.condic.auntie.spam@pacemicro.com] Sent: Friday, May 04, 2001 11:49 AM To: comp.lang.ada@ada.eu.org Subject: Re: howto make system calls (newbie question) While I'm basically on your side here, Marc, I think it is fair to point out that in Kernighan & Ritchie (I don't have the ANSI C standard in front of me) it says there is a "Standard Library" that, while "not part of the C language proper" is considered to be part of the C environment that a standard implementation of C will provide. In that library, we find which contains a function "system" that one can reasonably expect to be part of a standard C implementation. I would consider this analogous to the Ada appendices that define things like Unbounded_String, etc. The various string packages are not part of the Ada language per se, but are an expected library of things available in Ada if the implementation is conformant with the standard. I see no reason that Ada couldn't provide similar libraries (perhaps optional for implementations where it makes no sense to have them - e.g. embedded machines) for functions like "system" so that calling conventions, etc., were Ada-ish and required no understanding of anything outside Ada to use. (No pragma import stuff, etc.) If it were legal for us mere mortal hackers to extend the package Ada, it might have already been done. (This is how a lot of things crept into C, after all.) Its fair for someone to criticize Ada for not providing the sort of reasonable and customary libraries one gets with lots of other languages. (Where "reasonable and customary" stops is subject to debate, but I'd think some basic OS services ought to fall within scope.) Saying "well you can get there by binding to the C libraries" is a bit of a "me too!!!" syndrome that keeps Ada a follower rather than a leader. Ada has to get out in front of the issue and create its own interfaces or it will forever find itself fighting the "well then why not just use C/C++ and be done with it?" criticism. That's a hard one to win. I like the idea of having Ada include lots of apendices to bind to things in a standard way. A lot of what is in the C libraries Ada doesn't need because it has other ways of getting there, but why not look over the C libraries and provide an Ada standard way of getting the same services? (Not in a slavish "me too!!!" way - do it "The Ada Way" (tm).) A quick scan of K&R-II Appendix B, suggest the following as things Ada provides no immediate alternative to that could be added in some way: system getenv bsearch qsort (Yes, it exists, but should be part of the standard...) (Yeah, you have some of it with exceptions - OS stuff is what I have in mind here - can we have a standard exception (or other mechanism?) for SIGINT, SIGTERM, SIGABRT?) clock asctime ctime gmtime localtime strftime A little thought about other things commonly supplied by most OS's would probably yield a bunch more ideas. Maybe we'd start seeing some posts in Comp.Lang.C(++) to the effect of "I can do XYZ in Ada - how do I do the same thing in C(++)?" and "Why doesn't C(++) provide me with a function/class to do ABC which I can do in Ada so easily?" (Maybe we can start some shill postings? :-) Just an idea.... MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/