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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!N/bBT90+fJ5f2hH/+d3Lnw.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Building the 2021 source release of GnatStudio Date: Sat, 31 Jul 2021 14:29:04 +0200 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gioia.aioe.org; logging-data="4580"; posting-host="N/bBT90+fJ5f2hH/+d3Lnw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:62466 List-Id: On 2021-07-31 13:58, Stéphane Rivière wrote: >> The HAC script must take Argument, call Square (accessible via the >> module), return the result of Square (Argument). > > API HAC has Argument, Argument_Count and Set_Exit_Status, and the result > can be piped. Whatever, you could post a complete example, when ready (:-)). E.g. here is a lesser sample in Julia, an Ada subprogram is called from Julia back when Julia is called from Ada: ---------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C; use Interfaces.C; with Julia; use Julia; procedure Ada_Call is Bin : constant String := "D:\Julia-1.2.0\bin"; begin Load (Bin & "\libjulia.dll"); -- Load library Init_With_Image (Bin); -- Initialize environment declare function Increment (X : Double) return Double; pragma Convention (C, Increment); function Increment (X : Double) return Double is begin return X + 1.0; end Increment; begin Eval_String ( "println(ccall(" & CCall_Address (Increment'Address) & ",Cdouble,(Cdouble,),10.0))" ); end; AtExit_Hook; -- Finalize environment end Ada_Call; Note, there is only one process! ----------------------------------------------------------- > However, I do not state HAC is production ready for GNATStudio... But > HAC is well written and easily hackable (I speak for Gautier ;) That is not the point. The point is that AFAIK it cannot be used for scripting unless examples as above provided. >> What AdaCore *must* do is to remove static linking to Python. The GPS >> user should choose the script language per preferences that would look >> for the corresponding script run-time e.g. Python or HAC or whatever. > > Freedom choice. I agree. But I guess Adacore ressources are limited and > this is like reinventing the wheel. It is a minimal requirement to replace static linking with dynamic. Moreover, whatever resources AdaCore has it does not make any sense to call internal GPS functions implemented in Ada from Ada code via Python scripts! So, no work involved. > The biggest complaint I had about GNATStudio was its instability. I > think that Adacore has made great progress now. It's now a pleasure to > work with. Yes, but each new version of GTK can change that. GTK is unstable on both Windows and Linux, it is just as it is. AdaCore can at best work around GTK bugs. Though Python is 100% self-inflicted damage. AdaCore could easily implement some Ada script, again, not to confuse with shell. They did it partially with GPR. The GPR compiler could be extended to support a larger variety of expressions. Customers wanting Python will use Eclipse instead of GPS anyway, so that is not an argument either. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de