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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81cf52699486abe7 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Code size of Ada ? was Re: Ada95 Strengths/Weaknesses. Date: 1999/09/30 Message-ID: <7svnuk$uf8$1@nnrp1.deja.com> X-Deja-AN: 531101703 References: <37EED7B8.245C0054@yukyonline.co.yuky> <7smp30$9aa1@news.cis.okstate.edu> <7sp8m9$a6e$1@nnrp1.deja.com> <37F0D03C.DE4807D4@icn.siemens.de> <7srnb9$2u3$1@nnrp1.deja.com> <37F22A06.176CA9F6@icn.siemens.de> <7stsfs$l05$1@nnrp1.deja.com> <37F343A5.A68B8321@icn.siemens.de> X-Http-Proxy: 1.0 x41.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Sep 30 13:18:23 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-09-30T00:00:00+00:00 List-Id: In article <37F343A5.A68B8321@icn.siemens.de>, Alfred Hilscher wrote: > This is absolutely wrong. OK, you don't like the "Hello > world", so let me show an other example. I've wrote a simple > WEB-server > for remote control of production maschines. The code that GNAT > produces was more than 800K, the same with Modula was about > 70K (10% !), both on WinNT. Are you sure you measured code size, and not executable size, or do you think they are the same? Of course they are not. If you don't know why, you need to find out (most likely you were comparing a stripped program with a non-stripped program, if you don't know what stripping is about, you need to find out!) > Oh, sorry, I remember, you don't > like comparison with other languages. That is invented and wrong. I think comparisons with other languages can be instructive IF DONE RIGHT! > Well, I compiled the same > with ObjectAda 7.1 and the total amout of code (with static linking) > was 200K. Therefore I think, that there must be a way to produce > smaller EXE-files with GNAT, too. Now you make it clear that you think that the EXE file contains only code. THis is a severe misconception. > And _this_ was the question of > my original posting. Ok, ok. I understand. I do not pay lots > of $$$ for support, therefore I will not be told the > neccessary compileroptions . You could try reading the documentation. I know that this seems an amazing idea for most people these days, but you would be surprised how helpful this can be. All the options are clearly stated in the documentation, you don't need to pay $$$ for support to find that out. > But it does not matter, I prefer the Aonix > tool anyway. Fine, but I wonder from the above whether you are giving either tool a real chance if you don't read the documentation to find out the basic capabilities of the tools. > > As I said earlier, the comparison figures are pretty useless > > you cannot generalize from them in this way. > But a few programs ranging from > 4 lines up to 5000 should be a little representative. Not if you make fundamental methodology mistakes, like assuming that EXE size is the same as code size. > > But you only did it with small programs ... and almost > > certainly non-comparable programs at that ... > NO. See above. Please tell me _your_ definition of "small > programms". Well of course this is a bit irrelevant, since it is clear that your methodology is fatally flawed in two respects: 1. You are assuming that EXE file size is a measure of code size. This is true only under careful controlled conditions, which you have not established. 2. You are not using appropriate options (see GNAT and GCC documentation) to minimize executable size. It's always interesting to figure out what the default options should be for a compiler. We seriously considered making -O2 the default, just to deal with the case of people who did comparisons without the foggiest idea of what they were doing (reviewers can often be in this category for example). Deciding whether the run time library should by default be stripped is another such decision point. But ultimately we decided to choose the options in a manner appropriate to those who know what they are doing, and in a manner consistent with other gcc compilers. This inevitably leads to the kind of confused thinking that I am responding to here, but there is no way to get the defaults right for everyone, you really have to count on people reading the documentation and taking the effort to be come minimally aware of what is going on. I know this sounds a bit harsh and dismissive, but there really is no substitute for careful reading of the documentation. In particular, posting a brief message to CLA asking for help can often be worse than useless for two reasons: 1. There is often insufficient information given to figure out what the real problem is, so suggested solutions are to some other problem. 2. The blind leading the blind phenomenon. THere are a lot of posts to CLA that just give plain wrong, or more commonly incomplete information. If you ask a question for example about a particular GNAT option, you are quite likely to be answered by someone who also has not thoroughly read the documentation and therefore answers with incomplete knowledge. A note here: if you have a GNAT-specific question, you will almost always do better on the chat@gnat.com list. There you will find a lot of GNAT knowledgable folk who have given up reading CLA a long time ago (excessive noise to signal ratio :-) This does not mean that the above two problems do not exist there too, but you definitely will have a better shot. Still, there is a furniture store in NY whose motto is "An educated consumer is our best customer", and that applies here too. The more effort you make to learn about what is going on, in particular by thoroughly reading the documentation, the better off you will be. It is indicative of the problem that it is quite rare to see questions about the documentatation itself (what does it mean when it says bla bla bla). This is surprising, because surely the documenation is not perfect, and there must be parts that are not 100% clear. By the way, some people do read the documentation closely, and provide useful feedback by reporting errors, unclear stuff, omissions etc to report@gnat.com. Thanks to all who have helped in this way in the past, and thanks in advance to those who can help in the future to improve the documenation in this manner. Robert Dewar Ada Core Technologies P.S. Alfred, obviously there are some major issues like stripping, and compilation options to be addressed, but I suspect we will arrive back at the point of comparability of code. It would be quite helpful if you would respond to an earlier suggestion I made and post just a single C function Ada subprogram that you consider comparable. That way we have a specific example to discuss. Such a discussion could be considerably more helpful than the general thread so far. The code size of a program is closely related to the code size of the individual components ... Sent via Deja.com http://www.deja.com/ Before you buy.