From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How can I get this data into the .data section of the binary? Date: Tue, 16 Jun 2020 18:11:04 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:59101 List-Id: On 16/06/2020 17:43, Luke A. Guest wrote: > On 16/06/2020 16:21, Dmitry A. Kazakov wrote: >> On 16/06/2020 16:42, Luke A. Guest wrote: >>> On 16/06/2020 15:25, Dmitry A. Kazakov wrote: >>>> On 16/06/2020 16:14, Niklas Holsti wrote: >>> >>>>> I have no idea if this will help you -- the types in our case were >>>>> much simpler -- but you might try it with a small subset of your >>>>> package: >>>>> >>>>>      Pixel_Format_Unknown     : constant Pixel_Format_Names := >>>>>        (True, (NUL, NUL, NUL, NUL)); >>>>> >>>>> (assuming "use Ada.Characters.Latin_1"). >>>> >>>> That is interesting. Was there the "others =>" part? >>>> >>>> I can imagine that with "others => NUL" a static zeroed section were >>>> used with other parts written upon it during start. >>>> >>>> P.S. I hope more people now see why compile-time subprograms are >>>> necessary. >>>> >>> >>> I don't think Ada needs compile-time subprograms, it just needs to >>> recognise actual static data which can be generated at compile time, >> >> Without calling subprograms? That is not possible in 99% of use cases. > > Course it is. The compiler will translate the code into data. Consider an array filled with Fibonacci numbers or a parser's tokens table or a constant instance of Ada.Containers.Vectors. It is a big issue for small embedded systems with instant booting time requirement. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de