• Re: A new universe of Ada

    From Dmitry A. Kazakov@21:1/5 to Rick Duley on Mon Sep 26 08:45:11 2022
    On 2022-09-26 08:20, Rick Duley wrote:

    I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable
    values as I go seems to have vanished.

    That concept is called debugger. GDB for GCC (GNAT Ada is based in GDB).
    GDB never ever really worked except for little exercises. It still does
    not. So, forget about it.

    In short, I am lost and I can't find any material to help me find my way.

    The project file is 3-liner:
    ----------------hello_world.gpr----->
    project Hello_World is
    for Main use ("hello_world.adb");
    end Hello_World;
    <------------------------------------

    No, you do not need main to be Main:

    ---hello_world.adb----------------->
    with Ada.Text_IO; use Ada.Text_IO;
    procedure Hello_World is
    begin
    Put_Line ("Hello world!");
    end Hello_World;
    <----------------------------------

    You still can compile and build without projects. But projects are much
    more comfortable.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to All on Sun Sep 25 23:20:04 2022
    I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do
    anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have
    vanished. In short, I am lost and I can't find any material to help me find my way.

    I'd appreciate some help. Perhaps there is a forum I cannot find for beginner Ada programmers. Perhaps there is a tutorial or a text I can download. Everything I can find is written for people with CS Degrees that are not 30 years old and who already
    know everything about this new world. What I really need, I think, is _*Ada Programming in Gnat Studio for Dummies*_. 😖

    Can someone help?
    Thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to Dmitry A. Kazakov on Mon Sep 26 00:00:13 2022
    On Monday, September 26, 2022 at 2:45:16 PM UTC+8, Dmitry A. Kazakov wrote:
    On 2022-09-26 08:20, Rick Duley wrote:

    I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable
    values as I go seems to have vanished.
    That concept is called debugger. GDB for GCC (GNAT Ada is based in GDB).
    GDB never ever really worked except for little exercises. It still does
    not. So, forget about it.
    In short, I am lost and I can't find any material to help me find my way.
    The project file is 3-liner:
    ----------------hello_world.gpr----->
    project Hello_World is
    for Main use ("hello_world.adb");
    end Hello_World;
    <------------------------------------

    No, you do not need main to be Main:

    ---hello_world.adb----------------->
    with Ada.Text_IO; use Ada.Text_IO;
    procedure Hello_World is
    begin
    Put_Line ("Hello world!");
    end Hello_World;
    <----------------------------------

    You still can compile and build without projects. But projects are much
    more comfortable.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to All on Mon Sep 26 00:11:33 2022
    You missed the point, Dmitry. Showing me the code for Hello_World does not show me how to create the program using Gnat Studio.

    Firstly, I do not understand the concept of a _Project_. Until a couple of days ago I had never heard the term in reference to Ada Programming. Everyone seems to assume that I know what it means, but I don't.

    Secondly, I can write Hello_World.adb and have it included in my 'Project', I can even build it, but the only thing that will run is _Main_. I cannot find any documentation about Studio which explains something as simple as the creation of Hello_World.
    exe. Can you do that in Studio or is it purely ornamental?

    Thirdly, I was never a good enough programmer to be able to write programs without bugs. Perhaps you have reached that exalted stage but I certainly have not. Therefore I have a need to debug. How do I do that?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Simon Wright on Mon Sep 26 09:45:41 2022
    On 2022-09-26 09:27, Simon Wright wrote:
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    That concept is called debugger. GDB for GCC (GNAT Ada is based in
    GDB). GDB never ever really worked except for little exercises. It
    still does not. So, forget about it.

    Until you get to programs with a lot of tasking and/or interrupts, most
    are "little exercises". Do not forget about using a debugger (and, realistically, GDB is it for GNAT).

    Not only tasking. Usually if you have several dependent projects things
    stop working in GDB. In my case it is basically always.

    P.S. Even addr2line does not always work in presence of dynamic
    libraries etc.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to All on Mon Sep 26 01:04:59 2022
    Okay - you can use GDB within Studio. Great, but first I have to write a program.

    Please ...

    Assume: I am an Elementary School kid brought up by his Grandparents who are still struggling to control an abacus. Assume I know absolutely nothing at all about programming. Assume that I do not speak Geek! Assume that there is access to a PC with
    Gnat Studio installed.

    Now: Teach me how to write "Hello_World" using Studio from scratch right up to where I have 'hello_world.exe' and can run it. That'll be great! Then I'll have something to tell Grandma about. :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From G.B.@21:1/5 to Rick Duley on Mon Sep 26 09:28:59 2022
    On 26.09.22 08:20, Rick Duley wrote:
    I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do
    anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have
    vanished. In short, I am lost and I can't find any material to help me find my way.

    For debugging "normal" programs, the Studio's interface to GDB
    (GNU debugger) offers viewing current values of variables,

    https://docs.adacore.com/live/wave/gps/html/gps_ug/debugging.html#the-variables-view

    (Dmitri's comment might reflect debugging more tricky
    programs that run a number of interacting tasks and more.)

    I'd appreciate some help. Perhaps there is a forum I cannot find for beginner Ada programmers. Perhaps there is a tutorial or a text I can download. Everything I can find is written for people with CS Degrees that are not 30 years old and who
    already know everything about this new world. What I really need, I think, is _*Ada Programming in Gnat Studio for Dummies*_. 😖


    A short description of the purpose of project files,
    is found int the User's Guide, also full details:

    https://docs.adacore.com/live/wave/gps/html/gps_ug/main_window.html#the-project-view
    https://docs.adacore.com/live/wave/gps/html/gps_ug/projects.html#project-handling

    "gps" is an abbreviating name, maybe also the name
    of a directory in your installation. Look around there
    for other User's Guides and Reference Manuals (*_rm.*).
    I suspect that GPStudio has a menu or even links
    in context menus.

    A tutorial ("Let's build a small desk calculator, start here,
    do this, then ...") is found at the same WWW node.

    The command line programs of GNAT permit translating Ada source
    without project files.
    Run gnatmake, or even gcc, gnatbind, gnatlink.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Rick Duley on Mon Sep 26 09:41:12 2022
    On 2022-09-26 09:11, Rick Duley wrote:
    You missed the point, Dmitry. Showing me the code for Hello_World does not show me how to create the program using Gnat Studio.

    Hmm, programs are created by typing them in an editor...

    Firstly, I do not understand the concept of a _Project_.

    Project is an executable or shared/static library.

    Until a couple of days ago I had never heard the term in reference to Ada Programming.

    It always existed. E.g. Ada 83 Reference Manual called it "the program library". See ARM 83 (10.4)

    Secondly, I can write Hello_World.adb and have it included in my 'Project', I can even build it, but the only thing that will run is _Main_.

    No, I provided the project file where the main procedure is called
    Hello_World.

    I cannot find any documentation about Studio which explains something as simple as the creation of Hello_World.exe. Can you do that in Studio or is it purely ornamental?

    I am not sure what you mean. I think one can create a new project in GPS
    by clicking File->New Project. I never do that. I create project *files*
    using Notepad++ or GPS editor as text file.

    Thirdly, I was never a good enough programmer to be able to write programs without bugs. Perhaps you have reached that exalted stage but I certainly have not. Therefore I have a need to debug. How do I do that?

    As I said, GPS has integrated support for GDB. Theoretically you should
    be able to do visual debugging. Click Debug->Initialize in GPS. In
    practice GDB is garbage, but that has nothing to do with either Ada or GPS.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Dmitry A. Kazakov on Mon Sep 26 08:27:56 2022
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    That concept is called debugger. GDB for GCC (GNAT Ada is based in
    GDB). GDB never ever really worked except for little exercises. It
    still does not. So, forget about it.

    Until you get to programs with a lot of tasking and/or interrupts, most
    are "little exercises". Do not forget about using a debugger (and, realistically, GDB is it for GNAT).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Rick Duley on Mon Sep 26 09:17:17 2022
    Rick Duley <rickduley@gmail.com> writes:

    Firstly, I do not understand the concept of a _Project_. Until a
    couple of days ago I had never heard the term in reference to Ada Programming. Everyone seems to assume that I know what it means, but
    I don't.

    Would this help? (it's "live" documentation, so the details will be
    somewhat in advance of what your gprbuild does, but the overall concept
    will be valid)

    https://docs.adacore.com/live/wave/gprbuild/html/gprbuild_ug/gprbuild_ug/gnat_project_manager.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to Jeffrey R.Carter on Mon Sep 26 02:34:57 2022
    On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote:


    You can start GNAT Studio with a "default project". This lets you use it as an LSE.


    What is an LSE?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to All on Mon Sep 26 02:33:43 2022
    Thanks Dmitry.
    I'll get on to that in the morning.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Rick Duley on Mon Sep 26 11:16:27 2022
    On 2022-09-26 10:04, Rick Duley wrote:
    Okay - you can use GDB within Studio. Great, but first I have to write a program.

    Please ...

    Assume: I am an Elementary School kid brought up by his Grandparents who are still struggling to control an abacus. Assume I know absolutely nothing at all about programming. Assume that I do not speak Geek! Assume that there is access to a PC with
    Gnat Studio installed.

    Now: Teach me how to write "Hello_World" using Studio from scratch right up to where I have 'hello_world.exe' and can run it. That'll be great! Then I'll have something to tell Grandma about. :)

    1. Start GPS

    2. Select default project

    3. Press File->New file

    4. Type:
    project Hello_World is
    for Main use ("hello_world.adb");
    end Hello_World;

    5. File->Save as
    hello_world.gpr

    6. Press File->New file

    7. Type:
    with Ada.Text_IO; use Ada.Text_IO;
    procedure Hello_World is
    begin
    Put_Line ("Hello world!");
    end Hello_World;

    8. File->Save as
    hello_world.adb

    9. Press File->Open Project and select file hello_world.gpr


    You are done.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey R.Carter@21:1/5 to Rick Duley on Mon Sep 26 11:30:10 2022
    On 2022-09-26 08:20, Rick Duley wrote:
    I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do
    anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have
    vanished. In short, I am lost and I can't find any material to help me find my way.

    Welcome back.

    Unless your project uses multiple languages, or has a complicated build process,
    project files and gprbuild are unnecessary complications. You can use GNAT and GNAT Studio without them.

    You can start GNAT Studio with a "default project". This lets you use it as an LSE.

    You can compile and run your programs from the command line:

    $ gnatmake -O2 -fstack-check hello_world.adb
    $ ./hello_world

    (This presumes some version of Unix. On Windows the second line would omit "./")

    I have never found a debugger worth learning for well designed Ada programs, but
    you generally get an Ada-aware version of gdb along with GNAT. You have to specify extra switches to make your executable gdb friendly. You can probably debug a program with

    $ gdb hello_World

    To build, run, and debug a program from within GNAT Studio requires having a project file and understanding how GNAT Studio needs to be configured.

    --
    Jeff Carter
    "Friends don't let friends program in C++"
    Zalman Stern
    114

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey R.Carter@21:1/5 to Rick Duley on Mon Sep 26 11:37:56 2022
    On 2022-09-26 11:34, Rick Duley wrote:
    On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote:

    You can start GNAT Studio with a "default project". This lets you use it as an LSE.

    What is an LSE?

    Sorry: Language-Sensitive Editor

    --
    Jeff Carter
    "Friends don't let friends program in C++"
    Zalman Stern
    114

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Maxim Reznik@21:1/5 to All on Mon Sep 26 04:08:59 2022
    Perhaps this could help:

    GNAT Studio Tutorial

    https://docs.adacore.com/live/wave/gps/html/gps_tutorial/index.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kevin Chadwick@21:1/5 to All on Mon Sep 26 06:23:33 2022
    You might also find that the new alire way
    will easily give you what you want but maybe
    also more than you want.
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rene@21:1/5 to All on Mon Sep 26 20:12:46 2022
    Am 26.09.22 um 15:23 schrieb Kevin Chadwick:
    You might also find that the new alire way
    will easily give you what you want but maybe
    also more than you want.
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"

    Alire is the way to go especially if one wants to use libraries beyond
    what Gnat provides out of the box.

    Adding a library to a 'crate' worked nicely for me, but I had to invoke
    GNAT Studio via Alire (alr edit) to make the library available in GMAT
    Studio, invoking GNAT Studio directly did not work. So this is something
    one should be aware of.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marius Amado-Alves@21:1/5 to rick...@gmail.com on Mon Sep 26 12:44:01 2022
    On Monday, 26 September 2022 at 07:20:06 UTC+1, rick...@gmail.com wrote:
    I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse...

    Welcome back, Rick!
    Dont despair. You'll find Ada has aged well, the language as the compilers. Unfortunately, all language technologies today involve extra configuration grunt work.
    Fortunately for us Adaists, GNAT configuration is easy and reliable compared to, say, Java or Python (Anaconda).
    Just follow the tutorial.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to Dmitry A. Kazakov on Mon Sep 26 19:35:39 2022
    On Monday, September 26, 2022 at 5:16:35 PM UTC+8, Dmitry A. Kazakov wrote:
    1. Start GPS

    2. Select default project


    Thanks for that set of instructions.
    Grandma is very pleased for me although she does not yet know much about what is happening.


    For myself, I have two more questions:
    1. Do I have to create a new project for every mainline I write?
    2. My program runs in Studio but the EXE does nothing from the folder.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Rick Duley on Tue Sep 27 08:27:55 2022
    On 2022-09-27 04:35, Rick Duley wrote:

    For myself, I have two more questions:
    1. Do I have to create a new project for every mainline I write?

    You create a project for following cases:

    1. An executable like hello.exe
    2. A library like goodbye.a, goodbye.dll, goodbye.so
    3. Abstract settings and assorted sources shared by other projects

    2. My program runs in Studio but the EXE does nothing from the folder.

    It is a terminal application. You must start it from a command-line
    interpreter (cmd.exe or power shell).

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J-P. Rosen@21:1/5 to All on Tue Sep 27 08:43:59 2022
    Le 27/09/2022 à 04:35, Rick Duley a écrit :
    For myself, I have two more questions:
    1. Do I have to create a new project for every mainline I write?

    In GnatStudio, note that on top of the "project" window you have a
    little "pencil" icon. If you click on it, you open a dialog to adjust
    project parameters. There is a "main" tag that allows you to choose you
    main program (you can even have several).

    --
    J-P. Rosen
    Adalog
    2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
    Tel: +33 1 45 29 21 52
    https://www.adalog.fr

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to All on Tue Sep 27 00:44:25 2022
    Thanks folks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Mc@21:1/5 to kevc...@gmail.com on Tue Sep 27 03:10:10 2022
    On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote:
    You might also find that the new alire way
    will easily give you what you want but maybe
    also more than you want.
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"
    Following the "first-steps", progress succeeded up to gnat_native=11.2.4 installed successfully but then failure:
    dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow
    Any ideas on how to fix this:
    Thanks,
    Roger

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Mc@21:1/5 to Roger Mc on Tue Sep 27 04:40:53 2022
    On Tuesday, September 27, 2022 at 8:10:12 PM UTC+10, Roger Mc wrote:
    On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote:
    You might also find that the new alire way
    will easily give you what you want but maybe
    also more than you want.
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"
    Following the "first-steps", progress succeeded up to gnat_native=11.2.4 installed successfully but then failure:
    dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow
    Any ideas on how to fix this:
    Thanks,
    Roger

    This problem only occurs on my MacBook Air, OSX 10.13.6, Xcode 10.1
    Works OK on my Mac mini under OSX Monterey with latest Xcode

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Roger Mc on Tue Sep 27 15:10:23 2022
    Roger Mc <rogermcm2@gmail.com> writes:

    On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote:
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"
    Following the "first-steps", progress succeeded up to
    gnat_native=11.2.4 installed successfully but then failure:
    dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow
    Any ideas on how to fix this:
    Thanks,
    Roger

    I tried this on my mid-2012 Macbook Pro running 10.11.6 (El Capitan),
    the problem arises when running gprconfig (all the Alire-provided
    releases were built against a later Xcode (Google suggests 11.4 or
    later??) which does provide this symbol). I dare say it'd happen running
    the compiler too.

    Only suggestion: install one of my builds, set it on your PATH, run alr toolchain --select & choose the 'gnat_external' line for the
    compiler. Alire then chooses a compatible gprbuild.

    11.2.0 at Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native

    Or 12.1.0 from Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Bj=c3=b6rn_Lundin?=@21:1/5 to Rick Duley on Tue Sep 27 18:04:04 2022
    On 2022-09-27 04:35, Rick Duley wrote:
    For myself, I have two more questions:
    1. Do I have to create a new project for every mainline I write?

    no. depending scenarion (env-var) I build a different set of exes

    I got this i a project of mine (50+ executables)

    System_Mains := ("rpc_tracker.adb",
    ...
    ...
    "poll.adb",
    "login_handler.adb"
    );

    Stat_Mains := (
    "create_cache.adb",
    ...
    ...
    "lay_and_back_after_progress.adb"
    );

    Display_Mains := ("race_time.adb");

    Other_Mains := ( "markets_sender.adb",
    ...
    ...
    "price_to_tics.adb" );

    Test_Programs := (); --("test_string_object.adb");

    case Bot_Machine_Role is
    when "PROD" => for Main use System_Mains;
    when "TEST" => for Main use System_Mains;
    when "SIM" => for Main use System_Mains &
    Stat_Mains &
    Other_Mains &
    Test_Programs;
    when "DISPLAY" => for Main use Display_Mains;
    when "LONGPOLL" => for Main use System_Mains;
    end case;



    --
    /Björn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Mc@21:1/5 to Simon Wright on Tue Sep 27 10:09:44 2022
    On Wednesday, September 28, 2022 at 12:10:32 AM UTC+10, Simon Wright wrote:
    Roger Mc <roge...@gmail.com> writes:

    On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote:
    You can get a hello world open in gnat studio
    with two? commands though.

    "https://alire.ada.dev/docs/#first-steps"
    Following the "first-steps", progress succeeded up to
    gnat_native=11.2.4 installed successfully but then failure:
    dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow
    Any ideas on how to fix this:
    Thanks,
    Roger
    I tried this on my mid-2012 Macbook Pro running 10.11.6 (El Capitan),
    the problem arises when running gprconfig (all the Alire-provided
    releases were built against a later Xcode (Google suggests 11.4 or
    later??) which does provide this symbol). I dare say it'd happen running
    the compiler too.

    Only suggestion: install one of my builds, set it on your PATH, run alr toolchain --select & choose the 'gnat_external' line for the
    compiler. Alire then chooses a compatible gprbuild.

    11.2.0 at Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native

    Or 12.1.0 from Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64

    Thanks Simon
    I cloned 12.1.0 from Github then tried .doinstall in the native directory.
    It gets to Do you want to proceed with installation but when I respond with Y nothing happens.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Roger Mc on Tue Sep 27 21:26:13 2022
    Roger Mc <rogermcm2@gmail.com> writes:

    Only suggestion: install one of my builds, set it on your PATH, run alr
    toolchain --select & choose the 'gnat_external' line for the
    compiler. Alire then chooses a compatible gprbuild.

    11.2.0 at Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native

    Or 12.1.0 from Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64

    Thanks Simon
    I cloned 12.1.0 from Github then tried .doinstall in the native directory.
    It gets to Do you want to proceed with installation but when I respond
    with Y nothing happens.

    I don't understand what you've done, at all. "cloned"? ".doinstall"?
    "native directory"?

    I see that the README at the link above (in fact like most of my
    READMEs) might be thought to be less than clear; perhaps the very first
    thing should be the Install section. It says

    Download the binary .pkg. It's not signed, so don't double-click on
    it; instead, right-click on it and Open. Accept the warning. You will
    be guided through the installation.

    It should also say that "the binary .pkg" is to be found by scrolling to
    the bottom of the page.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Mc@21:1/5 to Simon Wright on Wed Sep 28 05:14:31 2022
    On Wednesday, September 28, 2022 at 6:26:40 AM UTC+10, Simon Wright wrote:
    Roger Mc <roge...@gmail.com> writes:

    Only suggestion: install one of my builds, set it on your PATH, run alr
    toolchain --select & choose the 'gnat_external' line for the
    compiler. Alire then chooses a compatible gprbuild.

    11.2.0 at Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native

    Or 12.1.0 from Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64

    Thanks Simon
    I cloned 12.1.0 from Github then tried .doinstall in the native directory. It gets to Do you want to proceed with installation but when I respond
    with Y nothing happens.
    I don't understand what you've done, at all. "cloned"? ".doinstall"?
    "native directory"?

    I see that the README at the link above (in fact like most of my
    READMEs) might be thought to be less than clear; perhaps the very first
    thing should be the Install section. It says

    Download the binary .pkg. It's not signed, so don't double-click on
    it; instead, right-click on it and Open. Accept the warning. You will
    be guided through the installation.

    It should also say that "the binary .pkg" is to be found by scrolling to
    the bottom of the page.
    Many thanks, much appreciated
    I confused the issue as I'm only used to downloading programs from git's " code" page.
    I had no problems following your instructions above which resulted in an easy installation.
    I'm currently using the 2019 version of gps for development but am investigating alr.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Mc@21:1/5 to Roger Mc on Wed Sep 28 05:54:33 2022
    On Wednesday, September 28, 2022 at 10:14:33 PM UTC+10, Roger Mc wrote:
    On Wednesday, September 28, 2022 at 6:26:40 AM UTC+10, Simon Wright wrote:
    Roger Mc <roge...@gmail.com> writes:

    Only suggestion: install one of my builds, set it on your PATH, run alr >> toolchain --select & choose the 'gnat_external' line for the
    compiler. Alire then chooses a compatible gprbuild.

    11.2.0 at Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native

    Or 12.1.0 from Github:
    https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64

    Thanks Simon
    I cloned 12.1.0 from Github then tried .doinstall in the native directory.
    It gets to Do you want to proceed with installation but when I respond with Y nothing happens.
    I don't understand what you've done, at all. "cloned"? ".doinstall"? "native directory"?

    I see that the README at the link above (in fact like most of my
    READMEs) might be thought to be less than clear; perhaps the very first thing should be the Install section. It says

    Download the binary .pkg. It's not signed, so don't double-click on
    it; instead, right-click on it and Open. Accept the warning. You will
    be guided through the installation.

    It should also say that "the binary .pkg" is to be found by scrolling to the bottom of the page.
    Many thanks, much appreciated
    I confused the issue as I'm only used to downloading programs from git's " code" page.
    I had no problems following your instructions above which resulted in an easy installation.
    I'm currently using the 2019 version of gps for development but am investigating alr.


    I successfully built one of my projects with alr.
    Is it possible to use gps with alr?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Leake@21:1/5 to Dmitry A. Kazakov on Wed Sep 28 10:40:44 2022
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    On 2022-09-26 08:20, Rick Duley wrote:

    I have Gnat Studio but I can't do anything at all unless I create a
    Project (whatever that is). Even then, I can't write and run
    Hello_World unless I call it Main. The concept of an IDE where I can
    step through a program checking changes in variable values as I go
    seems to have vanished.

    That concept is called debugger. GDB for GCC (GNAT Ada is based in
    GDB). GDB never ever really worked except for little exercises. It
    still does not. So, forget about it.

    Dmitry is an extreme pessimist about gdb; apparently he has had bad
    experience with it.

    On the other hand, I used GNAT with gdb for many years at NASA,
    maintaining a spacecraft simulator; I never had a problem with gdb.

    In short, I am lost and I can't find any material to help me find my
    way.

    There is a tutorial in the GNAT Studio Help menu, somewhere. I haven't
    looked at it for years, I don't know if it covers debugging.

    AdaCore has extensive resources for learning; see
    https://learn.adacore.com/

    --
    -- Stephe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Leake@21:1/5 to Jeffrey R.Carter on Wed Sep 28 11:34:00 2022
    "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes:

    On 2022-09-26 11:34, Rick Duley wrote:
    On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote: >>>
    You can start GNAT Studio with a "default project". This lets you use it as an LSE.
    What is an LSE?

    Sorry: Language-Sensitive Editor

    LSE was the name of the fancy editor made by Digital Equipment
    Corporation back when I was first learning Ada :). The editor supports "templates" that know the language syntax; you can type i f C-e, and it expands to "if {expression} then {statments} [else {statments}] end if;"
    and each of the {} [] can be similarly expanded.

    I don't know if GNAT Studio supports such templates. In Emacs they are
    called "skeletons".

    A better term for GNAT Studio these days is IDE (Integrated Development Environment); it has many more features than knowing the language syntax.

    --
    -- Stephe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Leake@21:1/5 to Dmitry A. Kazakov on Wed Sep 28 11:28:05 2022
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    On 2022-09-26 09:11, Rick Duley wrote:
    You missed the point, Dmitry. Showing me the code for Hello_World
    does not show me how to create the program using Gnat Studio.

    Hmm, programs are created by typing them in an editor...

    Gnat Studio is an IDE, not just an Editor.

    Firstly, I do not understand the concept of a _Project_.

    Project is an executable or shared/static library.

    It is much more than that.

    In technical terms, for GNAT Studio a "Project" is defined by a gnat
    project file. In turn, that project file defines the list of source directories, where to store object and executable files, the
    compilation options for release and debug builds, and a few other
    things.

    GNAT Studio can create and edit project files for you. When you get to
    more complex projects, you will want to edit them directly.

    There are tutorials on using gnat studio, including debugging, at https://www.adacore.com/gnatpro/toolsuite/gnatstudio (I found them by
    searching for "GNAT Studio").

    Until a couple of days ago I had never heard the term in reference to Ada Programming.

    It always existed. E.g. Ada 83 Reference Manual called it "the program library". See ARM 83 (10.4)

    Which is literally not "project", although it is a similar concept.

    "Project" is now a common term in many software tools.

    Secondly, I can write Hello_World.adb and have it included in my
    'Project', I can even build it, but the only thing that will run is
    _Main_.

    No, I provided the project file where the main procedure is called Hello_World.

    I cannot find any documentation about Studio which explains
    something as simple as the creation of Hello_World.exe. Can you do
    that in Studio or is it purely ornamental?

    Here are the steps I used to create "hello world" in Gnat Studio:

    - Start gnat studio from the command line.

    - If you have no previous projects, it starts a wizard that offers to
    create new project from a template. You get the same wizard by selecting
    File | New Project from the main GNAT Studio interface. In the wizard,
    choose Basic | Simple Ada Project.

    - Select a directory to hold the project files (GNAT Studio calls it
    "deploy"); I created a new directory named "hello_world".

    - change the project name from "default" to "Hello_World" (it must be a
    valid Ada identifier).

    - Change the Main Name from "main" to "hello_world". (this is the
    crucial step you have been asking for).

    - Now you are in the main GNAT Studio interface. Note that it has
    created the "src" and "obj" directories, and src/hello_world.adb for
    you. Every IDE (except Emacs :) has a default notion of the "proper"
    layout for directories; some let you change that default (I don't know
    if GNAT Studio does). Some build systems tolerate other directory
    structures; GNAT Studio does as long as the corresponding changes are
    made in the project file.

    - Edit hello_world.adb to do Put_Line ("Hello_World");

    - From the menu, select Build | Run | "Run main"

    The project is compiled, and the program is run. However, I don't see
    the output from the program in the Messages window.

    And running the exectable (which is hello_word/obj/hello_world) does not produce any output.

    Ah; I just saw Dmitry's hint about Debug | Initialize. Doing that starts
    the gdb interface in GNAT Stdio. Clicking the "Run" button (which looks
    like a media player "play" button) runs the program, which prints Hello
    World in the debugger console. Success!

    I'm guessing running the executable from the command line failed because
    some library was not found; GNAT Studio must set up the library search
    paths.

    Apparently it was compiled without debug options. But in Edit | Project Properties, I don't see anything about Debug. And there's no way to
    search for a property; does anyone know where that is?

    --
    -- Stephe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Stephen Leake on Wed Sep 28 22:08:13 2022
    On 2022-09-28 20:28, Stephen Leake wrote:
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    On 2022-09-26 09:11, Rick Duley wrote:

    Until a couple of days ago I had never heard the term in reference to Ada Programming.

    It always existed. E.g. Ada 83 Reference Manual called it "the program
    library". See ARM 83 (10.4)

    Which is literally not "project", although it is a similar concept.

    "Project" is now a common term in many software tools.

    Back in late 90's ObjecAda had projects. The project file had extension literally *.prj.

    The first GNAT IDE AdaGIDE also had projects and called them so. AdaGIDE project file was *.ago.

    I do not remember what DEC Ada used for the library. I remember that
    Pallada Ada had some sort of project, but early Meridian Ada did not.
    But that was before the dinosaurs... (:-))

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gautier write-only address@21:1/5 to Dmitry A. Kazakov on Wed Sep 28 17:31:24 2022
    On Wednesday, September 28, 2022 at 10:08:23 PM UTC+2, Dmitry A. Kazakov wrote:
    Back in late 90's ObjecAda had projects. The project file had extension literally *.prj.
    ...and still has, by the way :-).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From G.B.@21:1/5 to Stephen Leake on Thu Sep 29 10:51:54 2022
    On 28.09.22 20:28, Stephen Leake wrote:

    Until a couple of days ago I had never heard the term in reference to Ada Programming.

    It always existed. E.g. Ada 83 Reference Manual called it "the program
    library". See ARM 83 (10.4)

    Which is literally not "project", although it is a similar concept.

    Just as you say, a project can be more than a library
    (of library_items, LRM 10), but I think one can order the concepts
    library and project.
    A project typically uses a library from which it then picks units
    to be compiled, looked up, referred to, linked...

    A statement taken from the docs of a Compiler (Sofcheck)
    that is also used by ObjectAda reads

    "The Ada program library contains all information needed
    to support the separate compilation requirements of Ada."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)