Article View: comp.lang.misc
Article #2396Re: languages which allow the introduction of new operators
From: Herman Rubin
Date: Fri, 13 Nov 1992 14:27
Date: Fri, 13 Nov 1992 14:27
52 lines
3005 bytes
3005 bytes
In article <17434@mindlink.bc.ca> Nick_Janow@mindlink.bc.ca (Nick Janow) writes:
>hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
>
>> But I would object to any language which insists that we use a strictly
>> stack machine. Pushing, popping, and calling are to be avoided unless
>> necessary. Otherwise things just run too slowly to be of more than
>> theoretical use.
>Why do you object to the use of a stack machine (on which those operations
>are fast)? If a stack language on a stack machine will run n times as fast
>as a non-stack language on a non-stack machine of equal technology level, why
>not use a stack machine?
>Don't some languages insist (for reasonable performance) that the processor
>provide registers and addressing modes?
HOW can a stack machine be fast? One of the features of an efficient program
is to have the quantities needed available in registers. A dozen or two
registers are usually needed to get decent performance, and often it would
help to have hundreds. On of my friends in the computing center here tells
me that the 256 registers on the CYBER 205 (more than 220 not tied up by
system operations) is not always enough.
But code such as push x; push y; push procedure Z; execute; pop result to w;
will not execute fast compared to
w = x Z y,
where registers are used. Also, efficient programming should take into account
which addressing modes are available.
>> Getting any speed out of machines requires that we think of speed in
>> coding, rather than the fact that it is possible in principle to operate
>> with a stack machine with no registers. This also ignores hardware, such
>> as vector machines, where the use of a control register or control stream
>> introduces basic bit operations which did not exist before, and which are
>> utterly stupid as a means of efficient computation on a stack machine.
>There's no reason why special hardware can't be added to a stack machine.
>You could, for example, add a pair of FIFO "stacks", which might be useful
>for signal processing operations.
It will still not help if more versatile register-type operatations are
appropriate.
There is an ongoing discussion in comp.arch of the advantages and disadvantages
of stack machines.
--
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
Phone: (317)494-6054
hrubin@snap.stat.purdue.edu (Internet, bitnet)
{purdue,pur-ee}!snap.stat!hrubin(UUCP)
Technical Details
Message-ID:
<Bxns5v.5uJ@mentor.cc.purdue.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubinReferences:
<17434@mindlink.bc.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin From: hrubin@pop.stat.purdue.edu (Herman Rubin) Subject: Re: languages which allow the introduction of new operators Message-ID: <Bxns5v.5uJ@mentor.cc.purdue.edu> Sender: news@mentor.cc.purdue.edu (USENET News) Organization: Purdue University Statistics Department References: <17434@mindlink.bc.ca> Date: Fri, 13 Nov 1992 14:27:30 GMT Lines: 52