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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d8e3cd3d8dbaa4fb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.77.3 with SMTP id o3mr1400700paw.13.1343313460056; Thu, 26 Jul 2012 07:37:40 -0700 (PDT) Path: p10ni61181651pbh.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!backlog1.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!ramfeed-1.ams.xsnews.nl!feed.xsnews.nl!border-3.ams.xsnews.nl!newsfeed.straub-nv.de!reality.xs3.de!news.stack.nl!news.litech.org!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 20 Jul 2012 17:25:17 -0500 Date: Fri, 20 Jul 2012 18:25:17 -0400 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada "library only" compiler ? References: <2879c45e-f8e0-4434-9f82-968c585a4539@googlegroups.com> In-Reply-To: Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-2y31FXaB8XZTKyNSv3wnqu7Rbc7UheP8ExipLEMG7FhmCllDnKb9N/GAa3Svm+lkY7hfiKQndaXCHqf!vS2L3SwgPzSrcmvB9iNf9w8qJUi5Y8cqGKp1XDw0MShX1cTNKlnzwExdwHkb5Pc= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2984 X-Received-Bytes: 3369 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-20T18:25:17-04:00 List-Id: On 2012-07-20 17:11, Niklas Holsti wrote: > GNAT runs on operating systems (Windows, Linux, etc.) in which the > Application Programming Interface is defined in C. In order to open a > file under Linux, the application (here GNAT) *must* use the open() or > fopen() functions, which are defined in the API as C functions. Trying > to open a file using "low-level Ada" would be breaking the OS interface > which is obviously a bad idea (and probably impossible because an > application does not have the necessary low-level access rights for that). I don't think this is quite right. Entrance into the operating system is ultimately done in machine language. The C API functions you're talking about are thin wrappers that present a C callable interface and then do what must be done to actually invoke the system. For some systems "doing what must be done" involves executing exotic instructions that (standard) C compilers can't generate. Thus one supposes that functions like open(), etc, are written in assembly language or its moral equivalent. This could be done for Ada. An Ada procedure could be written that wraps the same assembly language magic but that provides an Ada interface to the system... no need to use clib in that case. Of course the system interface isn't standardized whereas the C interface is (POSIX). If the raw interface to the underlying system changed the Ada interfacing code would have to change. Of course the same could be said for clib (the clients of clib wouldn't have to change but clib itself would). I believe there is, in fact, an Ada standard interface to POSIX-like systems. My understanding is that there is no requirement that says the implementation of that interface must be done on top of C. Peter