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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!news.on-luebeck.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: example of machine generated Ada ? Date: Fri, 4 Oct 2013 21:49:15 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <87fee75d-04d9-49bb-8cb2-4c5ea7f98cdf@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1380941357 22117 69.95.181.76 (5 Oct 2013 02:49:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 5 Oct 2013 02:49:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:183594 Date: 2013-10-04T21:49:15-05:00 List-Id: "Simon Wright" wrote in message news:lyr4c2ud2k.fsf@pushface.org... > Patrick writes: > >> I am just daydreaming about generating Ada from another language. >> >> Several languages use C as an intermediate language but hand written C >> is hard to read and machine generated is even more painful. Ada might >> make for reliable, readable machine generated code. > > It depends on the aims of the person/organisation that develops the code > generator. My aims in ColdFrame[1], which amongst other things generates > package specs that users might need to look at, included that the > generated code should look as if it had been written by a human - and > should compile without warnings, especially style warnings. I see that I > actually suppress style warnings, but as I recall this was only because > users insisted on using very long names and in consequence I couldn't > avoid long lines. Perhaps I should revisit this now that GNAT allows > finer control? - no, it only allows you to switch particular style > checks off for specific entities, the non-specific form only allows > adding checks. > > [1] https://sourceforge.net/projects/coldframe/ The Claw GUI builder had similar goals for the generated code. It looks pretty similar to the code I would have written by hand (partially because that's how it came to be, I wrote the generator to write code similar to the known working examples). http://www.rrsoftware.com/html/prodinf/claw/claw.htm OTOH, if you have an abstraction inversion (say, taking compiler intermediate code and turning it into Ada), you're probably not going to get very understandable Ada. So it obviously depends on the generator and the goals. Randy.