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.9 required=5.0 tests=BAYES_00 autolearn=ham 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.68.220.230 with SMTP id pz6mr447922pbc.3.1343320622990; Thu, 26 Jul 2012 09:37:02 -0700 (PDT) Received: by 10.180.24.202 with SMTP id w10mr1511682wif.0.1343320622880; Thu, 26 Jul 2012 09:37:02 -0700 (PDT) Received: by 10.66.85.164 with SMTP id i4mr1681928paz.21.1343313885913; Thu, 26 Jul 2012 07:44:45 -0700 (PDT) MIME-Version: 1.0 Path: b9ni65285795pbl.0!nntp.google.com!4no5094706pbo.1!news-out.google.com!ge7ni77034371wib.0!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!4no5058104pbo.1!news-out.google.com!b9ni64845167pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news.swapon.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada "library only" compiler ? Date: Fri, 20 Jul 2012 19:27:25 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <2879c45e-f8e0-4434-9f82-968c585a4539@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1342830449 14904 69.95.181.76 (21 Jul 2012 00:27:29 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 21 Jul 2012 00:27:29 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-07-20T19:27:25-05:00 List-Id: "Niklas Holsti" wrote in message news:a6tvrmFdinU1@mid.individual.net... ... >> So again, I don't mean to be harsh but if we are always building on C >> through the GNAT compilation progress would it be logical to decouple >> the two to create a simple Ada "as library" compiler? It seems that >> we can't open a file or get a command line argument without C >> anyways. > > 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). > > Likewise, when a GNAT-compiled Ada program runs on Windows or Linux and > accesses files, the GNAT-provided libraries (Ada.Text_IO etc.) must use > the Windows/Linux C-style I/O libraries, for the same reasons. This isn't quite right. Janus/Ada contains 0% C code (there is not a single line of C in Janus/Ada, the only exception being the never released Sun OS compiler and some parts that Unisys built for their hardware). That's true even on Windows. The Windows Win32 API does not require using any C code; it can be accessed directly. (Even the calling convention is not "C", it's "StdCall" which originally was "Pascal" until Microsoft got rid of their Pascal compiler.) It's true that the Win32 API is defined in C, but an Ada system can interface directly to it without using any intermediate C code. (Truth-in-advertising statement: Janus/Ada does link with the C runtime; we only use that for program initialization, as Microsoft does not document [at least the last time I looked] the state that a raw executable starts in. One thing is clear: that initial state does not include Standard_Input and Standard_Output, which makes it hard to do much! Anyway, we don't use an C APIs in our executable files. I'd (optionally) dispense with the C runtime if I knew how to do the needed initialization.) Janus/Ada is written solely in Ada; the Janus/Ada runtime is about 95% in Ada and 5% in assembler. Randy. Randy.