comp.lang.ada
 help / color / mirror / Atom feed
* Ada on Raspberry Pi: new article in MagPi issue 8
@ 2012-12-02  0:51 Rego, P.
  2012-12-02 17:19 ` Luke A. Guest
  0 siblings, 1 reply; 10+ messages in thread
From: Rego, P. @ 2012-12-02  0:51 UTC (permalink / raw)


I had a very happy surprise today when I opened the MagPi issue 8 and found the Ada article "Beginning Ada" by Luke Guest. And it's the second part, started in issue 6 (which I had not read til today...). Congratulations!

http://www.themagpi.com/

Best regards.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02  0:51 Ada on Raspberry Pi: new article in MagPi issue 8 Rego, P.
@ 2012-12-02 17:19 ` Luke A. Guest
  2012-12-02 18:23   ` tonyg
                     ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Luke A. Guest @ 2012-12-02 17:19 UTC (permalink / raw)


On 2012-12-02, Rego, P. <pvrego@gmail.com> wrote:
> I had a very happy surprise today when I opened the MagPi issue 8 and found
> the Ada article "Beginning Ada" by Luke Guest. And it's the second part,
> started in issue 6 (which I had not read til today...). Congratulations!

Thanks, the idea was to get Ada into the minds of kids reading that magazine
as an additional language and to prove it can be used for beginners with no
programming experience whatsoever.

I'm also trying to think of a good project to document in the next articles, I
have two ideas, but not sure about them. The aim would be to show the use of:

1) packages
2) possibly separates for platform dependencies
3) GNAT project files & Makefiles
4) Representation clauses for mapping to hardware or C API's
5) Maybe tasking

Any ideas? It has to have a cool factor. Mine are:

1) ZX Spectrum emulator. or
2) A language compiler going from source -> ELF/ARM binary.

Luke.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
@ 2012-12-02 18:23   ` tonyg
  2012-12-02 18:47   ` Bill Findlay
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: tonyg @ 2012-12-02 18:23 UTC (permalink / raw)


On Sunday, 2 December 2012 17:19:56 UTC, Luke A. Guest  wrote:
> On 2012-12-02, Rego, P. <pvrego@gmail.com> wrote:
> 
> > I had a very happy surprise today when I opened the MagPi issue 8 and found
> 
> > the Ada article "Beginning Ada" by Luke Guest. And it's the second part,
> 
> > started in issue 6 (which I had not read til today...). Congratulations!
> 
> 
> 
> Thanks, the idea was to get Ada into the minds of kids reading that magazine
> 
> as an additional language and to prove it can be used for beginners with no
> 
> programming experience whatsoever.
> 
> 
> 
> I'm also trying to think of a good project to document in the next articles, I
> 
> have two ideas, but not sure about them. The aim would be to show the use of:
> 
> 
> 
> 1) packages
> 
> 2) possibly separates for platform dependencies
> 
> 3) GNAT project files & Makefiles
> 
> 4) Representation clauses for mapping to hardware or C API's
> 
> 5) Maybe tasking
> 
> 
> 
> Any ideas? It has to have a cool factor. Mine are:
> 
> 
> 
> 1) ZX Spectrum emulator. or
> 
> 2) A language compiler going from source -> ELF/ARM binary.
> 
> 
> 
> Luke.

Well done Luke. One idea would be to show how programmers can work seperately to produce functional working programs through packages and abstraction etc.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
  2012-12-02 18:23   ` tonyg
@ 2012-12-02 18:47   ` Bill Findlay
  2012-12-02 19:22   ` Shark8
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Bill Findlay @ 2012-12-02 18:47 UTC (permalink / raw)


On 02/12/2012 17:19, in article k9g2js$kf$1@speranza.aioe.org, "Luke A.
Guest" <laguest@archeia.com> wrote:

> On 2012-12-02, Rego, P. <pvrego@gmail.com> wrote:
>> I had a very happy surprise today when I opened the MagPi issue 8 and found
>> the Ada article "Beginning Ada" by Luke Guest. And it's the second part,
>> started in issue 6 (which I had not read til today...). Congratulations!
> 
> Thanks, the idea was to get Ada into the minds of kids reading that magazine
> as an additional language and to prove it can be used for beginners with no
> programming experience whatsoever.
> 
> I'm also trying to think of a good project to document in the next articles, I
> have two ideas, but not sure about them. The aim would be to show the use of:
> 
> 1) packages
> 2) possibly separates for platform dependencies
> 3) GNAT project files & Makefiles
> 4) Representation clauses for mapping to hardware or C API's
> 5) Maybe tasking
> 
> Any ideas? It has to have a cool factor. Mine are:
> 
> 1) ZX Spectrum emulator. or
> 2) A language compiler going from source -> ELF/ARM binary.

A KDF9 emulator?

   <http://www.findlayw.plus.com/KDF9>

-- 
Bill Findlay
with blueyonder.co.uk;
use  surname & forename;





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
  2012-12-02 18:23   ` tonyg
  2012-12-02 18:47   ` Bill Findlay
@ 2012-12-02 19:22   ` Shark8
  2012-12-03 11:53   ` Georg Bauhaus
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Shark8 @ 2012-12-02 19:22 UTC (permalink / raw)


On Sunday, December 2, 2012 9:19:56 AM UTC-8, Luke A. Guest wrote:
> 
> I'm also trying to think of a good project to document in the next articles, I
> have two ideas, but not sure about them. The aim would be to show the use of:
> 
> 
> 1) packages

Excellent idea, packages are really a fundamental Ada building-block and should be introduced early-on.

> 2) possibly separates for platform dependencies

Good idea, but you may want to deffer that to a bit later... perhaps after introducing #4 and representation clauses -- if you go with using representation clauses for low-level interfacing you can introduce separates for HW variations. 

> 3) GNAT project files & Makefiles

GPR files do seem to be _much_ better than makefiles; however, it is platform [toolchain, rather] specific. 

> 4) Representation clauses for mapping to hardware or C API's

Reading your articles I would suggest you do the main article on hardware-mapping and sidenote C-API interfacing and perhaps a small example w/layouts. 

> 5) Maybe tasking

Tasking is one of Ada's excellent features, IMO.
If we are going to introduce kids to programming via Ada, it might well behoove us to spoil them on parallel-computing w/ tasks.

> 
> Any ideas? It has to have a cool factor. Mine are:
> 
> 2) A language compiler going from source -> ELF/ARM binary.

Might I suggest an interpreter? You could explain it a bit more succinctly [and with less jargon (no need to go into linking, object files, loaders, etc)] than a compiler. (To keep syntax & parsing simple you could go with the old-school/early-computing LISP.)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
                     ` (2 preceding siblings ...)
  2012-12-02 19:22   ` Shark8
@ 2012-12-03 11:53   ` Georg Bauhaus
  2012-12-04  1:44   ` Rego, P.
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Georg Bauhaus @ 2012-12-03 11:53 UTC (permalink / raw)


On 02.12.12 18:19, Luke A. Guest wrote:
> 4) Representation clauses for mapping to hardware or C API's

Based on what John McCormick found to be so valuable about Ada's
expressive fundamental type system, I'd like to humbly suggest that
it be made known, and preferred to implementation defined C like types
such as Integer. In particular, Ada's scalar types allow programmers
to just say what they already know instead of thinking hard
about which int-like type might somehow match what they cannot
express in the fundamental type system (of C, or Ada's library types),
such as range 1 .. 80_000 (vs C's INT_MAX/Ada's System.Max_Int):

    "Upon reading the project listings and team member diaries, I concluded
that the major advantages of Ada for these students were, in order of importance:

    "* Modeling of scalar objects.
          + Strong typing.
          + Range constraints.
          + Enumeration types.
    * Parameter modes that reflect the problem rather than the mechanism.
    * Named parameter association.
    * Arrays whose indices do not have to begin at zero.
    * Representation clauses for device registers
      (record field selection rather than bit masks).
    * Higher level of abstraction for tasking
      (rendezvous rather than semaphores).
    * Exception handling.

"Compilation model detects obsolete units

    "I found my original hypothesis, that the major problem was C's low-level
tasking mechanism, to be incorrect. While Ada's high level of abstraction for
tasking was helpful to the students, it was the accurate modeling of scalar
quantities that contributed the most to Ada's success in this course."

Crosstalk article also found here
http://archive.adaic.com/projects/atwork/trains.html




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
                     ` (3 preceding siblings ...)
  2012-12-03 11:53   ` Georg Bauhaus
@ 2012-12-04  1:44   ` Rego, P.
  2012-12-10 20:12   ` Simon Wright
  2012-12-11 11:04   ` Jacob Sparre Andersen
  6 siblings, 0 replies; 10+ messages in thread
From: Rego, P. @ 2012-12-04  1:44 UTC (permalink / raw)


> Thanks, the idea was to get Ada into the minds of kids reading that magazine 
> as an additional language and to prove it can be used for beginners with no 
> programming experience whatsoever. 
> 
> I'm also trying to think of a good project to document in the next articles, I 
> have two ideas, but not sure about them. The aim would be to show the use of: 
> 1) packages 
> 2) possibly separates for platform dependencies 
> 3) GNAT project files & Makefiles 
> 4) Representation clauses for mapping to hardware or C API's 
> 5) Maybe tasking 
> 
> Any ideas? It has to have a cool factor. Mine are: 
> 1) ZX Spectrum emulator. or 
> 2) A language compiler going from source -> ELF/ARM binary. 

I think that sometimes it's a good incentive (for people to use a programming language) to have some device libraries implemented, so they can use the Ada features, but don't have to implement all of it from scratch. Maybe GPIO? A good play could be to demonstrate the tasking/rendevouz/semaphores concepts using leds through GPIO. 

Raspberry is a good portfolio for motivate more people to use Ada, and your articles follow it. Very good. 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
                     ` (4 preceding siblings ...)
  2012-12-04  1:44   ` Rego, P.
@ 2012-12-10 20:12   ` Simon Wright
  2012-12-11 12:34     ` Simon Wright
  2012-12-11 11:04   ` Jacob Sparre Andersen
  6 siblings, 1 reply; 10+ messages in thread
From: Simon Wright @ 2012-12-10 20:12 UTC (permalink / raw)


"Luke A. Guest" <laguest@archeia.com> writes:

> On 2012-12-02, Rego, P. <pvrego@gmail.com> wrote:
>> I had a very happy surprise today when I opened the MagPi issue 8 and found
>> the Ada article "Beginning Ada" by Luke Guest. And it's the second part,
>> started in issue 6 (which I had not read til today...). Congratulations!
>
> Thanks, the idea was to get Ada into the minds of kids reading that magazine
> as an additional language and to prove it can be used for beginners with no
> programming experience whatsoever.
>
> I'm also trying to think of a good project to document in the next articles, I
> have two ideas, but not sure about them. The aim would be to show the use of:
>
> 1) packages
> 2) possibly separates for platform dependencies
> 3) GNAT project files & Makefiles
> 4) Representation clauses for mapping to hardware or C API's
> 5) Maybe tasking
>
> Any ideas? It has to have a cool factor. Mine are:

The one I'm having fun with is an interface to I2C, targeted at the
MCP23017 I/O expander.

"Writeup": http://raspi-i2c-ada.sourceforge.net/
Code tip:  https://sourceforge.net/p/raspi-i2c-ada/code/ci/e83f5cbe29602a7f306dcd917d8d79c61d7c6399/tree/

At the moment it detects input changes via polling; I'm working on an
interrupt-driven variant (the nearest to interrupt-driven you'll get in
userland, anyway, I think) but I haven't pushed those changes yet.

The "interrupt" changes will be based on WiringPi at
https://projects.drogon.net/raspberry-pi/wiringpi/ and will effectively
provide an Ada interface to GPIO - I'm trying to avoid too much direct
work with GPIO in case I let the magic smoke out.

Work is a tad held up due to illness; hopefully both I and the work are
on the road to recovery!




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-02 17:19 ` Luke A. Guest
                     ` (5 preceding siblings ...)
  2012-12-10 20:12   ` Simon Wright
@ 2012-12-11 11:04   ` Jacob Sparre Andersen
  6 siblings, 0 replies; 10+ messages in thread
From: Jacob Sparre Andersen @ 2012-12-11 11:04 UTC (permalink / raw)


Luke A. Guest wrote:

> I'm also trying to think of a good project to document in the next
> articles, I have two ideas, but not sure about them. The aim would be
> to show the use of:
>
> 1) packages
> 2) possibly separates for platform dependencies
> 3) GNAT project files & Makefiles
> 4) Representation clauses for mapping to hardware or C API's
> 5) Maybe tasking
>
> Any ideas? It has to have a cool factor. Mine are:

For the "cool factor" (but maybe too large otherwise) one of my
colleagues has an Ada managed phone system running on a Raspberry Pi.
(You can call his phone queue on +45 77 34 34 20, but nobody is
answering yet. ;-)

The source code for the Ada part will be available on GitHub.

Greetings,

Jacob
-- 
"Those who profess to favor freedom and yet depreciate agitation, are
 people who want crops without ploughing the ground; they want rain
 without thunder and lightning; they want the ocean without the roar of
 its waters."                                      -- Frederick Douglas



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada on Raspberry Pi: new article in MagPi issue 8
  2012-12-10 20:12   ` Simon Wright
@ 2012-12-11 12:34     ` Simon Wright
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Wright @ 2012-12-11 12:34 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> The "interrupt" changes will be based on WiringPi at
> https://projects.drogon.net/raspberry-pi/wiringpi/ and will effectively
> provide an Ada interface to GPIO - I'm trying to avoid too much direct
> work with GPIO in case I let the magic smoke out.

I see I've already got some early code up there: [1].

The reason for going with an interface like wiringPi, by the way, is
that direct access to RPi GPIO requires root privilege. wiringPi
provides a setuid-root program gpio; it lets you - for example - access
the value on GPIO pin x at /sys/class/gpio/gpiox/value.

[1] https://sourceforge.net/u/simonjwright/wiringpi-ada/code



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-13  8:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-02  0:51 Ada on Raspberry Pi: new article in MagPi issue 8 Rego, P.
2012-12-02 17:19 ` Luke A. Guest
2012-12-02 18:23   ` tonyg
2012-12-02 18:47   ` Bill Findlay
2012-12-02 19:22   ` Shark8
2012-12-03 11:53   ` Georg Bauhaus
2012-12-04  1:44   ` Rego, P.
2012-12-10 20:12   ` Simon Wright
2012-12-11 12:34     ` Simon Wright
2012-12-11 11:04   ` Jacob Sparre Andersen

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