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

0 Members and 1 Guest are viewing this topic.

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7307
  • Country: nl
  • Current job: ATEX product design
Re: "Make With Ada" Competition
« Reply #25 on: June 22, 2016, 11:38:03 am »
OK, let me know when  there is dynamically typed, event driven, visually programmable, subjective COBOL for ARM, than maybe I will not use C.
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11536
  • Country: my
  • reassessing directives...
Re: "Make With Ada" Competition
« Reply #26 on: June 22, 2016, 11:41:53 am »
another C/C++ vs others combats, "everybody should drive automatic transmission car because manual transmission car you can give the wrong output" :palm: do you see any C/C++ embedded competition to increase awareness? nope because everybody are already well aware what C/C++ can do, except some champions in this thread. how many time do i have to tell, want a runtime checking? program in Basic! :palm:
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Xenoamor

  • Regular Contributor
  • *
  • Posts: 83
  • Country: wales
Re: "Make With Ada" Competition
« Reply #27 on: June 22, 2016, 12:08:21 pm »
Is this not needlessly verbose?

Code: [Select]
package body Program is

   procedure Run is
   begin
      loop
         null;
      end loop;
   end Run;

end Program;
I.e.
Code: [Select]
void run(void)
{
    for (;;)
    {
    }
}

Looking more in depth I could see why this would be appealing for industrial machinery. It seems harder to 'get wrong'. Seems a little clunky for handling memory addresses directly though
Personally I feel I wouldn't enjoy programming in such a strict language but it's not all about enjoyment
« Last Edit: June 22, 2016, 12:17:16 pm by Xenoamor »
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11536
  • Country: my
  • reassessing directives...
Re: "Make With Ada" Competition
« Reply #28 on: June 22, 2016, 12:17:41 pm »
Code: [Select]
void run(void)
{
    for (;;)
    {
    }
}

competition sake i prefer...

Code: [Select]
void run() { for (;;) {} }
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline KalvinTopic starter

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #29 on: June 22, 2016, 01:29:10 pm »
Code: [Select]
void run(void)
{
    for (;;)
    {
    }
}

competition sake i prefer...

Code: [Select]
void run() { for (;;) {} }

Way too verbose. Just use assembly:

Code: [Select]
run: ret
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26755
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #30 on: June 22, 2016, 02:51:58 pm »
no:
Code: [Select]
run: bra run;
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline KalvinTopic starter

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #31 on: June 22, 2016, 03:00:00 pm »
no:
Code: [Select]
run: bra run;

Good catch :) This may be less verbose, though:

Code: [Select]
run: bra $
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #32 on: June 22, 2016, 03:51:49 pm »
Is this not needlessly verbose?
...

I haven't cared about verbosity since the 1970s, when I was a 2-fingered typist on a very heavy and literally clunky ASR-33.

Since the 1990s verbosity has been a complete non-issue, given a decent language and a modern IDE. The most frequently typed character is "control-space", which often correctly inserts dozens of characters :)
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 donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: "Make With Ada" Competition
« Reply #33 on: June 22, 2016, 06:36:33 pm »
Adacore are doing the "monetize Open Source tools" business model. To be fair, they developed the code originally, although with a large chunk of public money and on the condition that the code must be GPL.

However, they are very misleading to imply that the only choices are their versions of "GNAT Pro" or "GNAT GPL", and anything else is untrustworthy.

The third version is from FSF that is licensed with a less restrictive run-time exception which we have come to expect for GCC based compilers.

So I would steer clear of Adacore and go to http://www.getadanow.com/
Bob
"All you said is just a bunch of opinions."
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: "Make With Ada" Competition
« Reply #34 on: June 22, 2016, 10:36:13 pm »
Quote
The absence of LGPL libraries has made me lose interest completely.
And runtime environment.  Don't forget the run-time environment, which can be quite extensive in many languages.
I've come to suspect that the main reason that C has been such a success is that it has such a small (nearly non-existent) runtime environment, and minimal "required" libraries.  If you want to have a Fortran (or Ada) compiler for some system, you have to write an awful lot of relatively system-dependent code, NOT written in Fortran (ie probably written in assembler.)  If you want to implement a C compiler, you can almost get away with putting a C back end on your compiler, publishing an ABI (if none exists yet), and claiming to be done.  Some languages are pretty dependent on having their runtime and libraries NOT be written in the language itself, if you want good performance.  Meh.  Perhaps these days there is a "portable Fortran Runtime environment" written in C...


Quote
"Is this not needlessly verbose?"  ...  I haven't cared about verbosity since the 1970s
Wasn't that also about when we stopped equating verbosity with "quality" as well?   I mean, I hear lots of complaints about C and C++, and some of them I agree with and some not so much.   But "a language should really use keywords like "begin" and "end" instead of braces" has never been one of them.
 

Offline Xenoamor

  • Regular Contributor
  • *
  • Posts: 83
  • Country: wales
Re: "Make With Ada" Competition
« Reply #35 on: June 23, 2016, 10:01:04 am »
I haven't cared about verbosity since the 1970s, when I was a 2-fingered typist on a very heavy and literally clunky ASR-33.

I think the argument is less about typing speed and more about readability
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #36 on: June 23, 2016, 10:57:22 am »
I haven't cared about verbosity since the 1970s, when I was a 2-fingered typist on a very heavy and literally clunky ASR-33.
I think the argument is less about typing speed and more about readability

Oh, that's your point. Beyond a certain point I agree, but Ada hasn't reached that point. Obviously APL and COBOL represent opposite and unacceptable extremes :)

But in practice the number of characters isn't critical. Much more important is the way the program is structured/architected, the language's ambiguities and gotchas, the coder's personal style/ability (or lack thereof!) and the navigation/inference abilities built into the IDE. The last is ultimately constrained by the language, but the maturity of an IDE is also relevant.
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
 
The following users thanked this post: Xenoamor

Offline KalvinTopic starter

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #37 on: June 23, 2016, 12:23:43 pm »
Adacore are doing the "monetize Open Source tools" business model. To be fair, they developed the code originally, although with a large chunk of public money and on the condition that the code must be GPL.

However, they are very misleading to imply that the only choices are their versions of "GNAT Pro" or "GNAT GPL", and anything else is untrustworthy.

The third version is from FSF that is licensed with a less restrictive run-time exception which we have come to expect for GCC based compilers.

So I would steer clear of Adacore and go to http://www.getadanow.com/

Excellent info,  thanks for the link. From the link provided one can also find Ada for the AVR, Cortex-M3 and some other microcontroller architectures.
 

Offline KalvinTopic starter

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #38 on: June 23, 2016, 12:34:42 pm »
Ada looks quite verbose compared to C/C++ and some other languages. However, when you think about designing the software, typically you tend to spend quite a lot of time in designing phase (or at least you should be). You may also spend some time in the debugging phase, or much longer time if you didn't spend enough time in the design phase. The writing itself is only very small portion of the process, and the verbosity shouldn't be a problem.  There is a rationale behind Ada's verbosity, as the language and its syntax was designed so that detecting logical and typographical errors is easier to the compiler and the human.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: "Make With Ada" Competition
« Reply #39 on: June 23, 2016, 03:26:35 pm »
There is a rationale behind Ada's verbosity, as the language and its syntax was designed so that detecting logical and typographical errors is easier to the compiler and the human.

This is for example why Ada doesn't have multi line block comments similar to C's   /* ... */

 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11536
  • Country: my
  • reassessing directives...
Re: "Make With Ada" Competition
« Reply #40 on: June 23, 2016, 06:34:32 pm »
how many times do i have to tell, verbosity and all that human friendly crap, nothing better than Basic! :blah: otoh.. someone mentioned runtime environment, think Java everybody loooves Java, i just dont get the awareness, more so the resurrection of Ada... :blah:
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: ca
Re: "Make With Ada" Competition
« Reply #41 on: June 23, 2016, 08:19:18 pm »
Still there is no need to bring up the disadvantages of the old tool when discussing the new tool.

It is perhaps a small pedantic point, but to be correct ADA is the old(er) tool but not by much. It predates C++ by about 2 years or so. I first heard of ADA around 1981 at university. The comprehensive language spec came out in 1983. The first C++ pre-processor  came out around '83 but it was half-baked, the language took some extra years for the compilers and language spec to stabilize.  I would say stabilize guardedly as there has been a sporadic accumulation of cruft in the C++ spec over the the time span. ADA has also been revised but not to the same degree in my opinion. The biggest argument in favour  of ADA is its memory management, a whole class of common bugs is eliminated.
I don't much like either language.
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: "Make With Ada" Competition
« Reply #42 on: June 24, 2016, 11:39:45 pm »
OK, I bought the StM32F7...Discovery board and, sure enough, ADAcore GNAT has support for it.  I'm just starting to look at the package but from what I can see, "Hello World" even when linked with the "small footprint" library is ginormous, on the order of 140k, if I am looking at the correct output file.

Anyway, the board will be here in a few days.  Now what?
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26755
  • Country: nl
    • NCT Developments
Re: "Make With Ada" Competition
« Reply #43 on: June 24, 2016, 11:43:35 pm »
OK, I bought the StM32F7...Discovery board and, sure enough, ADAcore GNAT has support for it.  I'm just starting to look at the package but from what I can see, "Hello World" even when linked with the "small footprint" library is ginormous, on the order of 140k, if I am looking at the correct output file.
The size is probably due to the runtime library. You probably have to add lots of code yourself in order to increase the size significantly  >:D
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: "Make With Ada" Competition
« Reply #44 on: June 25, 2016, 01:53:32 am »
Quote
"Hello World" even when linked with the "small footprint" library is ginormous, on the order of 140k
You're not supposed to care.  You've got 1MB of flash and 16MB of QSPI flash to put your code into.  Plus RAM.

The question is: is that 140k fixed runtime overhead, or an indication of bloated code in general?  If helloWorld takes 140k, how big is a converted "real" application?  And how well does it run?

I'm also in the camp of "that's too big and too slow - it should be smaller and faster", whenever I look at "modern" languages.   But, you know, they also DO STUFF and create applications that would be nearly impossible to write in "bare C" (not to mention that you'd probably be spending all your time "supporting" the infrastructure code you had to write, instead of using those bloated libraries.)
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: "Make With Ada" Competition
« Reply #45 on: June 25, 2016, 04:02:15 am »
The code for "Hello World" itself is quite short - something around 60 bytes (I'm just guessing, the package is on another computer).  The rest is run time and, perhaps, the debug information.  I still need to do a lot of research on how the software is set up.

I want to learn Ada.  No particular reason, I'm not going to work for the military.  But the language is a lot like Pascal and I absolutely love Pascal.  I used it about a dozen years ago with an 8051 clone to create a small control system for a battery powered board.

I'm going to look through the library source code (it is provided).  It's all written in Ada and that's fine but my idea of 'small footprint' may be a lot smaller than the developers'.

Like all ARM devices, the startup code gets out of hand fairly quickly.  There are a number of clocks to set up, there's an FPU to initialize and the I & D caches.  All of this is written in Ada so there's a lot of example code to reference.

I have a lot of experience with bare iron chips and C so I'm not necessarily tied to the Ada runtime.  The GCC toolchain allows Ada to link with any of the other languages including ASM & C.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: "Make With Ada" Competition
« Reply #46 on: June 25, 2016, 05:35:20 am »
ADA?  :-//
Were we transported back to the 1980's?
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: "Make With Ada" Competition
« Reply #47 on: June 25, 2016, 05:56:48 am »
ADA?  :-//
Were we transported back to the 1980's?

ADA is an improvement on many of its successors. (Old joke, first made about Algol-60).

Similar points can be made about Erlang (just look at how many new languages/libraries are trying to emulate its advantages) and Fortran (which still rules supreme in high-performance numerically-intensive computing).
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 westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: "Make With Ada" Competition
« Reply #48 on: June 25, 2016, 08:15:51 am »
Quote
There are a number of clocks to set up, there's an FPU to initialize and the I & D caches.  All of this is written in Ada
So ... how does that work?  I would have thought that the sort of type-checking and "safety" Ada is supposed to provide would make low-level initialization nearly impossible without resorting to non-Ada code.
 

Offline KalvinTopic starter

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: "Make With Ada" Competition
« Reply #49 on: June 25, 2016, 10:05:59 am »
Quote
There are a number of clocks to set up, there's an FPU to initialize and the I & D caches.  All of this is written in Ada
So ... how does that work?  I would have thought that the sort of type-checking and "safety" Ada is supposed to provide would make low-level initialization nearly impossible without resorting to non-Ada code.
Could you please elaborate this a bit more. What makes you think that Ada is less suitable for the low-level programming compared to C/C++?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf