comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Building the 2021 source release of GnatStudio
Date: Sat, 31 Jul 2021 14:29:04 +0200	[thread overview]
Message-ID: <se3fmf$4f4$1@gioia.aioe.org> (raw)
In-Reply-To: se3dtd$sb0$1@dont-email.me

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

  reply	other threads:[~2021-07-31 12:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  9:25 Building the 2021 source release of GnatStudio Rod Kay
2021-07-28 10:49 ` Emmanuel Briot
2021-07-28 14:29   ` Simon Wright
2021-07-29 10:29   ` Rod Kay
2021-07-29  0:49 ` Randy Brukardt
2021-07-29  7:49   ` Luke A. Guest
2021-07-29  8:41     ` Dmitry A. Kazakov
2021-07-29 11:33       ` Stéphane Rivière
2021-07-29 11:58         ` Dmitry A. Kazakov
2021-07-30 11:29           ` Stéphane Rivière
2021-07-30 11:51             ` Emmanuel Briot
2021-07-30 16:59               ` Shark8
2021-07-30 17:07               ` Simon Wright
2021-07-31  9:37               ` Stéphane Rivière
2021-07-31 10:30             ` Dmitry A. Kazakov
2021-07-31 11:58               ` Stéphane Rivière
2021-07-31 12:29                 ` Dmitry A. Kazakov [this message]
2021-08-03  1:05                   ` Shark8
2021-08-03  6:30                     ` Dmitry A. Kazakov
2021-08-03  7:20                   ` Stéphane Rivière
2021-08-28  0:08                     ` Roger Mc
2021-07-30  0:21     ` Randy Brukardt
2021-07-29 10:37   ` Rod Kay
2021-07-29 14:37     ` J-P. Rosen
2021-07-29 17:43       ` Shark8
2021-07-29 17:23   ` Shark8
2021-07-29  1:09 ` Roger Mc
2021-07-29 10:47   ` Rod Kay
2021-08-27  9:58     ` Blady
2021-08-28  0:10       ` Roger Mc
2021-08-28  6:40         ` Jeffrey R. Carter
2021-08-28  7:16           ` Roger Mc
2021-08-28  7:21             ` Simon Wright
2021-08-28  9:14             ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox