comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Properties
Date: Wed, 1 Dec 2010 19:22:11 +0100
Date: 2010-12-01T19:22:10+01:00	[thread overview]
Message-ID: <1u5dftkqqi68c.10079qnqyyfwb$.dlg@40tude.net> (raw)
In-Reply-To: Xns9E417369AD1F4WarrensBlatherings@81.169.183.62

On Wed, 1 Dec 2010 16:20:44 +0000 (UTC), Warren wrote:

> Dmitry A. Kazakov expounded in
> news:1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net: 
> 
>> On Wed, 1 Dec 2010 15:21:39 +0000 (UTC), Warren wrote:
>>> A library designed in Ada from the ground up, would be
>>> better. 
>> 
>> But we cannot, think about a type- and task-safe
>> notification mechanism. I have no idea how to do it without
>> tagged tasks and protected objects. 
> 
> Perhaps the scope you have in mind is too large. Is it really 
> necessary to have the GUI operate outside of one task?

Affirmative. Consider an oscilloscope widget indicating real-time data.
Consider a debug window showing log messages from different tasks. The
worst thing of GTK is that it is not task-safe.

> Leave the task handling to the application designer.

Obtrusive and inefficient. I did it for GtkAda. It is quite uncomfortable
to use, and if you forget to route GTK requests to the main task, you get
sporadic crashes difficult to trace down, quite nasty.

>> And I don't want to
>> instantiate a generic each time I need an event handler.
> 
> Agreed, but I don't believe we're stuck with that solution. 
> All you need is procedure'Access for the callback.

No, because events have parameters and those must be typed. The standard
solution is that you instantiate a generic (and there is one for each
number of parameters and the results). That is extremely boring.

>> And I do want the compiler to check that all events are
>> handled. 
> 
> Hmmm, more of a scope problem, I think.  Your requirements may 
> be part of the problem.

But otherwise you would have to frantically search for the handler that
caught the event you expected the widget to propagate, just to learn that
the widget does not propagate it at all. Even better if you create an
events generator that covers all desktop with multiplying pop-up windows. I
hate this stuff.

>> At least
>> the first and the third must be statically checked, if we
>> really want it be Ada. 
> 
> Callbacks (events) are dynamic by nature. I think the best you 
> can hope for is that your event handler is the correct kind 
> (of callback) and that any parameters match are of the correct 
> type. Both areas that Ada excells at.
> 
> Asking for more than that, is perhaps a requirements problem.

Maybe, but I expect excellence from a standard library.

>> Very likely that some composite
>> widgets (the second hierarchy) should also be static. 
> 
> I think tagged records are going to be the only real solution 
> here, which is going to forgo static analysis.

Yes, this is my impression too.

> I think a tagged solution is at least as good as a C++ 
> solution, but better due to Ada strengths.  I think many folks 
> could live with the dynamic nature of an Ada GUI library.

BTW, most likely multiple inheritance will be needed. There is a huge
resistance to MI in Ada. I have no idea why, nobody managed to articulate
anything but prejudices and urban legends.

> It really comes down to what is "good enough" for a standard 
> GUI library. Your requirements are desirable, but with 
> existing software technologies, it doesn't appear practical 
> AFAICS.

They are practical at least in pushing Ada into a right direction. (I
guess, the reason why I agree with Randy most of the time is because he
maintains CLAW and I do the GtkAda contributions. This keeps us on the same
page.)
 
> Are there any GUI systems implemented that are fully static 
> checked?

I guess no.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-12-01 18:22 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28  3:21 Properties Shark8
2010-11-28  8:15 ` Properties Dmitry A. Kazakov
2010-11-28 19:43   ` Properties Shark8
2010-11-29  8:34     ` Properties Dmitry A. Kazakov
2010-12-01 18:15       ` Properties Shark8
2010-11-28 12:37 ` Properties Georg Bauhaus
2010-11-28 21:22   ` Properties Shark8
2010-11-29 16:54     ` Properties Georg Bauhaus
2010-12-01 19:52   ` Properties Martin Krischik
2010-12-01 23:24     ` Properties Georg Bauhaus
2010-12-05 16:15       ` (placepo) Properties Martin Krischik
2010-12-06 23:24         ` Shark8
2010-12-01 23:31     ` Properties Georg Bauhaus
2010-11-30  1:49 ` Properties Randy Brukardt
2010-11-30 16:58   ` Properties Charmed Snark
2010-11-30 17:22     ` Properties Dmitry A. Kazakov
2010-11-30 20:27       ` Properties Warren
2010-12-01  8:39         ` Properties Dmitry A. Kazakov
2010-12-01 15:21           ` Properties Warren
2010-12-01 15:59             ` Properties Dmitry A. Kazakov
2010-12-01 16:20               ` Properties Warren
2010-12-01 18:22                 ` Dmitry A. Kazakov [this message]
2010-12-01 19:36                   ` Properties Shark8
2010-12-01 21:13                     ` Properties Dmitry A. Kazakov
2010-12-01 21:35                   ` Properties Maciej Sobczak
2010-12-01 21:45                     ` Properties Dmitry A. Kazakov
2010-12-02  9:57                       ` Properties Maciej Sobczak
2010-12-02 10:26                         ` Properties Dmitry A. Kazakov
2010-12-02 15:25                           ` Properties Maciej Sobczak
2010-12-02 15:46                             ` Properties Dmitry A. Kazakov
2010-12-02 21:11                               ` Properties Maciej Sobczak
2010-12-02 22:19                                 ` Properties Dmitry A. Kazakov
2010-12-03  4:43                                 ` Properties Randy Brukardt
2010-12-03 13:53                                   ` Properties Maciej Sobczak
2010-12-03 21:32                                     ` Properties Randy Brukardt
2010-12-04 22:13                                       ` Properties Maciej Sobczak
2010-12-06 23:30                                         ` Properties Shark8
2010-12-06 23:33                                         ` Properties Randy Brukardt
2010-12-04 17:43                           ` Properties Simon Wright
2010-12-04 20:48                             ` Properties Dmitry A. Kazakov
2010-12-04 22:27                               ` Properties Simon Wright
2010-12-04 22:31                                 ` Properties Vinzent Hoefler
2010-12-03  4:24                         ` Properties Randy Brukardt
2010-12-03  5:00                         ` Properties Shark8
2010-12-03 21:10                           ` Properties Randy Brukardt
2010-12-03 23:34                           ` Properties Jeffrey Carter
2010-12-06  6:02                             ` Properties Brad Moore
2010-12-06 23:25                               ` Properties Shark8
2010-12-01 19:48                 ` Properties Randy Brukardt
2010-12-01 21:10                   ` Properties Warren
2010-12-02  0:03                     ` Properties Shark8
2010-12-02 16:45                       ` Properties Warren
2010-12-02 17:32                         ` Properties Dmitry A. Kazakov
2010-12-02 20:45                           ` Properties Warren
2010-12-02 21:17                             ` Properties Adam Beneschan
2010-12-02 21:40                               ` Properties Warren
2010-12-03  3:34                             ` Properties Shark8
2010-12-03  8:16                               ` Properties Thomas Løcke
2010-12-02 20:52                           ` Properties Pascal Obry
2010-12-02 19:46                         ` Properties Adam Beneschan
2010-12-02 20:38                           ` Properties Warren
2010-12-02 21:39                             ` Properties Jeffrey Carter
2010-12-02 21:55                               ` Properties Warren
2010-12-03  9:33                               ` Properties Anonymous
2010-12-03  3:47                           ` Properties Shark8
2010-12-03  0:09                         ` Properties Robert A Duff
2010-12-03 15:49                           ` Properties Warren
2010-12-03 20:07                             ` Properties Shark8
2010-12-06 21:01                               ` Properties Warren
2010-12-06 23:22                                 ` Properties Shark8
2010-12-07 14:37                                   ` Properties Warren
2010-12-08 21:13                                   ` Properties Simon Wright
2010-12-09  1:21                                     ` Properties Shark8
2010-12-06 23:43                                 ` Properties Randy Brukardt
2010-12-07  0:56                                   ` Properties Jeffrey Carter
2010-12-07 11:23                                   ` Properties Maciej Sobczak
2010-12-07 11:51                                     ` Properties Georg Bauhaus
2010-12-07 15:35                                       ` Properties Maciej Sobczak
2010-12-07 17:02                                         ` Properties Georg Bauhaus
2010-12-07 14:39                                   ` Properties Warren
2010-12-03 15:40                         ` Properties Warren
2010-12-03 19:56                           ` Properties Shark8
2010-12-03 20:12                             ` Properties Warren
2010-12-03  5:53               ` Properties Shark8
2010-12-03  9:05                 ` Properties Dmitry A. Kazakov
2010-12-03 19:52                   ` Properties Shark8
2010-12-03 21:14                     ` Properties Randy Brukardt
2010-12-04  5:35                       ` Properties Shark8
2010-12-04 14:23                         ` Properties Peter C. Chapin
2010-12-04 18:53                           ` Properties Shark8
2010-12-13 15:10                       ` Properties Brian Drummond
2010-12-03 22:38                     ` Properties Dmitry A. Kazakov
2010-12-04  3:12                       ` Properties Shark8
2010-12-04 13:19                     ` Properties Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2010-12-04 19:53 Properties Shark8
2010-12-04 23:27 ` Properties Thomas Løcke
replies disabled

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