comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: ada without ada libraries?
Date: Wed, 08 Feb 2012 09:10:24 +0000
Date: 2012-02-08T09:10:24+00:00	[thread overview]
Message-ID: <m2ty314rnj.fsf@pushface.org> (raw)
In-Reply-To: eecf117d-e86f-45d0-b6ed-50931273e858@h6g2000yqk.googlegroups.com

Patrick <patrick@spellingbeewinnars.org> writes:

> I just got my compiler set up the way I want it and I am ready for my
> first ada project.
>
> I have spent sometime with lua. Lua's library support is terrible but
> lots of people love the language. Many people just build a rough
> skeleton application in C and call it from lua.
>
> Lua handles all the type checking and much of the logic in this
> arrangement and C is mostly just library code.
>
> Would this same approach seem logical for ada? -Patrick

It doesn't really seem logical for C! Perhaps I've misunderstood you.

I don't know Lua, but I do know Tcl, and the approach I've adopted is to
write the application engine, if you will, in Ada and the controls in
Tcl. The application engine can be very complicated, but the controls
are usually simple.

An example: this proc runs every 100 ms to see whether each of 4 lamps
should be lit or not. The Ada part of the app presents the function
getLampState which takes a string (the name of the lamp) and returns a
boolean (0 or 1, I expect) saying whether it should be lit. The GUI is
written in Tcl[/Tk], which it's good at, and the complex timing logic
about when the lamps should be lit is left to the Ada.

   proc checkLampProc {} {
       foreach l {a b c d} {
           set s [getLampState $l]
           if {$s} {
               .c itemconfigure $l -fill yellow
           } else {
               .c itemconfigure $l -fill gray
           }
       }
       after 100 checkLampProc
   }



  parent reply	other threads:[~2012-02-08  9:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 21:14 ada without ada libraries? Patrick
2012-02-08  2:04 ` BrianG
2012-02-08  3:11 ` Gautier write-only
2012-02-08  8:35 ` tonyg
2012-02-08  9:10 ` Simon Wright [this message]
2012-02-08 12:02 ` Stephen Leake
2012-02-08 13:07   ` Dmitry A. Kazakov
2012-02-08 21:10     ` Patrick
2012-02-08 21:39       ` Gautier write-only
2012-02-09  2:11       ` Shark8
2012-02-09  2:08     ` Shark8
2012-02-09  3:43       ` Jeffrey Carter
2012-02-09  4:17         ` Shark8
2012-02-09 12:26         ` mockturtle
2012-02-09  8:34       ` Dmitry A. Kazakov
2012-02-09  9:55         ` Yannick Duchêne (Hibou57)
2012-02-09 10:45           ` Dmitry A. Kazakov
2012-02-09 11:08             ` Gautier write-only
2012-02-09 13:48               ` Georg Bauhaus
2012-02-09 14:17                 ` Yannick Duchêne (Hibou57)
2012-02-09 14:05               ` Yannick Duchêne (Hibou57)
2012-02-09 16:47               ` Pascal Obry
2012-02-09 17:03                 ` Yannick Duchêne (Hibou57)
2012-02-09 17:08                   ` Yannick Duchêne (Hibou57)
2012-02-09 17:26                   ` Pascal Obry
2012-02-10  0:51                     ` Randy Brukardt
2012-02-09 17:31                   ` Dmitry A. Kazakov
2012-02-09 13:42             ` Yannick Duchêne (Hibou57)
2012-02-09 14:40               ` Dmitry A. Kazakov
2012-02-09 15:50                 ` Yannick Duchêne (Hibou57)
2012-02-09 17:21                   ` Dmitry A. Kazakov
2012-02-09 17:44                     ` Yannick Duchêne (Hibou57)
2012-02-10  0:56                 ` Randy Brukardt
2012-02-10  9:38                   ` Dmitry A. Kazakov
2012-02-14 19:08                 ` Yannick Duchêne (Hibou57)
2012-02-09 13:42             ` Yannick Duchêne (Hibou57)
replies disabled

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