comp.lang.ada
 help / color / mirror / Atom feed
From: "1.AAC0832" <z24ba7.net>
Subject: Re: Help with designing data structure for novice Ada programmer
Date: Fri, 14 Jan 2022 00:01:22 -0500	[thread overview]
Message-ID: <a4WdnVvY4Zs-nnz8nZ2dnUU7-WfNnZ2d@earthlink.com> (raw)
In-Reply-To: <87sftx1vpd.fsf@nightsong.com>

On 1/8/22 9:36 PM, Paul Rubin wrote:
> Aleksy Grabowski <hurufu@gmail.com> writes:
>> I'm experienced embedded C developer and I've started 2 years ago an
>> implementation of one of the specifications kind of popular in the
>> payment industry. I also hope to make it open source one day.
> 
> Can you say what specification it is?
> 
>> have to guarantee consistency of a huge configurable data structure,
>> that can be changed by an entity which in theory may not be in my
>> control. And adding all checks quickly became nightmarish and then I've
>> found an Ada language.
> 
> It sounds like you waht to define a datatype for this structure, with
> access and update procedures (OOP is not necessary but it's the same
> idea) that make sure all the rules are followed.  Is there more to it
> than that?
> 
> Ada sounds like a reasonable choice, C sounds terrible, other
> possibilities depend on the hardware and software environment.  Would
> this have to run on a smart card cpu or anything like that?

   Having just implemented a small app using interlinked
   doubly-linked lists that are allocated on demand, Ada
   can do at least that much quite easily and cleanly without
   any OOP BS. "Records"/"Structs" are much as in Pascal,
   but they don't call pointers "pointers"  :-)

   You DO have to bring in a special proc to FREE memory allocated
   on the heap however. Kinda weird - you'd think making and freeing
   would naturally be implemented together. This "free()" is very
   type-specific, multiple incarnation of the proc will be needed
   if you have multiple kinds of records to free.

   The other (extensive) requirements ... I'll leave that to the
   more experienced.

   (am I off one level here ?)

  parent reply	other threads:[~2022-01-14  5:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08 20:41 Help with designing data structure for novice Ada programmer Aleksy Grabowski
2022-01-09  2:36 ` Paul Rubin
2022-01-09  9:49   ` Aleksy Grabowski
2022-01-09 10:10     ` Dmitry A. Kazakov
2022-01-14  5:01   ` 1.AAC0832 [this message]
2022-01-14 16:05     ` Dennis Lee Bieber
2022-01-14 17:40       ` Dmitry A. Kazakov
replies disabled

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