comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: An optimizing compiler idea
Date: Fri, 04 Jul 2014 19:55:25 +0300
Date: 2014-07-04T19:55:25+03:00	[thread overview]
Message-ID: <lp6m9q$lu0$1@speranza.aioe.org> (raw)

In this post I ask whether my idea is not new and already implemented. And 
also I suggest to implement it in Ada compilers.

I propose not to store an array bound if it is constant (1 in the example 
below).

This can be used to create container types which could be more efficient 
than plain arrays.

Below is a toy container type giving an example of my idea:

package Test is

   type Test_Array_Type is array(Integer range <>) of Float;
   
   type Test_Record(Size: Integer) is
      record
         Test_Array: Test_Array_Type(1..Size);
      end record;

end;

In this example we can store only one (upper) index of an array. Thus it 
could be faster and more memory efficient than plain array with a range of 
two indexes.

-- 
Victor Porton - http://portonvictor.org


             reply	other threads:[~2014-07-04 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 16:55 Victor Porton [this message]
2014-07-04 22:26 ` An optimizing compiler idea anon
replies disabled

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