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!reader02.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Ada: A beginners experience Date: Sat, 14 Jul 2018 11:26:20 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <1d3743b1-1a36-429d-92c7-9ae0e7c16e63@googlegroups.com> <8cf99886-bbf2-4fb9-9a92-aaa5403a2624@googlegroups.com> <821c650e-72ae-4bd1-97a4-3a9bd7433d48@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 14 Jul 2018 11:26:20 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="0f59ed20641e20fa620c7f2507d170e2"; logging-data="24489"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1868i8C1RGVVUh70MfNsrZ+rgzyptlEJwQ=" User-Agent: Pan/0.141 (Tarzan's Death; 168b179 git.gnome.org/pan2) Cancel-Lock: sha1:Qlfo/fFdrmHRJyde82xBkD2CuGQ= Xref: reader02.eternal-september.org comp.lang.ada:53799 Date: 2018-07-14T11:26:20+00:00 List-Id: 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...