Re: [gtk-list] Re: I want to understand




> The reason language bindings are easy to write for Gtk is not that it's
> written in C per se (though that helps some), but rather that it
> implements its own custom object/type/signal system in C. This system is
> extremely flexible; scripting languages can query and alter all sorts of
> things on the fly.  So Gtk already handles a lot of the annoying framework
> you need when dealing with dynamically-typed or garbage collected
> languages, and its object system is flexible enough that you could
> conceivably add new object subclasses written in the other language,
> though not all the bindings support this.

All of the above can be and should be done in a genuine OO language that
contains dynamic typing.

Maybe you can tell me why the kit can't be written in C++ using CORBAs
messaging model ? It seems like the same thing to me. Speed issues ?

> Understanding why this is true requires spending a lot of time with
> gtktypeutils.c, gtksignal.c, and gtkobject.c. It's not documented so well.
> guile-gtk has a README that's the closest thing to type system docs.
> I'm not sure I understand it 100%, but if you dig around in that code some
> you'll begin to appreciate it.
> 
> You could obviously implement this in C++, since you can implement it in
> C, but the point is that you can't just use the C++ object system, because
> C++ has a static, compile-time object system (for the most part). Since
> you'd be reimplementing an object system anyway, C++ doesn't get you as
> far as you might think.

COM uses "vtable" manipulation of C++ virtual function pointers at library
load time ( ugh, ;-) ).

Then why wasn't it written in a genuine dynamically typed language ?

> Remember: no C/C++ flamewars here. Keep it on-topic about Gtk+. :-)
> 
> Havoc

bill



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]