[MATRIX-SIG] random number generator?

David J. C. Beach beach@verinet.com
Wed, 29 Oct 1997 17:08:52 -0700


This is a multi-part message in MIME format.
--------------47829609CB1559D129ECD9EA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



--------------47829609CB1559D129ECD9EA
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <3457CF32.95F4DEF2@verinet.com>
Date: Wed, 29 Oct 1997 17:05:06 -0700
From: "David J. C. Beach" <beach@verinet.com>
Organization: Colorado State University
X-Mailer: Mozilla 4.03 [en] (X11; I; Linux 2.0.30 i686)
MIME-Version: 1.0
To: Geoffrey Furnish <furnish@acl.lanl.gov>
Subject: Re: [MATRIX-SIG] random number generator?
References: <Pine.PMDF.3.91.971026221601.541164928A-100000@Pap.UniVie.AC.AT>
		<3453CFE1.6782A603@verinet.com>
		<199710291602.JAA00946@steam.acl.lanl.gov>
		<34577A96.23FAD443@verinet.com> <199710291927.MAA01336@steam.acl.lanl.gov>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Geoffrey Furnish wrote:

Regarding your argument that a += 1 is inherently faster than a = a + 1, I urge
you again to examine FORTRAN.  ANY good FORTRAN compiler WILL make that
optimization.  I promise you that there's nothing inherently faster about one
than the other.  If your C and C++ compilers aren't doing that for you, it could
be for one of two reasons:

1) the compiler you are using is optimization shy.

2) C has a long history of forcing programmers to make optimizations
themselves.  Look at the keyword 'register', and the new 'inline' directive in
C++.  Look at the ++, --, +=, *=, /=, -=, etc. operators.  These all make the
language bigger, and encourage the programmer to opimize his/her code using
language tricks.  This in no way improves readability, and optimizations of this
type are something that can (and should) be done by the compiler, NOT the
programmer.

>  > I'm pretty willing to bet that the Python language as a whole more
>  > than stands up to C or C++.
>
> I certainly do not view Python as a credible threat to C++.  Nor do I
> view C++ as a credible threat to Python.  That's why I use them
> together.

No no no.... Python will probably never be a threat to C++.  Obviously Python is
an interpreted language and C++ is a compiled language.  These two different
tools can often be complimentary as you pointed out.

HOWEVER, I do feel that C++ is just plain gross when it comes to syntax and
consistency.  Maybe if I had money to shell out, I'd see the brighter side of
things, but all I've had to work with is the g++ compiler.  I've seen the
Tools.h++ library, the STL library, and others, and they all differ.  After 40k
lines for my last (and maybe last ever) programming project in C++, I can't say
I really think much of the language.  It seems like a hog butchering to me.
Maybe six different types of inheritance, and the ability to make the compiler
perform arbitrary computations during compilation (ala expression templates) are
really cool features, but I'm starting to think that C++ just is too big for its
britches.

You can say that C++ when used with STL is beautifully consistent, and I'd be
more inclined to believe you, but the fact remains that most of the C++ out
there doesn't use STL, but uses some other crap.  It's going to take a long time
for any of that to change.  If you have to interfact your program with any other
C or older C++ tools, you can take that consistency and flush it down the
toilet.  Consistency means everybody using similar mecahnisms to get similar
behavior, and, in that light, C++ really just isn't consistent.

I also feel strongly that the addition of too many operators can change a
language for the worse.  I've found Python's readability to be a refreshing
change from C++, and I believe that Guido et al. exercised a careful and
necessary caution when deciding what operators to add to the language.  As it
was brought up, code is written only once and read many times.  Donald Knuth
knew what he was doing when he invented WEB to create TeX.  I believe that Guido
exhibited similar wisdom when he designed Python.

Dave

--
David J. C. Beach
Colorado State University
mailto:beach@verinet.com
http://www.verinet.com/~beach




--------------47829609CB1559D129ECD9EA--


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________