[R-SIG-Mac]Mac OS X version of R

Byron Ellis bellis@hsph.harvard.edu
Sat, 31 Aug 2002 13:29:01 -0400

On Saturday, August 31, 2002, at 12:50 AM, Jan de Leeuw wrote:

> It seems clear by now that there are (at least) two approaches to  
> writing
> R for OS X. I think we will see both, at some point.
> 1. Make a Cocoa application that communicates with R in some way or
> another. Jose's version uses pipes, but a nicer alternative is perhaps  
> to use
> Cocoa distributed processes. The Cocoa application will be written in
> Objective C, and will not run on OS 9. It will use ProjectBuilder. We
> may need three Cocoa applications, all able to send and receive
> messages. The first is the R GUI, the second is the R computing
> engine, and the third is the Quartz graphics device. See
> http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ 
> ProgrammingTopics/Networking/Concepts/DistributedObjects.html#BCIBEGAC
> This will be a standalone R, not fitting very well in the R-core
> build and upgrade strategy, but it will be able to use all the
> facilities of Cocoa and Objective C.
> This is also the way TeXShop works, providing a Cocoa interface to
> an unmodified teTeX (using pipes).

While it doesn't fit into the standard way of building the R-core it 
could be in the build path without trouble. Additionally, the 'R daemon' 
model is generally interesting on all platforms since this is, AFAIK, 
essentially the model employed by Mathematica. It becomes especially 
interesting when Rpvm and clusters are tossed into the mix.

As for the graphics device, it may be easier to simply have two 
applications--- the GUI, which also manages the Quartz device and R with 
a 'pipe' graphics device that serializes graphics instructions to the 
terminal (and hence, pipe)---for instance, ESC commands like those found 
in VT*/ANSI (IIRC there are actually standards that allow for line 
drawing via VT*-like commands...Tektronix maybe? I don't remember)

> 2. Make a OS X GUI for R along the lines of the gnome or windows
> GUI's. This just adds a new GUI to R, using R calling conventions.
> It uses makefiles, it will probably be written in C, and it will  
> consequently
> tend to use Carbon. This is what Stefano is working on. Obviously this
> is faster to build, easier to maintain, and it fits in the R-core 
> build  and
> update strategy. It will also run on older Macs and OS 9.

> 3. There are some other options. These examples are well worth studying.
> 3a. Take Python. It can optionally be build as a
> framework, with all of Unix python in it, installed in  
> /Library/Frameworks.
> Links to the executables are made in /usr/local/bin. Carbon and
> Cocoa applications are put in /Applications/Python (an IDE,
> an AppletBuilder and a Launcher) -- these all link to the framework.
> I am not sure what form of IPC they use. Anonymous CVS from
> :pserver:anonymous@cvs.python.sourceforge.net:/cvsroot/python
> configure --enable-framework
> make
> (sudo) make frameworkinstall

Are they using the Python interpreter or simply linking the Framework to 
effectively embed Python? It sounds like the latter...

> 3b. Take Emacs. You build a regular Emacs, the Lisp files are
> installed in /usr/local/share, a Carbon bundle around the
> binary Emacs is put in /Applications. Anonymous CVS from
> :pserver:anoncvs@subversions.gnu.org:2401/cvsroot/emacs
> configure --without-x
> make bootstrap
> make install
> cd mac
> make-package

> 3c. Take Tcl/Tk. It puts all of Tcl in a framework and all of Tk in
> a framework, and then buildsa little application around this
> (Wish). This is native (Aqua) Tk.
> :pserver:anonymous@cvs.tcl.sourceforge.net:/cvsroot/tcl
> :pserver:anonymous@cvs.tcl.sourceforge.net:/cvsroot/tktoolkit
> 3.cc You cannot get the source for AlphaTk, which uses the
> Tcl/Tk frameworks, and has all the tcl scripts that make up
> the editor in its bundle. See
> http://www.santafe.edu/~vince/Alphatk.html
> ===
> Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
> US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
> phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
> homepage: http://gifi.stat.ucla.edu
> ------------------------------------------------------------------------ 
> -------------------------
>           No matter where you go, there you are. --- Buckaroo Banzai
>                    http://gifi.stat.ucla.edu/sounds/nomatter.au
> ------------------------------------------------------------------------ 
> -------------------------
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/r-sig-mac
Byron Ellis (bellis@hsph.harvard.edu)
"Oook" - The Librarian