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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8b7e315279c3f417 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.80.200 with SMTP id t8mr3423710pax.1.1355734748491; Mon, 17 Dec 2012 00:59:08 -0800 (PST) Path: s9ni49636pbb.0!nntp.google.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!nuzba.szn.dk!pnx.dk!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Library, called, returns and continues ? Date: Mon, 17 Dec 2012 09:59:58 +0100 Organization: cbb software GmbH Message-ID: References: <5ced9166-5a29-4ad2-8270-6d24ddd0d0a1@googlegroups.com> <1rz66cdo8v1hv.j9eyg9eqqide$.dlg@40tude.net> <87db4d95-56ce-4254-8031-7bbbea515ff3@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-12-17T09:59:58+01:00 List-Id: On Sun, 16 Dec 2012 15:13:06 -0800 (PST), Patrick wrote: > I am intimidated with the QT, GTK and WxWidgets landscape right now. Well, there is a reason for that. GTK and Qt are trying to provide an OS-independent layer which brings pretty much everything with it. > I have been focusing on FLTK, Fox, Tk and don't laugh but Xforms. At under > 100K lines of code(Tk is a little more) 100K lines of GUI code or 100K lines altogether? Anyway it is unrealistic to hope that you could keep your code tight when using an alien non-Ada library. Code reduction can only be achieved when the library has a native Ada interface and deploy OO techniques at full. > It may be trivial but once I am able to call entries I can turn a single > threaded application into a multi-threaded one. No, that would not if you did all work during the entry call (rendezvous). Because then both the caller and the callee tasks stayed synchronized. GUI libraries are event-driven, it is a wholly different model which is inherently synchronous. Calls to entries initially change nothing. You have to design the GUI in a completely different manner, which is necessarily complex because does not fit into the model. > One communication channel > back that I am considering is returning a string that would contain code > that an interpreted language could eval. You also need to block the Ada task until its return is accepted or else implement a queue of requests (blocking upon queueing the request). You also need support for unsolicited calls from Ada tasks. Consider a progress bar indicator driven by an Ada task. At some point it should send a message to the main thread to update the bar state. The main thread has no idea about when and if that could happen. An alternative solution (used in RT systems) is polling. This is sometimes simpler to implement for small atomic objects, but it makes GUI design even more complicated. > I know eval is evil but if used > sparingly I think it could be quite powerful No, it is not. Think about passing parameters forth and back within the string. You will have to bind them to some local variables. If that looks simple to you, look at ODBC and other DB interfaces using SQL. They have exactly this problem - dressing proper calls into an interpreted SQL string. The result is utter mess. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de