Re: Plans for 2.8 - GNOME Managed Language Services?

Laurent Sansonetti <[email protected]>
Newsgroups gmane.comp.gnome.desktop,gmane.comp.gnome.language-bindings
Message-ID <1080424152.14770.28.camel@natalie>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.