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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!feeder2.usenet.farm!2.eu.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!cyclone02.ams2.highwinds-media.com!voer-me.highwinds-media.com!peer02.am1!peering.am1!peer02.fr7!news.highwinds-media.com!post02.fr7!fx33.am4.POSTED!not-for-mail Subject: Re: Make A Lisp .. in Ada Newsgroups: comp.lang.ada References: From: Chris Moore User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 82.17.208.105 X-Complaints-To: http://netreport.virginmedia.com X-Trace: 1458945815 82.17.208.105 (Fri, 25 Mar 2016 22:43:35 UTC) NNTP-Posting-Date: Fri, 25 Mar 2016 22:43:35 UTC Organization: virginmedia.com Date: Fri, 25 Mar 2016 22:43:54 +0000 X-Received-Body-CRC: 3145835977 X-Received-Bytes: 2614 Xref: news.eternal-september.org comp.lang.ada:29889 Date: 2016-03-25T22:43:54+00:00 List-Id: On 25/03/2016 21:37, Shark8 wrote: > On Friday, March 25, 2016 at 2:33:15 PM UTC-6, Chris Moore wrote: >> Hi, >> >> There was a post on Hacker News (#1) just over a year ago about Make A >> Lisp (#2). They had implementations in many languages but not for Ada >> so I've made one (#3 on branch ada). >> >> I'm pretty close to getting it accepted (put in the pull request today). >> It's slower than the C and C++ implementations. Seems to spend a lot >> of time finalizing the smart pointer according to gprof. >> >> Chris M Moore >> >> Refs: >> 1) https://news.ycombinator.com/item?id=9121448 >> 2) https://github.com/kanaka/mal >> 3) https://github.com/zmower/mal/tree/ada > > Nifty. > Did you happen to see my Ada 2012 tutorial which was making a LISP? -- I've been told one of the nice things about it is that it internally uses an ARRAY, rather than a linked-list for lists. > https://github.com/OneWingedShark/Ada_Tutorial > No. I hadn't seen it. I do use a indefinite array in Types.Make_New_List but otherwise its smart_pointers all the way down, including the list nodes. It made managing the objects easier but I seem to have paid a price. It does work correctly though, including the self-hosting tests. There's an equivalent to the final stepa_mal.adb phase that doesn't use the eval_callback at https://dl.dropboxusercontent.com/u/638983/malia.tar.gz for those of you who just want a quick play. Source code only. Haven't tried it on windows or other compilers but I think I've missed out gnat=isms and 2012 features... Happy Easter! Chris