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!feeder.eternal-september.org!aioe.org!.POSTED.5toSSCP5H8WhQPVIfFrwuA.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Script-like jobs in Ada (ideas for HAC) Date: Fri, 1 May 2020 09:51:25 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <9a4ad55c-ef0d-42ab-a438-cabc71a491a6@googlegroups.com> <34a44b75-02ca-43bc-b5cf-04a0a758db88@googlegroups.com> NNTP-Posting-Host: 5toSSCP5H8WhQPVIfFrwuA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58537 Date: 2020-05-01T09:51:25+02:00 List-Id: On 2020-05-01 09:31, gautier_niouzes@hotmail.com wrote: > On Thursday, April 30, 2020 at 10:44:22 AM UTC+2, Dmitry A. Kazakov wrote: > >> 1. Where are the modules? It should be possible to write a module for >> the script e.g. a package that has functions and procedures, which call >> to Ada implementations. I.e. calling Ada from the script. > > On the to-do list :-) > >> 2. What about exceptions handling, the ones propagating out of the >> script into the Ada caller? > > Same, but this is a lower-hanging fruit: the VM has error states that could be grouped into an exception_raised state, which would trigger the expected behaviour (with an exception identity and message). If the exception is not handled from the VM, the VM interpreter would raise Unhandled_HAC_Exception with a message. > >> 3. Aborting the script. Ideally the Interpret_on_Current_IO you >> mentioned must be abortable per some event set via protected object, for >> example. E.g. from another task provided Interpret_on_Current_IO runs on >> the caller's context. The interpreter will look for the event >> periodically and propagate exception Canceled_Error if the event is set. > > I add this to the to-do list right now, thanks! With these changes I would consider integrating it into here: http://www.dmitry-kazakov.de/ada/max_home_automation.htm#5 I presume you have an equivalent of Unbounded_String, records and arrays of. That should make it. Is https://sourceforge.net/projects/hacadacompiler/ the major source where you publish updates? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de