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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b5cd7bf26d091c6f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.71.MISMATCH!xlned.com!feeder3.xlned.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Tue, 7 Jun 2011 10:51:53 +0200 Organization: cbb software GmbH Message-ID: <19opieyek0qat.1139e23ejh9en$.dlg@40tude.net> References: <1e5e764d-eb7b-4804-8119-b535ddbe5e7e@32g2000vbe.googlegroups.com> <1a84tm53l1wjx.1xdgsbp25vyd5.dlg@40tude.net> <1142c50a-bf12-4aed-984c-70ba818b4372@dn9g2000vbb.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19670 Date: 2011-06-07T10:51:53+02:00 List-Id: On Tue, 7 Jun 2011 00:32:15 -0700 (PDT), Maciej Sobczak wrote: > On Jun 6, 8:53�pm, "Dmitry A. Kazakov" > wrote: > >>> BTW - what about generating debug version of the executable with >>> source embedded? >> >> What for? All you need is source location tags. > > Which only grow in memory. Not as fast as the source does. > the data is still there in memory, just in some other form. That is why compilers are also called "translator." >>> In particular, the compiler does not work on potentially >>> infinite streams (unlike cat and grep) and there is a clear concept of >>> a program structure that has its end. This means that reading the >>> whole source file into memory is a perfectly valid approach. >> >> Wrong. A good example is GNAT compiler which runs out of Windows' 1-2GB >> limit when compiling my generics. Macros tend to explode (:-)) > > They will explode whether you will keep the original source or not. Nope. Ada was designed for separate compilation. > Let me guess - your source code is smaller than 1-2GB, right? Frankly > - how big it is in terms of percentage of the total memory used? 1%? I suppose that is not the case for GNAT, but considering what you proposed together with inlining, compilation of generic instantiations would require keeping expanded sources. I am using generics to emulate MI and delegation. I.e. there are long paths of generics using other generics (as parameters or parents), which in turn use other generics etc. The whole "inheritance" tree must be instantiated and so expanded. > I bet there are much bigger optimization opportunities in > resulting internal data structures. That does not justify keeping more than one source line in the memory. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de