Skip to content
Prev 20 / 1236 Next

[R-gui] Re: R-SIG-GUI digest, Vol 1 #3 - 9 msgs

(Sorry Peter, I sent my mail only to you.)

And, in the same spirit as Peter, I'll just tag my comments onto his
mail.

While Tcl/Tk is the best tested of the R gui bindings, that is
partially because it was added directly to the R source rather than
provided as a package as the other interfaces have.  As a result, it
has received a lot of attention on the configuration aspects,
etc. from developers and users. I think it would be very useful to
give some of the other packages the same sort of attention. 

As Tony Rossini mentioned, there is the RGtk package which 
provides an S-language connection to the Gtk widgets and event
handling, etc.

There were several reasons for doing the Gtk bindings for R.  I
believe that Gtk has far more momentum than Tk or indeed many other
toolkits. As the cornerstone of Gnome, it gets a lot of attention and
a multitude of new widgets that are added externally or in Gtk 2.0,
etc.  The fact that Sun and HP (I think my memory is correct) have
announced that they will use Gnome as their desktop in the next major
release of their OSes illustrates that there is some belief it will be
here for a while and get more attention.  It might be a little
simplistic, but one might say that Tk is tried and established but old
and Gtk/Qt/Cocoa, etc. are the new and modern toolkits that will be
with us for the medium term.

 The connectivity with the different Gnome tools such as Gnumeric,
AbiWord, Dia, etc. makes it easy for us to develop plugins written in
R for those applications. This essentially allows us to put statistics
into everyday office applications. (The use of XML also helps here a
lot since that is the output format these tools use.)  One of the
benefits of Gtk is that it provides compile time and run-time
reflectance, so the bindings (and future bindings) are generated
automatically with S code. There is no manual effort needed.

I have used the Gtk mechanism to get the Rggobi link working.  Also,
with the connectivity to Gnome, the Orbit/CORBA connection is
relatively natural (and hence structured high-level distributed
computing). 


Tk is not a bad toolkit at all but the extensions are a lot more
decentralized than those for Gtk. One of the main problems with using
Tk I feel is that we have to go through Tcl. That is not an ideal
programming language for our purposes by any stretch of the
imagination. Indeed, we have a language that we can assume all the
players involved are familiar with - i.e. S itself.  Scripting is
essential, but scripting in a lot of different and less familiar
languages won't make it easy for a community to move forward and
maintain any GUI material we develop.  There are not very many large
applications built on Tk relative to the number of professional Gtk
applications.  

We already have a Gtk graphics device as a separate package.  GtkHTML
and Mozilla Embedded provide different HTML renderers.  Deb Nolan and
I have been using GtkHTML to display documents that contain arbitrary
Gtk widgets, giving us live interactive documents that make nice
interfaces for teaching or interactive publishing.  One can use
gtk+extra to implement a data editor. Alternatively, we have RGnumeric
which allows us embed R in the Gnumeric spreadsheet. 


So what Peter said is absolutely the most important thing to focus on:
This is key. No matter what each of us believes about the merits of
the different toolkits, as a community, we will need probably all of
them, i.e. Tk, Gtk, Cocoa, Swing and probably Qt (which we can
probably generate automatically using SIP).

What we should probably move forward on is developing small
stand-alone tools that we can combine into an IDE.  As we develop
invividual tools such as object browsers (see BioConductor), code
displays, debuggers, model builders, etc., the different idioms will
become apparent and we can figure out the abstractions for the S
language level.  And we will get an understanding of what the tools
should look like. (If they aren't programmed in S, I imagine fewer
people will experiment with modifying them and trying new interface
designs.  So it would be good to use the existing toolkits if possible
or work on providing bindings for them.)

Building a complete system and expecting others to adopt it as the
"unique" GUI is likely to be unsuccessful because of all the pratical
problems people have mentioned. There are too many diverse user
communities and applications within the R world.  Building an
abstraction for the existing toolkits so that one can use essentially
the same code with different toolkits attached would be a great
achievement and set us up for whatever new toolkits come in the
future.

One technical step in the abstraction is the ability to handle
different event loops within R, e.g to use Tk's, Gtk's or Carbon's
event loop.  There is an experimental package - REventLoop - at
http://www.omegahat.org/REventLoop that does this.  If people could
give it a try and let me know what problems (or success) they
encounter, we can push on integrating that into R itself and getting
it running with the Windows and Carbon event loop.s


One other remark since I don't get much time to write these mails and
it came up in somebody's mail on this last last week.  The need for
pipes, etc. to communicate between the GUI and R doesn't seem like a
necessary or good approach. Tk, Gtk, etc.  are all accessible directly
in R and can callback to S functions, etc. We don't want to be
communicating with R commands sent as strings.  This is a very
limiting and tedious design. All the escaping that Peter mentions in
the tcltk package illustrates the problems with dealing with a
programming language entirely in strings. There are many computations
one simply cannot do, and even more that are very cumbersome because
of that interface.

Sorry for the length of the mail. 

 D.
Peter Dalgaard BSA wrote:

  
    
Message-ID: <20021017135308.A5060@jessie.research.bell-labs.com>
In-Reply-To: <x27kgh3whp.fsf@biostat.ku.dk>; from p.dalgaard@biostat.ku.dk on Thu, Oct 17, 2002 at 05:39:46PM +0200