comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Reading the while standard input into a String
Date: Tue, 7 Jun 2011 00:32:15 -0700 (PDT)
Date: 2011-06-07T00:32:15-07:00	[thread overview]
Message-ID: <1142c50a-bf12-4aed-984c-70ba818b4372@dn9g2000vbb.googlegroups.com> (raw)
In-Reply-To: tdj918mv3pq5.hay9yj6y2gyu$.dlg@40tude.net

On Jun 6, 8:53 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
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. This means that the concept of dropping the
chunks that were already processed is a fiction - it just does not
happen, the data is still there in memory, just in some other form.

> > 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.
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%?
Dropping this amount of data (while at the same time complicating the
process with additional tags, etc.) as a means of preserving memory is
pointless. I bet there are much bigger optimization opportunities in
resulting internal data structures.

> Memory is cheap, but that does not mean you should waste it. You just do
> not need to keep anything but the current source line.

And now I would very welcome somebody from existing compiler vendors
to hop in and confess how this is *actually* done. :-)

--
Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com



  parent reply	other threads:[~2011-06-07  7:32 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 16:20 Reading the while standard input into a String Natasha Kerensikova
2011-06-06  1:49 ` robin
2011-06-06  7:18 ` Dmitry A. Kazakov
2011-06-06 10:46   ` Natasha Kerensikova
2011-06-06 12:05     ` Dmitry A. Kazakov
2011-06-06 16:55       ` Jeffrey Carter
2011-06-06 17:42         ` Pascal Obry
2011-06-06 17:43         ` Pascal Obry
2011-06-06 18:31         ` Dmitry A. Kazakov
2011-06-06  8:09 ` stefan-lucks
2011-06-06  8:33 ` Ludovic Brenta
2011-06-06 10:08   ` Natasha Kerensikova
2011-06-06 10:27     ` Ludovic Brenta
2011-06-06 10:31       ` Ludovic Brenta
2011-06-06 12:07         ` Natasha Kerensikova
2011-06-06 15:18   ` Maciej Sobczak
2011-06-06 18:18     ` Dmitry A. Kazakov
2011-06-06 18:36       ` Maciej Sobczak
2011-06-06 18:53         ` Dmitry A. Kazakov
2011-06-06 19:10           ` J-P. Rosen
2011-06-06 19:46             ` Dmitry A. Kazakov
2011-06-06 23:37           ` Shark8
2011-06-07  3:00             ` Randy Brukardt
2011-06-07  7:25             ` Dmitry A. Kazakov
2011-06-07  7:32           ` Maciej Sobczak [this message]
2011-06-07  8:51             ` Dmitry A. Kazakov
2011-06-07  3:10         ` Randy Brukardt
2011-06-06 19:06       ` J-P. Rosen
2011-06-06 19:52         ` Dmitry A. Kazakov
2011-06-07  3:15         ` Randy Brukardt
2011-06-06 22:14   ` Robert A Duff
2011-06-06  9:46 ` Georg Bauhaus
2011-06-06 11:16 ` Georg Bauhaus
2011-06-06 12:11   ` Dmitry A. Kazakov
2011-06-06 13:32     ` Georg Bauhaus
2011-06-06 14:06       ` Dmitry A. Kazakov
2011-06-06 14:14         ` Georg Bauhaus
2011-06-07  3:19         ` Randy Brukardt
2011-06-06 18:14 ` John B. Matthews
2011-06-07 10:23   ` Martin
2011-06-07 16:57     ` John B. Matthews
2011-06-07 17:22     ` Robert A Duff
2011-06-07 17:55       ` John B. Matthews
2011-06-08  0:26         ` Robert A Duff
2011-06-08  7:38         ` Egil Høvik
2011-06-08  9:27           ` Martin
2011-06-08 12:04             ` Egil Høvik
2011-06-08 18:09               ` Niklas Holsti
2011-06-09  0:46                 ` Randy Brukardt
2011-06-10  8:22                   ` Martin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox