From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 13 Jan 2022 23:01:23 -0600 Subject: Re: Help with designing data structure for novice Ada programmer Newsgroups: comp.lang.ada References: <87sftx1vpd.fsf@nightsong.com> From: "1.AAC0832" Date: Fri, 14 Jan 2022 00:01:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <87sftx1vpd.fsf@nightsong.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-ID: X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 98.77.165.67 X-Trace: sv3-bKomZe38kI5gcIZxdyL44Dlb8GFE7JyxeV7MTsVl20tiaEvB5VdyZrvHew6srOcG05f5bSWcJsZNwfo!kldBUjGLUdBMyLKUxPEYKbq/U0vXD8N8aaHZJB1Xm4Ax4VqgueaRLY7rxUAEtdYiAXYixRtFE5xI!rmXRajqso9plgtDsaRE= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2955 Xref: reader02.eternal-september.org comp.lang.ada:63371 List-Id: On 1/8/22 9:36 PM, Paul Rubin wrote: > Aleksy Grabowski 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 ?)