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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6575b47ba54cee7c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!postnews.google.com!d21g2000prf.googlegroups.com!not-for-mail From: Hibou57 Newsgroups: comp.lang.ada Subject: Re: Reducing the size of executables produced by GNAT Date: Wed, 13 Feb 2008 12:03:39 -0800 (PST) Organization: http://groups.google.com Message-ID: <9c0a949b-ce82-4eda-99c9-02aace675266@d21g2000prf.googlegroups.com> References: <40e9c01a-8d31-4554-9d9b-18cce7834d56@s12g2000prg.googlegroups.com> <47b300d3$1@news.post.ch> NNTP-Posting-Host: 77.198.58.74 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1202933020 14248 127.0.0.1 (13 Feb 2008 20:03:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 Feb 2008 20:03:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d21g2000prf.googlegroups.com; posting-host=77.198.58.74; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.23 (Windows NT 5.1; U; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19776 Date: 2008-02-13T12:03:39-08:00 List-Id: First of all, many thanks for you anwers to all of you :) On 13 f=E9v, 15:38, Martin Krischik wrote: > Seehttp://en.wikibooks.org/wiki/Ada_Programming/Basic#FAQ:_Why_is_.22Hel..= . I saw this one, but when I try to compile the exemple with "gnatmake - Phello_world", I just get compilation errors. I've removed the options which turned into error, but then finally the size is the same. Note: I'm using gcc-ada which comes with MinGW (for Windows XP), and the last version of gcc-ada from Debian (for an old Linux machine). > Well, the record is 8kb for Linux-i686-Release. I would like to get the same :( > No nessesarily, static linked files are large but might load faster. All > depends of course. If startup is important then guesswork won't help - > you have to time it. Oops, I've sid something wrong : when I was talking about a statically linked application, I was talking about a staticaly linked GNAT runtime. Apart of that, there are still dynamics dependencies. So this is not trully staticaly linked. > BTW: I hope you use the most powerfully CGI binding available: My own, which works fine. It is actually written in Pascal (FreePascal), but I do not want to use it anymore (no more FreePascal, and no more Pascal). gautier_niou...@hotmail.com wrote > Short answer: the fixed cost is big, but if your source grows beyond > "Hello world", the binary growth is very decent, of course with the > appropriate options. Yes, you are right in some way, and I had my self written the same in a french forum. But the world in not only made of big applications, and some are small, while beeing still needed. > Long answer: see newsgroups archives! Already done, and I did not find anything useful to me. Pascal Obry wrote : > Yes and this is called: runtime. I know what a runtime is, but I do not understand why the one coming with GAT is so much big even where they are so little needs. By the way : is there a place where one can find a lightweight runtime ? This was what I was looking for first, bu I did not find any at the time. > Indeed, debated many many times... Perhaps, but if every will stop to talk about thing which has already been talked about, then no body will not talk about anything :p I was expecting to come into some interesting news. Ludovic Brenta wrote: > * compile with -Os (optimize for size) > * strip the executable maximally Already done (even tryed witg gnatelim, which by the way seems to be missing with MinGW). > Do not worry though that the machine executes 45 KB of instructions. > Part of the executable contains data, which you cannot reduce but > which is obviously not executable. If it is not executed, so can I remove it in some way ? > want performance, forget GCI. GCI is probably the worst way to do > dynamic web sites and has been deprecated for the past 10 years or so. > 120K or 45K or 10K CGI executables won't make a difference because the > executable files will be in the buffer cache anyway. What does make > CGI slow is creating a new process with environment variables, file > descriptors, etc. and then the necessary inter-process communications > between the web server and the scripts. And CGI does that for each > incoming HTTP request: this is bad. > The proper way is to write one executable that embeds the web server > itself. The Ada Web Server library from AdaCore was designed > specifically for this purpose. With AWS, your one executable will be > larger but much, much faster than CGI. And, since you will not launch > your application with each HTTP request but only once and leave it > running all the time, dynamic linking will be an option. Nice advice indeed, I like this one, beceause I often think about it (I'd better say, I often dream about it). I will love to be able to do that, but I'm hosted on a mutualist server (not dedicated), so I have no other choice excet to rely on the CGI interface. At the time I'm just able to earn omething like 100$ a moth with this site, so I cannot paid for a dedicated server, but I would like to work on some more intereting online applications. Anon wrote: > If you rewrite the GNAT RT Libraries system so that it only uses the > routines that you need with direct OS Interface packages you can get > a program like "Hello" down to the bare minimum of 256 bytes (1 > sector on a floppy) or less. It is easy to do but for most people that > too much work. I do not mind about writing a runtime sweeted to what I need (I will use syscalls, thus requiring no dynamic linking, fast and small), but I do not know how to do with the exceptions runtime. I had a look at this : http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/index.htm but this not goes into enought deep detail about the way GNAT handle exceptions. As an exemple, if I attempt to compile with "No_Run_Time", I get an error about a duplicate symbol which is not documented in this document. Pascal Obry wrote: > You must be very good to be able to develop a full Ada runtime in 256 > bytes! No the problem is more about unused code elimination, this is > possible on some plate-forms with recent binutils and GCC/GNAT. Not a full runtime of course, but a runtime with just what is needed (mainly file I/O, memory allocation and exception support, ... the latter beeing the one I do not know how to implement) Tero Koskinen wrote : > Like others suggested, look at AWS. It is a fast web server, much > faster than normal http-server + CGI app combination. As I said before, I would love to do that, but I cannot, due to the fact that it is not a dedicated server. > Here is simple example which uses C runtime instead of Ada runtime > for output: At the time the trouble is with exceptions Is there a runtime with just no more than exception support ? Well, I will have deeper look just at least to compare loading time of a Pascal vs an Ada (GNAT) application. If you have any other idea, do not hesitate to tell here Read you soon friends :) Yannick Duch=EAne