From sdm7g@virginia.edu Sat Mar  7 08:01:30 CST 1998
Article: 31958 of comp.lang.python
Newsgroups: comp.lang.python
Path: uuneo.neosoft.com!ultraneo.neosoft.com!news2.amd.com!txnntp.amd.com!canntp.amd.com!news.amd.com!decwrl!spool.mu.edu!uwm.edu!news-penn.gip.net!news-peer.gip.net!news.gsl.net!gip.net!news.idt.net!woodstock.news.demon.net!demon!bullseye.news.demon.net!demon!sun4nl!news.Amsterdam.NL.net!cwi.nl!python-list-request
From: "Steven D. Majewski" <sdm7g@virginia.edu>
Subject: Re: Tcl vs. Python for Scripting C Statistical Library
In-Reply-To: <ydxvhtrxz0h.fsf@hustat.harvard.edu>
X-Sender: sdm7g@elvis.med.Virginia.EDU
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.A32.3.96.980306173909.19400B-100000@elvis.med.Virginia.EDU>
Sender: daemon@cwi.nl (0000-Admin(0000))
Organization: CWI, Amsterdam
References: <ydxvhtrxz0h.fsf@hustat.harvard.edu>
Mime-Version: 1.0
Date: Fri, 6 Mar 1998 23:31:18 GMT
Lines: 72
Xref: uuneo.neosoft.com comp.lang.python:31958



Tcl is a simpler, minimal language. 
If most of your app is written in C and you just need to wrap a 
programming language around it, then Tcl provides the bare 
necessities: parsing, assignment/binding of variables, control 
structues. You'll probably find Tcl simpler and easier to understand
and embed and interface to your C modules. Also: if you want to
invent your own syntax, Tcl imposes fewer constraints. 


If you want to write a large part of the application in the target
language, then Python provides more for you to use -- it's a more
"full featured" programming language. If fact, with the numerical
extensions, you may not even have to write any C code at all. 


Tools like SWIG <http://www.swig.org/> even out some of the job of
interfacing to native libraries. 


Both Tcl and Python have early versions of rewrites in Java 
( JACL and JPython ) as well as experiments in combining a JVM
with the original C implementations. ( But if you want to add 
your C libraries to the Java VM, then be warned that dealing with
Native Code from Java the "standard" way is more complicated than
either Python or Tcl. ( There is a Java module for SWIG, but I
haven't used it and I don't know how functional it is at the present. ) 

[ See the www.python.org & sunscript.sun.com web sites for more info.] 


If you're doing statistics, you might also take a look at XlispStat 
<http://www.stat.umn.edu/~luke/xls/xlsinfo/xlsinfo.html> - a 
statistics package written in a Lisp implementation enhanced with
graphics, vector arithmatic, and some matrix and statistical functions
in the native code library. 

The latest version has a new shared library system and a SWIG-like
automated wrapper writer 
http://www.stat.umn.edu/~luke/xls/projects/wrappers/wrappers.html

[ Example: the following wrapper definition:

  (wrap:c-lines "extern double fred;"
              "int cfrog (int, int);")
  (wrap:c-variable "fred" :flonum (:get get-fred) (:set set-fred))
  (wrap:c-function frog "cfrog" (:integer :integer) :integer)

will, when run thru make-wrappers, produce a C source file with 
all of the glue code to provide a lisp callable interface to 
set/get the global value 'fred' and to call the function cfrog. ] 

The interactive statistical graphics in XlispStat are more 
mature and higher level than what's available for Python or Tcl,
however, the disadvantage is that higher-level graphics aren't 
accessable at lower levels, and if you want to do something it 
wasn't designed to do, it is difficult. ( However, what it was 
designed to do, it does very well: you can generate 3-d spinning
plots, link data points in several plots ( so if you select the
outlier points in one graph, you can see those points selected 
in other graphs. ). But, for example, if you want to put a GIF
image in the background behind your data plots, you have to do
some magic beneath the high-level graphics level. ) 


---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---
All power corrupts and obsolete power corrupts obsoletely." - Ted Nelson



