Author Topic: 2017 Make with Ada competition  (Read 26055 times)

0 Members and 1 Guest are viewing this topic.

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #150 on: May 28, 2017, 08:48:44 am »
OCCAM/xC or Erlang-style

yup, things I have in my todo-list. But the goddamned linux support for customers  is so time-consuming that it's already consuming all my energy. Since OS like VxWorks and linux are written in C,and so it is for most of the userland, then I am still blocked with C.

Thanks god I can use Ada when I am requested to provide consultancy to my customers, but it seems no chance to learn new languages :palm: :palm: :palm:

The only customer who uses Erlang is related to facebook's stuff, but I don't know what he does in details  :-//

 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 10272
  • Country: gb
    • Having fun doing more, with less
Re: 2017 Make with Ada competition
« Reply #151 on: May 28, 2017, 11:07:57 am »
OCCAM/xC or Erlang-style

yup, things I have in my todo-list. But the goddamned linux support for customers  is so time-consuming that it's already consuming all my energy. Since OS like VxWorks and linux are written in C,and so it is for most of the userland, then I am still blocked with C.

Thanks god I can use Ada when I am requested to provide consultancy to my customers, but it seems no chance to learn new languages :palm: :palm: :palm:

The only customer who uses Erlang is related to facebook's stuff, but I don't know what he does in details  :-//

It can, rightly, be difficult to suggest that a customer "swims against the stream"

With one exception I've learned new languages in my spare time, and later been in a good position to get interesting jobs with "early adopters"; hence professionally using C in 82, Smalltalk/ObjectiveC in 86/87, and Java in 97.

It is unsurprising that I also used Java in a very Erlang-like style - for telecoms infrastructure.
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 orin

  • Frequent Contributor
  • **
  • Posts: 438
  • Country: us
Re: 2017 Make with Ada competition
« Reply #152 on: June 12, 2017, 08:17:02 pm »
All I wanted to do was an FFT...

So, I got an STM32F469 discovery board, downloaded the Windows drivers for the board, Ada_Drivers_Library, GNAT GPL2016, ran GPS with the demo project, told it to download to the board and... it sulked.

Somewhere it suggested running st-util first so I did that.  Download to the board... OK now that works but an st-util instance has crashed.

Several days later after getting the st-util code, making it run under Visual Studio 2017 (because VS2017 is free for open source development and I have it installed), it no longer sulks and I can download/run the examples.  See https://github.com/orinem/stlink if you want the fixed st-util; hopefully it will be merged back into https://github.com/texane/stlink soon.

Now I find an Ada FFT implementation... this looks good: https://rosettacode.org/wiki/Fast_Fourier_transform#Ada - should be really portable from a 'rosetta' named site.  Nope.  It manages to need Ada.Numerics.Complex_Arrays and Ada.Numerics.Real_Arrays which are not in any of the the Ada_Drivers_Library embedded run times that I can find.  Why not?  The generic versions are there.  Some digging and I found the relevant ADS files.  Copy the contents into my project and remove the Ada.Numerics decorations and we're off.  Not so fast.  Forget about Ada.Complex_Text_IO.  Not happening.  So remove it and format the strings by hand and finally, I have something that builds and runs and does an FFT.

Why would I want an FFT?  How about to do a waterfall display for one of these radios: http://www.wb5rvz.org/  The ARM processor should have plenty of power.

Now will someone explain what this actually does?  It looks as bad as a C++ template definition to me.
Code: [Select]
with Ada.Numerics.Generic_Complex_Arrays;
 
generic
   with package Complex_Arrays is
      new Ada.Numerics.Generic_Complex_Arrays (<>);
   use Complex_Arrays;
function Generic_FFT (X : Complex_Vector) return Complex_Vector;
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2303
  • Country: de
    • Frank Buss
Re: 2017 Make with Ada competition
« Reply #153 on: September 15, 2017, 01:28:04 pm »
So this is my entry for this year:

http://www.makewithada.org/entry/midisynthesizer

Well, this didn't went so well. I don't know if I should continue to use Ada, especially when doing embedded programming.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 920
  • Country: us
    • Embedded Tales Blog
Re: 2017 Make with Ada competition
« Reply #154 on: September 15, 2017, 03:18:03 pm »
I don't know if I should continue to use Ada, especially when doing embedded programming.

I evaluated their Ada toolset to see if it was something worth considering for my company's next project and concluded that the tools were too expensive and didn't really offer much of anything over C to consider switching to. Another big issue would be finding people familiar with it. Of the dozens of resumes/CVs I've received over the past few months for an embedded developer opening in my department, not one listed Ada experience.
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #155 on: September 15, 2017, 04:27:11 pm »
GNAT

yup, no doubt GNAT sucks if compared to SGI-ADA, or GreenHills-ADA, for the typical hipster term "ecosystem", which is just an hipster term, but practically it makes the difference for the final user.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2303
  • Country: de
    • Frank Buss
Re: 2017 Make with Ada competition
« Reply #156 on: September 15, 2017, 04:29:00 pm »
Maybe they didn't list Ada in their CVs  because they didn't want to program in Ada ;D
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #157 on: September 15, 2017, 04:44:36 pm »
Maybe they didn't list Ada in their CVs  because they didn't want to program in Ada ;D

LOL  :-DD

well, yes ... it's also the reason why it's on the third line on my CV

I mean ...
you should take an umbrella in case it rains
you should be prepared to throw yourself out of the window in case
you get GNAT as ADA-compiler on your desk
(because it's really depressing, but some companies can't buy commercial ADA)

so, you should be careful on what you are indirectly asking by presenting ADA on your CV  :D
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #158 on: September 15, 2017, 04:48:01 pm »
(may be I am still in time to move "ADA" in the last page of my CV
reducing the font-size to super-super-small  :-X :-X :-X )
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2303
  • Country: de
    • Frank Buss
Re: 2017 Make with Ada competition
« Reply #159 on: September 15, 2017, 06:18:07 pm »
you should be prepared to throw yourself out of the window in case
you get GNAT as ADA-compiler on your desk

What's wrong with the GNAT compiler? I tried the latest version which was packaged in Debian and there were some features missing, because some code couldn't be compiled, but the package was not updated for some years now. Then I tried the free 2017 compiler from http://libre.adacore.com , both for Linux 64 bit and for ARM, and it works better. Only complain so far for the ARM version is that the binaries are getting much bigger than I'm used to for the same program in C, like 480 kB for my synthesizer test, which was like 40 kB when I tried this in C. But I didn't analyze it more, maybe it has just a big runtime footprint. The GPS IDE is not bad either. Of course, you can't compare this with something like Keil uVision, but I was able to work with it. It has the usual modern features like auto-completion, go to symbol declaration, pretty print formatting, integrated debugger etc.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #160 on: September 15, 2017, 06:48:28 pm »
What's wrong with the GNAT compiler?

it sucks when you try to compile it(1), and when you want to use it for serious stuff. It's not productive, it's seems a shitty compiler with a shitty library set, and when you try to port it to a new target (which means x86 only, arm, hppa, mips ... forget it) hurts a lot, in fact ... see how many people are describing success in that. Not so many? Yup, just a few. A lot of effort for poor results!


(1) recompiling gnat
Code: [Select]
2016-12-10--16-12-50---2016-12-10--19-32-20 - emerge  =dev-lang/gnat-gcc-4.9.3 - success - root
2016-12-13--12-04-03---2016-12-13--12-05-42 - emerge  =dev-lang/gnat-gcc-4.3.5 - failure - root
2017-08-24--10-43-15---2017-08-24--11-06-49 - emerge  =dev-lang/gnat-gcc-4.3.5 - failure - root

gnat v4.3.5 is still bugged in the stage2 (thus my Overlay still fails on modern environment), and unfortunately GHDL v0.29 needs gnat v4.3: it means I am obliged to do dirty job in order to fix it someway. Dirty job = workaround. Not so good!

This, when I wear the "system admin" hat, while as "user developer" ... well ... using gnat is not so suffering experience, but ... it's for sure by ten orders of magnitude more frustrating than every commercial ADA compilers (SGI and Green Hills) I have ever used! Especially for parallel programming, and this also because libraries are more coherent.

For sure GNAT is not a good choice for business neither for hobby (if you can't allocate time for that / or if you just want to relax) since it's very irritating!
« Last Edit: September 15, 2017, 06:58:38 pm by legacy »
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #161 on: September 15, 2017, 07:07:39 pm »
can't compare this with something like Keil uVision

For business, I would compare with AdaMulti! And in fact The GNAT Programming Studio (aka GPS) sucks: it's less productive by 10 orders of magnitude, especially the debugger part.

Thus my reason to stay away from companies who don't have money to buy serious tools.
« Last Edit: September 15, 2017, 07:11:16 pm by legacy »
 

Offline orin

  • Frequent Contributor
  • **
  • Posts: 438
  • Country: us
Re: 2017 Make with Ada competition
« Reply #162 on: September 15, 2017, 07:08:44 pm »
you should be prepared to throw yourself out of the window in case
you get GNAT as ADA-compiler on your desk

What's wrong with the GNAT compiler? I tried the latest version which was packaged in Debian and there were some features missing, because some code couldn't be compiled, but the package was not updated for some years now. Then I tried the free 2017 compiler from http://libre.adacore.com , both for Linux 64 bit and for ARM, and it works better. Only complain so far for the ARM version is that the binaries are getting much bigger than I'm used to for the same program in C, like 480 kB for my synthesizer test, which was like 40 kB when I tried this in C. But I didn't analyze it more, maybe it has just a big runtime footprint. The GPS IDE is not bad either. Of course, you can't compare this with something like Keil uVision, but I was able to work with it. It has the usual modern features like auto-completion, go to symbol declaration, pretty print formatting, integrated debugger etc.


I couldn't make the 2017 GPL version debug on an STM32F469 discovery board.  I had to retreat to the 2016 version with my fixes to st-util and even then, it's started sulking if I don't start st-util separately.

The GPS IDE will hang completely on OSX Sierra with nothing more than pasting some code!  I ended up editing files outside of GPS and letting it pick them up when they changed.  That cut down the hangs.

BUT, FWIW, I did manage to link to some ARM CMSIS functions (32 bit float FFT and some related functions) and time/display a 1024 point FFT.  I also managed to encode/decode some PSK31 by porting the PSKCore DLL source to Ada.  I've yet to feed it real data from the ADC though - that's work in progress.

I found writing to the display on the discovery board to be painfully slow - it was looking like there was plenty of time to do the DSP but I'd only be able to update the display more than two or three times a second... most of which would be spent in the driver library waiting. 

The optimized code looked pretty good with the FIR filters turning into multiply-accumulate instructions, but _some_ library complex arithmetic doesn't inline (divide by real for example) and was better done 'by hand' by dividing the real and imaginary parts separately.

Edit: NOT 'more than'
« Last Edit: September 15, 2017, 07:44:36 pm by orin »
 

Offline legacy

  • Super Contributor
  • ***
  • Posts: 4347
  • Country: ch
Re: 2017 Make with Ada competition
« Reply #163 on: September 15, 2017, 07:18:57 pm »
I found writing to the display on the discovery board to be painfully slow

Yup, and! worse still (for me) it becomes painful freaky slow on multi processing, which *IS* the reason why I'd like to use GNAT on machines like Parallela. Of course I can't recompile GNAT, I have to trust ADA-core, thus .. tools-binary, no fix.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 920
  • Country: us
    • Embedded Tales Blog
Re: 2017 Make with Ada competition
« Reply #164 on: September 15, 2017, 09:09:31 pm »
Just a reminder everyone, it's Ada, not ADA. It's named after a person (Ada Lovelace) and is not an acronym.
« Last Edit: September 15, 2017, 09:12:11 pm by Sal Ammoniac »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2303
  • Country: de
    • Frank Buss
Re: 2017 Make with Ada competition
« Reply #165 on: September 19, 2017, 11:40:02 am »
So this is my entry for this year:

http://www.makewithada.org/entry/midisynthesizer

The extended deadline helped me to get a first version working :phew:



But I saw already other entries and they are very polished, with lots of useful functions, excellent documentation etc., I guess I won't win anything. Was still fun to start learning how to program in Ada.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 2560
  • Country: it
Re: 2017 Make with Ada competition
« Reply #166 on: December 08, 2018, 04:22:24 pm »
bumping, because.
I stumbled upon makeWithAda again.
I looked at the supported boards and to my surprise the STM32F4 discovery is supported.
I happen to have one of these.
What could i do besides the blinkies that helps me understand the language and its advantages better?
something simple, in the sense that i don't have to connect stuff to the board..
 
The following users thanked this post: newbrain

Offline newbrain

  • Frequent Contributor
  • **
  • Posts: 774
  • Country: se
Re: 2017 Make with Ada competition
« Reply #167 on: December 09, 2018, 12:28:16 am »
Just a reminder everyone, it's Ada, not ADA. It's named after a person (Ada Lovelace) and is not an acronym.
Oh, I thought it stood for "Accidentally Destroyed Ariane"  >:D
Nandemo wa shiranai wa yo, shitteru koto dake.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf