comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada standard and maximum line lengths
Date: Fri, 1 Feb 2013 17:13:48 -0600
Date: 2013-02-01T17:13:48-06:00	[thread overview]
Message-ID: <kehi7k$doe$1@munin.nbi.dk> (raw)
In-Reply-To: an1fdkFjimtU1@mid.individual.net

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message 
news:an1fdkFjimtU1@mid.individual.net...
> On 13-02-01 01:54 , Randy Brukardt wrote:
>> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
>> news:wccwquucd1x.fsf@shell01.TheWorld.com...
...
>>> There are various ways to store line/column numbers compactly without
>>> limiting line lengths.
>>
>> Really? Do tell! I know of no such technique that still would be usable
>> (meaning does not involve indirection, which would add complication and
>> fragmentation issues, and can be used at any time without calculation,
>> because you don't know ahead of time when and where you'll need to 
>> generate
>> error messages, debugging information, and traces).
>
> I'm not sure that I understand your conditions on what is "usable", but
> the LEB128 encoding (little-endian base 128) used in DWARF works pretty
> well for storing unbounded but usually small integers without wasting a
> lot of space. An integer is encoded as a sequence of octets, with one
> end-marker bit and 7 significand bits in each octet. Numbers from 0 to
> 127 take one octet, number from 128 to 2**14 - 1 take two octets, and so 
> on.

Thanks, sort of. That would work in the stream of tokens representation, but 
it wouldn't work in the symbol table, debugging information, intermediate 
code, and the like. As I noted, we use strong typing by having a Line_Number 
and Line_Position type, and it's preferable to use those types everywhere. A 
variable-length format would work fine in a stream, but it wouldn't work in 
the various records (you'd have to allocate space for the largest 
representation, and then why have all of the complication?)

Also note that the symbol table records are written in and out (that's how 
we implement "with"), so increasing the size would have an impact on the 
compilation speed.

I could see reasons for giving more bits to these things (in particular, a 
representation using 22-bits for the line number and 10-bits for the 
position would add only a little bit more space but effectively remove the 
limits), but I don't see any way to truely eliminate the limits. (Making the 
line number 32-bits and position 16-bits would increase the I/O requirements 
of the compiler by around 5%; that would probably only be noticable in large 
compilations or via a stopwatch but it surely is not "free".)

In any case, there is a disincentive to make any changes so long as the 
ACATS insists on having a line length and identifier length being the same 
and thus relatively short. And it would be hard to justify rewriting those 
ACATS tests (they're among the least important tests, but not so much that 
they have so little value that removing them outright could be considered). 
Dan Eilers had the best suggestion, which was to convert the tests to tests 
that 200 character identifiers are properly supported (all compilers have to 
support those), but that would also be the most work. Such work would be 
better spent on tests for Ada 2005 and Ada 2012 features, I think.

                                       Randy.





  reply	other threads:[~2013-02-01 23:13 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28  5:02 Ada standard and maximum line lengths Lucretia
2013-01-28  6:01 ` J-P. Rosen
2013-01-28  6:28 ` Jeffrey Carter
2013-01-28  8:05   ` Niklas Holsti
2013-01-28 16:42     ` Jeffrey Carter
2013-01-28 20:22       ` Niklas Holsti
2013-01-28 20:46         ` J-P. Rosen
2013-01-28 21:29           ` Niklas Holsti
2013-01-29  1:42             ` Randy Brukardt
2013-01-29  6:15             ` J-P. Rosen
2013-01-29 10:25               ` Niklas Holsti
2013-01-29 11:31                 ` Georg Bauhaus
2013-01-29 12:11                   ` Simon Wright
2013-01-29 12:31                   ` Niklas Holsti
2013-01-29 12:37                     ` Niklas Holsti
2013-01-29 15:29                     ` Georg Bauhaus
2013-01-29 16:58                       ` Niklas Holsti
2013-01-29 17:51                         ` Georg Bauhaus
2013-01-29 18:18                           ` Shark8
2013-01-29 19:54                           ` Niklas Holsti
2013-01-29 23:12                             ` Georg Bauhaus
2013-01-30  9:18                               ` Niklas Holsti
2013-01-30  9:51                                 ` Simon Wright
2013-01-30 15:28                                 ` Robert A Duff
2013-01-30 23:24                                   ` Randy Brukardt
2013-01-31  2:16                                     ` Robert A Duff
2013-01-31  9:10                                       ` Stefan.Lucks
2013-01-31  9:30                                         ` Niklas Holsti
2013-01-31  9:51                                           ` Simon Wright
2013-01-31 10:56                                           ` Georg Bauhaus
2013-01-31 18:02                                         ` Jeffrey Carter
2013-01-31 23:54                                       ` Randy Brukardt
2013-02-01  9:15                                         ` Niklas Holsti
2013-02-01 23:13                                           ` Randy Brukardt [this message]
2013-02-02  1:24                                             ` Lucretia
2013-02-02 14:12                                               ` Robert A Duff
2013-02-05  2:09                                               ` Randy Brukardt
2013-01-31  9:03                                   ` Dmitry A. Kazakov
2013-01-30  9:37                               ` Simon Wright
2013-01-30 12:02                                 ` Georg Bauhaus
2013-01-29 23:47                             ` Jeffrey Carter
2013-01-30  7:24                               ` Niklas Holsti
2013-01-30 10:09                                 ` J-P. Rosen
2013-01-29 20:36                 ` Niklas Holsti
2013-01-29 21:01                   ` Robert A Duff
2013-01-29 21:14                   ` Dmitry A. Kazakov
2013-01-28  8:18 ` Dmitry A. Kazakov
2013-01-28 10:02   ` Maciej Sobczak
2013-01-28 11:57     ` Georg Bauhaus
2013-01-28 13:28       ` Niklas Holsti
2013-01-28 15:14       ` J-P. Rosen
2013-01-28 16:13       ` Dmitry A. Kazakov
2013-01-28 15:13     ` Dmitry A. Kazakov
2013-01-28 13:49 ` Robert A Duff
2013-01-29  2:09   ` Randy Brukardt
2013-01-29 18:46 ` Lucretia
2013-01-29 20:53   ` Robert A Duff
2013-01-29 21:22   ` Dmitry A. Kazakov
2013-01-30  3:22     ` Lucretia
2013-01-30  9:49       ` Dmitry A. Kazakov
2013-01-30 23:28         ` Randy Brukardt
2013-02-01  1:48       ` Shark8
2013-01-29 21:29   ` Dmitry A. Kazakov
2013-01-29 21:53   ` Adam Beneschan
replies disabled

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