comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Reading the while standard input into a String
Date: Tue, 7 Jun 2011 10:51:53 +0200
Date: 2011-06-07T10:51:53+02:00	[thread overview]
Message-ID: <19opieyek0qat.1139e23ejh9en$.dlg@40tude.net> (raw)
In-Reply-To: 1142c50a-bf12-4aed-984c-70ba818b4372@dn9g2000vbb.googlegroups.com

On Tue, 7 Jun 2011 00:32:15 -0700 (PDT), Maciej Sobczak wrote:

> 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.

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



  reply	other threads:[~2011-06-07  8:51 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
2011-06-07  8:51             ` Dmitry A. Kazakov [this message]
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