Re: Plans for 2.8 - GNOME Managed Language Services?
- From: Laurent Sansonetti <lrz gnome org>
- To: Havoc Pennington <hp redhat com>
- Cc: Murray Cumming <murrayc murrayc com>, "desktop-devel-list gnome org" <desktop-devel-list gnome org>, "language-bindings gnome org" <language-bindings gnome org>
- Subject: Re: Plans for 2.8 - GNOME Managed Language Services?
- Date: Sat, 27 Mar 2004 21:49:12 +0000
On Fri, 2004-03-26 at 17:07, Havoc Pennington wrote:
> I don't know, basically just look at how we can better automate bindings
> along the lines of XPCOM/UNO. Add some cheesy component-system style
> features to GObject.
>
> I'm looking for practical easy steps forward here.
I don't think code generation is appropriate for complex languages, like
Ruby for instance.
In Ruby-GNOME2 we don't use generated code at all. We prefer writing
almost all the API manually, to provide a 100% Ruby compliant API.
(some stuff are automatically generated at runtime, like properties
accessors, signals, enumerations/flags, GObject inheritance, etc... but
the rest is done by hand)
Just as an example, with Ruby/GStreamer you can actually do this:
src = Gst::ElementFactory.make('filesrc')
src.location = "/tmp/foo.mp3"
dec = Gst::ElementFactory.make('mad')
sink = Gst::ElementFactory.make('osssink')
src >> dec >> sink
pipe = Gst::Pipeline.new
pipe.add(src, dec, sink)
pipe.play
# ...
pipe.each_element { |element| ... }
And with Ruby/Libgda:
Gda::Client.new.open_connection('my_datasource') do |conn|
conn.execute_command(...)
# the connection will be automatically
# disconnected at the end of this block
end
Of course there are similar issues with other libraries, such as
Ruby/GTK, Ruby/Libglade, etc...
This kind of stuff is impossible to have with generated code.
--
Laurent
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]