From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,508516c114ade8e1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.238.198 with SMTP id vm6mr16459645pbc.3.1328692225467; Wed, 08 Feb 2012 01:10:25 -0800 (PST) Path: wr5ni640pbc.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ada without ada libraries? Date: Wed, 08 Feb 2012 09:10:24 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="31501"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DD8FonSHCjIi7QEi3+T/89GnWEYoTgfg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:+aGJe+Y7hsd6uMUlfvNIaogHkmw= sha1:wH2ahWi3K/2RN2j0dtzKmun1X2Q= Content-Type: text/plain; charset=us-ascii Date: 2012-02-08T09:10:24+00:00 List-Id: Patrick 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 }