Author Topic: "Make With Ada" Competition  (Read 19916 times)

0 Members and 1 Guest are viewing this topic.

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1793
  • Country: fi
  • Embedded SW/HW.
"Make With Ada" Competition
« on: June 21, 2016, 12:09:28 pm »
For those interested in [ARM] microcontrollers and the Ada programming language:

http://www.makewithada.org/

"Make with Ada is an embedded software project competition sponsored by AdaCore. It is open to individuals and small teams using the Ada or SPARK languages to develop dependable, open, inventive and collaborative projects on ARM Cortex M or R processors."

It seems that the compiler and run-time libraries support mainly the STM32F4 processors.
 

Offline Xenoamor

  • Regular Contributor
  • *
  • Posts: 77
  • Country: wales
Re: "Make With Ada" Competition
« Reply #1 on: June 21, 2016, 12:15:09 pm »
Ada looks pretty awkward to optimise. What's the merrits of this over C/C++?
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1793
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #2 on: June 21, 2016, 12:38:39 pm »
Ada looks pretty awkward to optimise. What's the merrits of this over C/C++?

Ada is designed to be more robust programming language compared to C/C++. Ada provides strict compile-time type checking and optionally run-time checking for variables and array boundaries, for example. The C/C++ provides very little compile-time type checking and almost no run-time checking whatsoever.  The Ada language has also a notation for a Task. Also the optional run-time exception handling is built in the language (Yes, C++ has it now too).

The SPARK is Ada subset of the language, and it is targeted for those mission critical applications that needs to be proven correct.

I am no expert in Ada by any means, but I have been paying attention to its development as I grew up in the Pascal/Modula ie. Wirth-language age.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #3 on: June 21, 2016, 01:04:14 pm »
Ada has been on my radar as well for a while. IMHO a good reason for using it is for writing more robust programs without needing to think about all the traps and sinkholes C has to offer.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10296
  • Country: gb
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #4 on: June 21, 2016, 02:13:32 pm »
Ada looks pretty awkward to optimise. What's the merrits of this over C/C++?

Its designers understand their creation. The C++ designers refused to believe http://www.informit.com/articles/article.aspx?p=30667 until their faces were rubbed in the working code. If the designers don't understand their creation, what chance have mere users?

There's no equivalent of the C++ FQA http://yosefk.com/c++fqa/ because there's no need for there to be.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 6655
  • Country: us
Re: "Make With Ada" Competition
« Reply #5 on: June 21, 2016, 07:39:48 pm »
That's a pretty good FQA!

If I use GNU Ada, I can link with ASM, C, C++ (I think) and Fortran code.  It's all in the family.  I'm not sure I get that flexibility with any other toolchain.

 

Offline dferyance

  • Regular Contributor
  • *
  • Posts: 124
Re: "Make With Ada" Competition
« Reply #6 on: June 21, 2016, 07:42:03 pm »
Its designers understand their creation. The C++ designers refused to believe http://www.informit.com/articles/article.aspx?p=30667 until their faces were rubbed in the working code. If the designers don't understand their creation, what chance have mere users?

The C++ language was designed to provide tools that could be a number of ways instead of only solving one specific purpose. This is why it supports multiple inheritance while many other languages do not. It wasn't about telling you, you must do OOP, or you must program one way. The downside is that it makes it even easier to be stuck in your ways and never learn something better. It also can easily be abused, but that is one of the tradeoffs. Compare it to Java that forces you to do no more than one public class per file. Just a very different design philosophy.

There's no equivalent of the C++ FQA http://yosefk.com/c++fqa/ because there's no need for there to be.

There is plenty that frustrates me about C++ but the FQA is mostly nonsense. For an example "I don't like C++ classes.". Ok, yeah whatever.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10296
  • Country: gb
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #7 on: June 21, 2016, 08:08:06 pm »
Its designers understand their creation. The C++ designers refused to believe http://www.informit.com/articles/article.aspx?p=30667 until their faces were rubbed in the working code. If the designers don't understand their creation, what chance have mere users?

The C++ language was designed to provide tools that could be a number of ways instead of only solving one specific purpose. This is why it supports multiple inheritance while many other languages do not. It wasn't about telling you, you must do OOP, or you must program one way. The downside is that it makes it even easier to be stuck in your ways and never learn something better. It also can easily be abused, but that is one of the tradeoffs. Compare it to Java that forces you to do no more than one public class per file. Just a very different design philosophy.

None of which addresses the point: c++ is so complex that even its creators don't understand it. That's  a damning indictment. That it is still true is indicated by the preponderance of c and c++ language lawyers.

The tool has become part of the problem, rather than the solution. If c++ is the answer, then check you are asking the right question.

Quote
There's no equivalent of the C++ FQA http://yosefk.com/c++fqa/ because there's no need for there to be.

There is plenty that frustrates me about C++ but the FQA is mostly nonsense. For an example "I don't like C++ classes.". Ok, yeah whatever.


There is a very uncomfortable number of truths in that fqa.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #8 on: June 21, 2016, 08:23:12 pm »
There is a very uncomfortable number of truths in that fqa.
Nobody cares because it is just an informative as saying 'you shouldn't use a hammer because you can hit your fingers'.

Lets get back to Ada: it would be nice to get some pointers towards some introductions into the Ada language.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10296
  • Country: gb
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #9 on: June 21, 2016, 08:34:53 pm »
There is a very uncomfortable number of truths in that fqa.
Nobody cares because it is just an informative as saying 'you shouldn't use a hammer because you can hit your fingers'.

That always has been a jackass statement, from those that don't want to improve.

It is about as sensible as saying "my grandfather didn't wear ear/eye protectors, so there's no need for me to".
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #10 on: June 21, 2016, 08:41:19 pm »
Still there is no need to bring up the disadvantages of the old tool when discussing the new tool.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10296
  • Country: gb
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #11 on: June 21, 2016, 08:51:57 pm »
Still there is no need to bring up the disadvantages of the old tool when discussing the new tool.

See the second message in this thread, https://www.eevblog.com/forum/microcontrollers/%27make-with-ada%27-competition/msg966811/#msg966811

Questioning whether it is worth learning a new tool is absolutely vital, even if you then choose to continue using the old tool.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline dferyance

  • Regular Contributor
  • *
  • Posts: 124
Re: "Make With Ada" Competition
« Reply #12 on: June 21, 2016, 09:04:48 pm »
There is a very uncomfortable number of truths in that fqa.

No one should ever be uncomfortable when something they use gets criticized. I love picking out flaws in things I use and love myself.

Clearly C++ isn't for you. That's ok. I have used quite a number of different programming languages with different success. Good thing is there are plenty of alternatives.

Quite similarly, Ada isn't for me. I have done plenty of work in pascal to know that I don't enjoy languages like that. After trying haskell, I cannot help but yawn when I see something that verbose. But I respect the static type checking and trying to have things in place to verify that the application is correct. More power to people who do like it. It is always cool to see something get re-purposed.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #13 on: June 21, 2016, 09:17:51 pm »
I'm not a fan of Pascal either but still I wouldn't dismiss Ada because of that without looking into it seriously. I'm also doing a reasonable amount of VHDL work and it takes some getting used to doing things in a smart way so a small amount of code does a lot. AFAIK Ada is derived from Pascal so I guess they took a lot of bad 'Pascal' things out of it. After all Pascal was invented to learn (force) people how to program in a structured manner. Pascal was never intended to be used as a programming language for large production software projects so no wonder it sucks (understatement) for that purpose.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1077
  • Country: fi
Re: "Make With Ada" Competition
« Reply #14 on: June 21, 2016, 09:21:45 pm »
The C/C++ provides very little compile-time type checking and almost no run-time checking whatsoever.
You can have both, if you want. User-defined types can prevent the automatic type conversions of the primitive types, and by not using pointers you can have all the bounds checking you want. For example, in STL the idiom for containers supporting random access is that the at() member function uses bounds checking, while operator[] does not.

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #15 on: June 21, 2016, 09:27:25 pm »
The C/C++ provides very little compile-time type checking
This depends largely on the compiler settings. Modern gcc and g++ (the GNU C and C++ compilers) are extremely anal when it comes to type checking. You really have to use casts to prevent at least warnings unless you use void pointers for everything but that would be poor programming practise. If you make a habit of using pointers with a specific type then gcc/g++ will catch all type mismatches.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10296
  • Country: gb
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #16 on: June 21, 2016, 09:46:49 pm »
There is a very uncomfortable number of truths in that fqa.

No one should ever be uncomfortable when something they use gets criticized. I love picking out flaws in things I use and love myself.

Clearly C++ isn't for you. That's ok. I have used quite a number of different programming languages with different success. Good thing is there are plenty of alternatives.

Oh, I've been using C since 1981, when there were precisely two books available, K&R and the Puzzle book. A great tool for some problems.

I have a great respect for C as it was originally intended - but over the decades it has mutated into a cancerous growth. When "const" was being introduced into the language, I remember the endless (and fundamentally unresolvable) dichotomy as to whether it should be possible or impossible to "cast away constness". At that point I realised the tool was becoming baroquely complex.

C++ I never liked, having first tried it in 1988. It was faster to get a more reliable product using either Objective-C or Smalltalk. When Java appeared, the depth and quality of libraries available rapidly outstripped those that hadn't become available for C++ in ~10 years.

And then I remember someone proudly announcing the release of the first full C++98 compiler about six years after the standard was produced. A big clue that something is wrong.

Quote
Quite similarly, Ada isn't for me. I have done plenty of work in pascal to know that I don't enjoy languages like that. After trying haskell, I cannot help but yawn when I see something that verbose. But I respect the static type checking and trying to have things in place to verify that the application is correct. More power to people who do like it. It is always cool to see something get re-purposed.

If I'm allowed to produce an incorrect result, then my Ada/Java/Smalltalk/bash program will be much much faster than your C++ program :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 921
  • Country: us
    • Embedded Tales Blog
Re: "Make With Ada" Competition
« Reply #17 on: June 21, 2016, 10:49:42 pm »
Pascal was never intended to be used as a programming language for large production software projects so no wonder it sucks (understatement) for that purpose.

Back when Pascal was the only reasonable development language on the PC (Turbo Pascal circa 1983) I wrote production applications of tens of thousands of lines of code in it. I thought it was a good language at the time. I did, however, switch to Turbo C as soon as it came out.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: "Make With Ada" Competition
« Reply #18 on: June 21, 2016, 10:49:54 pm »
It's been a long time since I've looked seriously at Ada, so my impressions may be out of date, but here they are anyway...

Ada was essentially the last of the "mainframe" languages, designed in a time where new languages "needed" to be all things for all people, potentially replace all other languages (especially proprietary languages like PL/1), meet the needs of computer scientists, business programmers, and scientific programmers, and (therefore) included vast runtime libraries amd significant dependence on OS services as part of the language definition.  Cost was no object - compilers were priced extremely high, but most often were part of multi-million-dollar deals for mainframe installations, or gifts to universities.  Personal Computers barely existed, microcontrollers were mask programmed, and either one was laughable for the disk or run-time footprint of a "real language" (You had your assembler and you had your BASIC interpreters...)

There followed a decade or so when the micro and personal computer worlds pretty much ignored anything that had been learned in the Mainframe world, and the mainframe folk seemed to believe that these newcomers were mere toys that wouldn't affect them.  Heh. :-(

Time has passed and things are different.
It's nice that Ada is appearing on PCs and in embedded environments.  It's nice that the specs have been refined so that it can.  It's nice that there's a free OSSW compiler with various targets.  I don't know that I'll ever be convinced that "big languages" are inherently better, but it's not an unreasonable experiment, and I applaud the contest.

It says in the GNAT FAQ ( http://libre.adacore.com/tools/gnat-gpl-edition/faq/ ) that the free version of the compiler/etc can ONLY be used to develop free Open Source software (compiler, runtime, and libraries all full GPL, not LGPL or anything.)  That seems ... less than attractive.
Quote>What is the license of the GNAT GPL Edition?
 Everything (tools, runtime, libraries) in the GNAT GPL Edition is licensed under the General Public License (GPL). This ensures that executables generated by the GNAT GPL Edition are Free Software and that source code is made available with the executables, giving the freedom to recepients to run, study, modify, adapt, and redistribute sources and executables under the terms of the GPL.
 I would like to release my software under the ABC license, which is incompatible with the GPL. What should I do?
 If the ABC license is a Free Software license according to the FSF, then read the following Q&A. If the ABC license is not a Free Software license then it is the intention of the GPL distribution of GNAT to restrict your freedom. For distribution of proprietary software, we suggest and recommend the use of GNAT Pro, which, while still being Free Software, comes with more liberal licensing permitting this kind of use.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #19 on: June 21, 2016, 11:53:36 pm »
It says in the GNAT FAQ ( http://libre.adacore.com/tools/gnat-gpl-edition/faq/ ) that the free version of the compiler/etc can ONLY be used to develop free Open Source software (compiler, runtime, and libraries all full GPL, not LGPL or anything.)  That seems ... less than attractive.
That is a major fail in my book. Keeping libraries under GPL is the road to nowhere since nobody will use them.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: "Make With Ada" Competition
« Reply #20 on: June 22, 2016, 12:04:08 am »
(note that their "pro" version has a modified license...)
("Pricing for GNAT Pro subscriptions starts at $15,000" : http://www.electronicsworld.co.uk/news/archive/3087-adacore-launches-new-version-of-gnat-programming-studio- )

« Last Edit: June 22, 2016, 12:10:48 am by westfw »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #21 on: June 22, 2016, 12:09:37 am »
(note that their "pro" version has a modified license...)
Yes, but no pricing information to be found. Only a form to request a quote. Usually this means they want a trillion gazillion dollars per year for a node locked time limited license. Funny that some companies still have a sales prevention team! If they release the Ada libraries etc under LGPL they could make money by selling the development tools.
« Last Edit: June 22, 2016, 12:15:49 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1793
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #22 on: June 22, 2016, 09:33:30 am »
Lets get back to Ada: it would be nice to get some pointers towards some introductions into the Ada language.

The competition page has some pointers to the tutorials and the getting started material:
http://www.makewithada.org/getting-started

For the historically reasons Ada has been underdog: The first compilers were very expensive, compilation time was veeeeery slow, compilers run on expensive workstations, produced not-so-optimized code, only few architectures were supported, the Ada was plagued with the military-only stigma and the first versions of the language missed some useful features. The current Ada versions and Ada profiles provide good support for the embedded design as some of the bulkier features can be removed selecting the right language profile. Object orienting programming and generic programming (quite similar to C++ templates) is are well supported.

I will take this competition as an opportunity to take a closer look at Ada, although I will not take part of the competition. Just a good excuse to try Ada out on real embedded hardware.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 18027
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #23 on: June 22, 2016, 10:36:05 am »
The absence of LGPL libraries has made me lose interest completely. I think my time will be better spend on embedded Lua.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1793
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #24 on: June 22, 2016, 11:25:55 am »
The absence of LGPL libraries has made me lose interest completely. I think my time will be better spend on embedded Lua.

Depending of where you obtain your compiler, the run-time libraries are in GPL, GNAT Modified General Public License (GMGPL) or something else. In my understanding the GMGPL is similar to the LGPL which permits the run-time library static linkage to a proprietary application.

If I understood correctly, typically the public interface of the Ada run-time library is GPL, but the code generating part or the run-time library can be GPL, GMGPL or somehing else (see above), so you may be able to perform the static linkage similar to the LGPL.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf