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 X-Received: by 2002:a24:ac58:: with SMTP id m24mr9726585iti.65.1558538648697; Wed, 22 May 2019 08:24:08 -0700 (PDT) X-Received: by 2002:aca:5ed7:: with SMTP id s206mr7320297oib.122.1558538648417; Wed, 22 May 2019 08:24:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!c92no8789itd.0!news-out.google.com!p73ni34itp.0!nntp.google.com!c92no8787itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 22 May 2019 08:24:08 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.2.29; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.29 References: <100ad407-090e-4316-9746-a4469568b53e@googlegroups.com> <477352cf-80d0-458c-b64a-4605557fef8f@googlegroups.com> <36cf3be3-0ab0-48d4-bffa-e49c624e73ff@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <430790a7-7d0b-4812-b40a-d781cd1dd62d@googlegroups.com> Subject: Re: Ada to Ada Translator ? From: Shark8 Injection-Date: Wed, 22 May 2019 15:24:08 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56369 Date: 2019-05-22T08:24:08-07:00 List-Id: On Wednesday, May 22, 2019 at 6:57:05 AM UTC-6, foo wong wrote: > Unfortunately, this seems like a typical thread here. Lots of bickering a= nd a lot theory. Very little co-operation or offers to join in to help. Yes, this is indeed the case in a lot of these discussions, even when the t= opic is interesting =E2=80=94 and one of the reasons I want to do Byron [MI= T licensed] is to just get the hell away from all the GPL bullcrap that's s= o unproductive. Another reason is to have a free compiler with no entanglements with C. I d= on't want dependency on clib or anything else for the compiler... that just= seems utterly counterproductive from either the security or correctness/pr= ovability standpoints. > First and foremost, I wanted to bring an idea to the Ada community that m= ight help others. I have very little time to program and I would love it if= Ada was not tied so tightly to a company that is not helping it to succeed= . I completely understand, and agree with you here =E2=80=94 while AdaCore do= es a lot, it's rather obvious that they aren't interested in moving/marketi= ng Ada outside fairly restricted niches, and I suspect that having alternat= e & affordable alternatives to GNAT would go a long way to break that menta= lity. For Ada/Ada translation, perhaps the most interesting would be some manner = of back-porting the new features to old Ada =E2=80=94 I imagine being able = to compile your Ada2020 down to Ada83 (say for DEC's Ada compiler) would be= a *huge* boon to the community =E2=80=94 the real question here would be h= ow to integrate the new-features into the generated-code and there are thre= e realizations that I can envision off the top of my head. (1) Generate lib= rary/object code + the spec-files to interface with them; (2) Fully generat= e the execution-code, including things like predicate-checks, explicitly; a= nd (3) Generate the files, but reducing the explicit execution-code as much= as possible into a library that is either externally linked or explicit ma= chine-code insertions. > There are so many brilliant people here, if you guys worked together, Ada= would not have to be in this state. Randy's posts are helpful in that now = I know that Yacc/Flex is enough to build a compiler and I am not even propo= sing a compiler but rather an Ada to Ada source translator. To have as useful a translator as possible your proposed translator would h= ave to understand the underlying semantics of the GNAT extensions and the e= quivalent in standard-Ada, which might not exist, and so would have to have= something similar to the above conceptual Ada2020-to-Ada83 compiler. > All libraries are written in Ada. Just to stick with the topic I brought = up earlier, if nested subprograms were translated into more primitive Ada c= ode, then the translator would translate any library code. The only grammar= that is required is for core Ada. What is the use-case of the "nested subprograms" example? I just don't get = it... plus, capturing the context of those subprograms might be a bit more = complex than you're thinking: if they use local variables, the the realizat= ion might be better as a GENERIC subprogram with those very objects as form= al parameters. > Also I would like to mention that the worst thing that Adacore is doing i= s withholding new targets. They bought up Ada vendors that had support for = various targets but they did not merge this into GNAT FSF. Now there is sup= port for ARM but there could have been long ago but the ARM support is comi= ng with strings attached. Second-worst; the elimination of DOTNET and JVM targets is really irksome. = (And it seems like the long-shot of getting MS to make an Ada-implementatio= n for DOTNET is actually more likely than AdaCore updating their DOTNET imp= lementation.) > I am going to receive a severe mailing list beating for saying this but i= t seems to me that Adacore has lead FLOSS Ada to a point where it is a fish= out of water. Why would you get a beating for this? It's fairly obvious: there are tons of other languages, even those with cor= porate sponsors [eg Go, Rust], that don't beat the GPL licensing horse. =E2= =80=94 There are languages that *don't* stir up fear, uncertainty, and doub= t with potentially expensive legal processes and thus drive away small/medi= um businesses. > It's great that it is being used for games and web servers and such but A= da has gills and fins, it's supposed to be in the water. >=20 > This is not what it was designed to do. It's supposed to be used to contr= ol missiles and tanks and could be used for non-military purposes as spin-o= ff. Ada 95 added OO and there there is a ton of stuff like interfaces and w= hatnot but is any of this needed to fire off a tank shell or missile? Ada was designed for this, yes; but it was *ALSO* designed to be a GENERAL = PURPOSE programming language to replace the literally HUNDREDS of languages= being used by the DOD. =E2=80=94 It did so, reducing the number of languag= es in-use by an order of magnitude. > Where is the target support! >=20 > I personally don't want to create weapons rather scientific instruments. I'm involved in Astronomy right now, Ada is perfectly suitable for the task= s here; in fact, a *LOT* of complexity could be reduced if we were to have = a single, distributed Ada program doing all of our command-and-control as w= ell as data-production. =E2=80=94 We could probably reduce the 25-30 comput= ers in-use for data-acquisition/operations to perhaps 8, have a single code= -base, and more assurance with respect to scheduling, maintenance, data-cor= rectness, and implementation-correctness. > Based on this website: > https://wiki.osdev.org/Ada_Bare_bones >=20 > These are the parts that the translator would need to translate into more= primitive Ada code: >=20 > """ >=20 > pragma Discard_Names; > pragma Restrictions (No_Enumeration_Maps); > pragma Normalize_Scalars; > pragma Restrictions (No_Exception_Propagation); > pragma Restrictions (No_Finalization); > pragma Restrictions (No_Tasking); > pragma Restrictions (No_Protected_Types); > pragma Restrictions (No_Delay); > pragma Restrictions (No_Recursion); > pragma Restrictions (No_Allocators); > pragma Restrictions (No_Dispatch); > pragma Restrictions (No_Implicit_Dynamic_Code); > pragma Restrictions (No_Secondary_Stack); > """ >=20 > but even some of these could be skipped over. If I am the one that ends u= p doing this, I will only be focused on hardware embedded Ada and I will fo= cus on new targets and not every last corner-case feature ?? Forgive me, but I don't see how these restriction pragmas dovetail into an = Ada-Ada translator... at all. Could you explain how you see them doing so?