Newsgroups: sci.stat.math,comp.ai.neural-nets
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!news.ravenet.com!not-for-mail
From: Bob Wheeler <bwheeler@echip.com>
Subject: Re: Programming languages for statistics Was: Re: The book I want to buy
Message-ID: <NEWTNews.820090041.26065.bwheeler@bwheeler>
Date: Wed, 27 Dec 95 09:36:57 PDT
X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
References: <Pine.OSF.3.91.951218085742.23544B-100000@io.UWinnipeg.ca> <4b7obs$e9k@wugate.wustl.edu> <4b9qju$ph7@news.cis.okstate.edu> <95Dec20.164741edt.1092@neuron.ai.toronto.edu>  <4bbqss$1j2u@b.stat.purdue.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Lines: 54
Xref: glinda.oz.cs.cmu.edu sci.stat.math:8529 comp.ai.neural-nets:28869


> 
> You and I agree completely on this.  C++ does allow existing operators
> to be defined for "classes", and many "standard" C++ implementations
> have complex arithmetic libraries.
> 
> I have been unsuccessful in persuading computer scientists that 
> syntax is important, not just semantics.  C++ does not allow the
> introduction of new operators, and there are few languages which
> do allow that.  The pow function in C++ could be overloaded, so
> that the equation could be written in that as
> 
> 	   a = a + b*c + 5*pow(d,2),
> 
> which will work.
> 
> However, there are computer macro modifications which could be
> carried out.  If enough people (or even one person with the right
> contacts) pushes for these, it will be done.
> 
> -- 
> Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
> hrubin@stat.purdue.edu	 Phone: (317)494-6054	FAX: (317)494-0558
> 
>

In elaboration:

A computer language is not a mathematical notation, although it can
appear at first glance to be so. Most computer languages have a notation
that roughly corresponds to arithmetic, but the correspondence
is not what it at first appears.  Addition of integers, for example, is 
modulo the word length of the machine, and adding big real numbers to small
real numbers can result in a value equal to the big number.

Many who program are uncomfortable with FORTRAN because it obscures this
difference.  It derives from an era in which the necessity for the 
distinction was not as apparent as it is now.  At the present time,
most programmers are very concerned with the reliability of their code,
and place great emphasis on being sure that they are calculating what
they intend. 

The power operation is trickier than the addition operator or
multiplication operation, and good programming practice dictates
that one pay it special attention.  It saves time and frustration if
one is sure what the compiler is being asked to do.  The ability
of FORTRAN to deal with d**b for a wide range of values for d and
b is not always an advantage. It can result in inefficient code,
as when the compiler chooses to interpret this as exp(b*log(d))
in the middle of an iteration loop, when in fact b assumes the
value 2.


	Bob Wheeler, ECHIP, Inc.




