comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Ada: A beginners experience
Date: Sat, 14 Jul 2018 11:26:20 -0000 (UTC)
Date: 2018-07-14T11:26:20+00:00	[thread overview]
Message-ID: <picmks$nt9$1@dont-email.me> (raw)
In-Reply-To: 821c650e-72ae-4bd1-97a4-3a9bd7433d48@googlegroups.com

On Fri, 13 Jul 2018 20:53:13 -0700, blakemichael073 wrote:

> On Saturday, July 14, 2018 at 10:53:02 AM UTC+8, Dan'l Miller wrote:
>> On Friday, July 13, 2018 at 9:36:32 PM UTC-5, blakemi...@gmail.com
>> wrote:
>> > At the moment I spend too much time trying understand how to make my
>> > tools work, and not enough time using my tools.
>> 
>> Specifically what do you mean by “make the tools work”?  Do you spend
>> 1) more time tweaking the command-line and build scripts and
>> surrounding ecosystem, as getting exasperated trying to get the
>> toolchain to work together (almost independent of
>> Ada-the-language-per-se)
>> or 2) more time having lengthy errors/warnings-from-compiler
>> conversations with the GNAT compiler about Ada source code, as cycles
>> of learning of learning Ada itself?
> 
> The first of the two options, well at least most of the time. An example
> of the entry barrier level is the Inspirel tutorials for Ada on the
> Cortex-M. I have tried many times to make this work, but so far I have
> had no luck. (The author posts here so I will add that I have still
> learnt a lot from the tutorial). This is the only beginner style
> tutorial that I have found, but I have run into trouble with it.

First, thank you for persisting.

Second, what you are seeing is primarily the result of being one of 
relatively few people going down this path; it's a vicious circle, 
because there are relatively few peoplo on the path, there aren't many 
good maps (tutorial examles, easy to install tools) and lots of weeds. 
Which makes it harder to get started and puts off some people.

Third - I'd agree it's easier to learn the language itself on a desktop 
environment, but I don't agree you have to put the STM32 aside for very 
long. You can combine both approaches with some advantage, and it will 
stand you in good stead in the longer term.

For example, you can write a loop

loop
   Wait(1.0);
   Led_On;
   Wait(1.0);
   Led_Off;
end loop;

and test it with procedures like

procedure Led_On is
begin
   Ada.Text_IO.Put_line("LED is ON");
end Led_On;

(and use the Delay subprogram for Wait)

and compile and test it on the desktop.

Put the subprograms in a package and write two package bodies; one which 
works on the desktop as above, and one which works on the STM32 (or 
Arduino, or MSP430 [1]). Packages are basic and very useful, worth 
learning early.

Then learn enough about the build system (either Gnatmake or Gprbuild) to 
compile either package body and link for either target, and you are well 
on the way to keeping your code easily portable to other targets.

For serious large scale control applications, you'll need to learn 
tasking, as Dmitry says (more likely a subset of full tasking like the 
Ravenscar profile), but you can go quite a long way before that stage.
And again that's easier if you prototype on the desktop and move to the 
micro once it's working.

Just some suggestions for getting started.

-- Brian

[1] https://sourceforge.net/projects/msp430ada/
Not easy to install, and seriously needs updating...


  reply	other threads:[~2018-07-14 11:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-14  2:36 Ada: A beginners experience blakemichael073
2018-07-14  2:53 ` Dan'l Miller
2018-07-14  3:53   ` blakemichael073
2018-07-14 11:26     ` Brian Drummond [this message]
2018-07-14 12:11       ` blakemichael073
2018-07-14 13:27     ` Dan'l Miller
2018-07-14 14:57     ` Jere
2018-07-16 21:38       ` Maciej Sobczak
2018-07-20 12:00         ` Jere
2018-07-20 21:05           ` Maciej Sobczak
2018-07-21  8:25             ` Simon Wright
2018-07-14  3:36 ` Paul Rubin
2018-07-14  4:08   ` blakemichael073
2018-07-14  6:21     ` Paul Rubin
2018-07-14  8:30       ` Rene
2018-07-14 15:10         ` Paul Rubin
2018-07-14 15:13   ` Jere
2018-07-14 15:42     ` Paul Rubin
2018-07-14 16:01       ` Dmitry A. Kazakov
2018-07-14 19:05         ` Dennis Lee Bieber
2018-07-15  0:31         ` Paul Rubin
2018-07-14 15:55     ` Simon Wright
2018-07-15 22:44     ` Bill Findlay
2018-07-16  1:17       ` Jere
2018-07-16  1:41         ` Paul Rubin
2018-07-16  2:01         ` Bill Findlay
2018-07-16  2:46       ` Dan'l Miller
2018-07-16 15:54         ` Bill Findlay
2018-07-14  8:01 ` Dmitry A. Kazakov
2018-07-14 12:20   ` blakemichael073
2018-07-14 13:15     ` Dmitry A. Kazakov
2018-07-14 14:15       ` blakemichael073
2018-07-14  8:19 ` Jeffrey R. Carter
2018-07-16  9:25 ` fabien.chouteau
2018-07-17  1:18   ` blakemichael073
2018-07-17  1:44     ` Dennis Lee Bieber
2018-07-17 12:59     ` fabien.chouteau
2018-07-20  1:08     ` Philip Munts
2018-07-23  4:04       ` blakemichael073
2018-07-23 13:15         ` Dennis Lee Bieber
2018-07-26 10:20   ` fabien.chouteau
2018-07-16 17:36 ` G. B.
2018-07-16 18:43   ` Simon Wright
2018-07-16 19:08     ` Paul Rubin
replies disabled

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