comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: New Ada portable GUI Library?
Date: Tue, 15 Jan 2008 09:31:06 -0800 (PST)
Date: 2008-01-15T09:31:06-08:00	[thread overview]
Message-ID: <b501522c-16ae-4448-8df5-4b79a40e8a5f@i7g2000prf.googlegroups.com> (raw)
In-Reply-To: 478cd9d8$1@news.post.ch

Martin Krischik wrote:
> Ludovic Brenta schrieb:
>
> > Martin Krischik wrote:
> >> Ludovic Brenta schrieb:
> >>
> >>> Martin Krischik wrote:
> >>>> I have another suggestion: A GUI Library based on OpenStep [1].
> >>> [...]
> >>>> [1] http://en.wikipedia.org/wiki/OpenStep
> >>> Do you mean a reimplementation of the OpenStep specification in Ada,
> >>> or an Ada binding to GNUstep (http://www.gnustep.org) ?
> >> The later. AFAIK GNUStep uses only a small message based dynamically
> >> typed API with a plain C specification. Qt and Gtk+ use huge OO API's in
> >> C++ or some kind of strange OO-C.
> >>
> >> To make use of that API easier special languages like Objective-C and
> >> Objective-C++ are used. Those languages can be implemented by a
> >> preprocessor (currently they are not) so I believe creating an
> >> Objective-Ada preprocessor should be possible - especially since Ada
> >> does not use '[' ']' and '@' ;-).
> >
> > An "Objective-Ada" preprocessor is unnecessary because Ada is already
> > object-oriented, and now even has interfaces similar to Objective-C's
> > protocols. Therefore, one would only need a binding generator that
> > would produce Ada specifications with pragma Import statements from
> > Objective-C specifications. Of course, such a binding generator would
> > have to know how the particular Objective-C compiler mangles names.
>
> Same for C++ - still they created Objective-C++. Read this Article to
> see why a static mapping won't make any sense:
>
> http://objc.toodarkpark.net/coreobjc.html#1522

I agree that a static mapping doesn't make sense; that's why I was
thinking about a binding generator. A preprocessor that takes Ada
sources with directives and produces Ada sources wouldn't cut it
because one would have to write the input files manually. The only
sensible input is the Objective-C specification files.

> Almost all the work is done by just one function: objc_msgSend. Mind
> you, just saw a little problem here. objc_msgSend is the most important
> function from OpenStep/GNUStep and it's a vararg function :-| .
>
> > The stumbling blocks would be to implement Objective-C's reflection,
> > dynamic typing and garbage collection in Ada. In particular,
> > reflection and dynamic typing are alien to Ada's philosophy.
>
> You don't - you use the objc runtime which should provide all those via
>  plain C functions.

No, because you must export callbacks from Ada so the Objective-C
libraries can call them using dynamic typing and reflection. But Ada
does not have dynamic typing or reflection. That's the problem.

> >> The advantage is that once we have an preprocessor the hole library
> >> becomes available. That's unlike Gtk or Qt where we have to write a
> >> separate binding for each class we want to use and where - forever - we
> >> will be hobbling behind.
> >
> > I don't think the preprocessor you speak of would solve anything; the
> > binding generator might but beware of the stumbling blocks I
> > mentioned.
>
> But it will solve the biggest problem: the endless amount of methods. A
> GUI lib easily got 100 classes. Defining 100 classes is doable - but
> each class will have what about 20 methods. Yes 20 is realistic for GUI
> lib. That would be 2000 pragma imports - endless work.

That's the job of the generator.

> But here comes the beauty of OpenStep: all method calls are done by
> objc_msgSend.
>
> The Objective-XXX call:
>
> [anObject setOrigin:0.0 :0.0];
>
> becomes:
>
> objc_msgSend (anObject, "setOrigin", 0.0, 0.0);
>
> And yes: that is a string. And no: it's not as slow as you think - there
> are caches employed to speed things up.
>
> >>> The latter
> >>> would require both the Ada and Objective-C runtime libraries...
> >> Indeed - but that is not different from Gtk+ and Qt approach. And bare
> >> metal is only feasible for Windows but not for X11.
> >
> > OK, Qt requires a C++ runtime like GNUstep requires an Objective-C
> > runtime. However, GTK+ only requires the C runtime
>
> That might have been the original idea, but soon they needed Glib2 - to
> make things easier. And then a few more: ATK, Cairo, Fontconfig,
> FreeType, Pango, Poppler, libPNG, libXML, libiconv, librsvg, pkg-config
> as of my last counting:
>
> http://gnuada.sourceforge.net/pmwiki.php/Main/PartnerProjects

But that is also true of the GNUstep libraries. They call them
"frameworks" and there are several of them.

> Of course, you would not notice in Debian as those libs are all part of
> the default installation - but you do on for example Solaris.

I know. Packaging nicely for your target platforms is important.

--
Ludovic Brenta.



  reply	other threads:[~2008-01-15 17:31 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12 13:37 New Ada portable GUI Library? Tomek Walkuski
2008-01-12 15:19 ` Martin Krischik
2008-01-12 18:12   ` Lucretia
2008-01-12 20:40     ` Tomek Walkuski
2008-01-12 23:01       ` Lucretia
2008-01-13  5:17         ` Vadim Godunko
2008-01-13  9:07           ` Lucretia
2008-01-13 10:49             ` Vadim Godunko
2008-01-16  9:45               ` I. Levashew
2008-01-13  8:13         ` Dmitry A. Kazakov
2008-01-13  9:11           ` Lucretia
2008-01-13 10:06             ` Dmitry A. Kazakov
2008-01-13 10:25               ` Tomek Walkuski
2008-01-13 12:36                 ` Dmitry A. Kazakov
2008-01-13 19:58                   ` Michael Bode
2008-01-13 21:00                     ` Dmitry A. Kazakov
2008-01-13 21:53                       ` Michael Bode
2008-01-14  9:11                         ` Dmitry A. Kazakov
2008-01-13 23:08                     ` Gary Scott
2008-01-13 23:31                       ` Michael Bode
2008-01-13 23:50                         ` Gary Scott
2008-01-14 19:12                           ` Michael Bode
2008-01-13 11:27               ` Lucretia
2008-01-13 11:29               ` Lucretia
2008-01-15  7:34               ` Martin Krischik
2008-01-15  8:38                 ` Ludovic Brenta
2008-01-15  8:54                   ` Martin Krischik
2008-02-11 22:10               ` Martin
2008-02-12 18:35                 ` Martin Krischik
2008-02-12 21:43                   ` Tomek Walkuski
2008-01-13 11:14           ` Martin Krischik
2008-01-13 11:31             ` Lucretia
2008-01-14 17:58             ` Ben
2008-01-14 18:21               ` Dmitry A. Kazakov
2008-01-14 20:47                 ` Gautier
2008-01-14 21:32                   ` Dmitry A. Kazakov
2008-01-13 13:28         ` Stephen Leake
2008-01-13 14:14           ` Pascal Obry
2008-01-13 14:22             ` Pascal Obry
2008-01-15  7:54               ` Martin Krischik
2008-01-16  7:54                 ` Brian May
2008-01-16  8:47                   ` Dmitry A. Kazakov
2008-01-16  8:52                   ` Martin Krischik
2008-01-16 18:26                     ` tmoran
2008-01-13 22:22           ` Lucretia
2008-01-14 10:07             ` Stephen Leake
2008-01-12 18:36 ` (slightly OT) Open Source licences? (was: Re: New Ada portable GUI Library?) framefritti
2008-01-12 18:57   ` Maciej Sobczak
2008-01-12 19:27   ` Tomek Walkuski
2008-01-12 19:39   ` (slightly OT) Open Source licences? Gautier
2008-01-12 20:26   ` Dmitry A. Kazakov
2008-01-12 21:58   ` Robert A Duff
2008-01-13  0:04   ` (slightly OT) Open Source licences? (was: Re: New Ada portable GUI Library?) Georg Bauhaus
2008-01-12 22:37 ` Georg Bauhaus
2008-01-13 11:04 ` New Ada portable GUI Library? Gautier
2008-01-15  7:56   ` Martin Krischik
2008-01-15 17:41     ` Gautier
2008-01-16  8:16     ` tmoran
2008-01-16  8:56       ` Martin Krischik
2008-01-16 19:34       ` Gautier
2008-01-16 22:51         ` Randy Brukardt
2008-01-17 20:32           ` Gautier
2008-01-18  1:41             ` Robert A Duff
2008-01-18 17:53               ` tmoran
2008-01-18 18:59                 ` Robert A Duff
2008-01-18 19:28                   ` Pascal Obry
2008-01-20 22:38                     ` Robert A Duff
2008-01-20  1:38                 ` Jerrid Kimball
2008-01-20 12:30                   ` Ludovic Brenta
2008-01-20 13:40                   ` Stephen Leake
2008-01-20 14:36                     ` Dmitry A. Kazakov
2008-01-15  8:17 ` Martin Krischik
2008-01-15  9:14   ` Ludovic Brenta
2008-01-15 10:39     ` Martin Krischik
2008-01-15 14:01       ` Ludovic Brenta
2008-01-15 16:05         ` Martin Krischik
2008-01-15 17:31           ` Ludovic Brenta [this message]
2008-01-16  8:28             ` Martin Krischik
2008-01-17  2:21   ` I. Levashew
2008-01-17  7:34     ` OpenStep/GNUStep/Cocoa (Was: New Ada portable GUI Library?) Martin Krischik
2008-01-17  9:06       ` Ivan Levashew
2008-01-17 10:25         ` Martin Krischik
2008-01-18  3:28           ` Ivan Levashew
2008-01-18  7:24             ` Martin Krischik
2008-01-15 21:51 ` New Ada portable GUI Library? Phaedrus
2008-01-16  0:04   ` Jeffrey R. Carter
2008-01-16  0:20     ` Phaedrus
2008-01-16  1:09       ` Randy Brukardt
2008-01-16  1:47         ` Phaedrus
2008-01-20 14:07 ` Andre
2008-01-21 23:14 ` Frederik Sausmikat
2008-01-27 11:26   ` Lucretia
2008-01-27 16:47     ` Gary Scott
replies disabled

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