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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: An optimizing compiler idea Date: Fri, 04 Jul 2014 19:55:25 +0300 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: BISA/P8IHJbAM3ms471zeQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:187360 Date: 2014-07-04T19:55:25+03:00 List-Id: 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