:: Re: [DNG] ADA
Forside
Slet denne besked
Besvar denne besked
Skribent: Didier Kryn
Dato:  
Til: dng
Emne: Re: [DNG] ADA
Le 17/08/2024 à 15:32, Hendrik Boom a écrit :
> On Sat, Aug 17, 2024 at 11:24:09AM +0200, Didier Kryn wrote:
>> Le 14/08/2024 à 08:26, Steve Litt a écrit :
>>> It's really too bad about Ada. Because (at least in the US) it was a
>>> big iron, defense project only, almost impossible to get into the game
>>> type language in its heyday, it never got traction with the masses.
>>>
>>> And in an era of simple languages like Pascal, C, Dbase and the like,
>>> no college was going to teach Ada, especially when the majority of the
>>> students would get Ada jobs. Good luck getting an Ada job if you
>>> couldn't get a security clearance. Or if you didn't want to be part of
>>> the war machine.
>>>
>>> It's really too bad.
>>
>>     You know the story: Ada was a submission to a public call from the US
>> army.
> I was tangentially related to that project as a participant in IFIP
> Working 2.4 on systems languages. Many of its members were or worked
> contractos to the ADA projet, so it came under regular discussion.
>
> I remember a long session in which I explained to the army men just what
> would be involved if they were to have secure pointers in their language,
> but without garbage collection. At that time they decided to eave them out.
> I gather that sometime later something like pointers was accepted into
> ADA, but I am not aware of he details.


    Pointers exist, maybe to interface with other languages like C, but
also to help writing memory allocators and to access kernel buffers.
There is a dedicated "package" providing functions to convert pointers
to Ada references and vice-versa. You can't do it without "with"ing this
package, and this is a strong warning that you are doing something
border-line. Normally you would encapsulate pointer handling in
dedicated functions, routines or objects which show a safer and higher
level API to the rest of the program. AFAIR converting a pointer to an
Ada refercnce is non-trivial because, internally, most Ada references
not only bear a pointer, but also a size.

--     Didier