* [TUHS] Array index history
@ 2017-06-08 9:16 Richard Tobin
0 siblings, 0 replies; 52+ messages in thread
From: Richard Tobin @ 2017-06-08 9:16 UTC (permalink / raw)
> Basically, until C came along, the standard practice was for indices
> to start at 1. Certainly Fortran and Pascal did it that way.
Mercury Autocode used 0.
http://www.homepages.ed.ac.uk/jwp/history/mercury/manual/autocode/4.jpg
-- Richard
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
^ permalink raw reply [flat|nested] 52+ messages in thread
[parent not found: <mailman.882.1496854900.3779.tuhs@minnie.tuhs.org>]
* [TUHS] Array index history
[not found] <mailman.882.1496854900.3779.tuhs@minnie.tuhs.org>
@ 2017-06-08 18:20 ` David
2017-06-08 18:55 ` Ron Natalie
2017-06-09 21:21 ` Steve Johnson
2017-06-08 22:29 ` Johnny Billquist
1 sibling, 2 replies; 52+ messages in thread
From: David @ 2017-06-08 18:20 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]
Arnold gets it right on the Pascal indexing.
In UCSD Pascal you could specify any array bounds you would like and
the compiler would 0 base them for you by always doing a subtraction,
or addition if your min was negative, of your min array index. So a little
run time cost for non-zero based arrays.
I’m not sure how other Pascal compilers did this.
I find it interesting that there are now a slew of testing programs
(Valgrind, Address Sanitizer, Purify, etc) that will add the ‘missing’
array bounds checking for C.
David
> On Jun 7, 2017, at 10:01 AM, tuhs-request at minnie.tuhs.org wrote:
>
> Date: Wed, 07 Jun 2017 07:20:43 -0600
> From: arnold at skeeve.com
> To: tuhs at tuhs.org, ag4ve.us at gmail.com
> Subject: Re: [TUHS] Array index history
> Message-ID: <201706071320.v57DKhmJ026303 at freefriends.org>
> Content-Type: text/plain; charset=us-ascii
>
> Pascal (IIRC) allowed you to specify upper and lower bounds, something
> like
>
> foo : array[5..10] of integer;
>
> with runtime bounds checking on array accesses. (I could be wrong ---
> it's been a LLLLOOONNNGGG time.)
>
> HTH,
>
> Arnold
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 18:20 ` David
@ 2017-06-08 18:55 ` Ron Natalie
2017-06-09 21:21 ` Steve Johnson
1 sibling, 0 replies; 52+ messages in thread
From: Ron Natalie @ 2017-06-08 18:55 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
=
> I find it interesting that there are now a slew of testing programs (Valgrind, Address Sanitizer, Purify, etc) that will add the ‘missing’
> array bounds checking for C.
And nothing prevents a C compiler from doing bounds checking, it's just not obliged to. There are C compilers that will allow you to enable such checks for debugging purposes.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 18:20 ` David
2017-06-08 18:55 ` Ron Natalie
@ 2017-06-09 21:21 ` Steve Johnson
2017-06-09 21:52 ` Arthur Krewat
1 sibling, 1 reply; 52+ messages in thread
From: Steve Johnson @ 2017-06-09 21:21 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3875 bytes --]
I'd like to comment on the technical difficulty of array bounds
checking. First of all, there are two kinds. The simple kind
computes the index and simply checks that the address is within the
array. This can be done fairly easily -- create a pointer to the end
of the array, and test against it (and with a bit more work,
"pre-test" loops so you don't need to test each element). If you
ignore possible negative subscripts, it's even easier. And it
catches a lot of the ugliest bugs. The harder version checks the
range of each index in a multidimensional array separately. This is
quite a bit more work, although it too can be optimized significantly
with enough work. And if C didn't conflate arrays and pointers, I
suspect this would have been added to C long ago.
But C does conflate arrays and pointers. When an array is passed
to a function, all that is passed is the location. There is no clue
what the size is. To even pass in the "end of array" pointer gets
expensive, since more registers need to be saved and loaded on each
call. Correct negative subscripts are not unheard of when passing
part of an array into a functions. And utilities like malloc get
more complicated as well, and for some of malloc's other uses (e.g.,
in class object creation) the checks would be inappropriate. And
finally, because pointers are extensively used in data structures,
pointer conventions are often used when using arrays (e.g., passing in
NULL when an array argument is not present or needed).
There is yet another problem. If array size or shape information
were somehow passed with arrays, it would be unkind for the language
to give the programmer no way to find out what the size(s) are. This
desire ultimately leads to a rich calling convention like that of
MATLAB where you can have multiple function outputs, determine how
many inputs are present, and inputs will disclose their size and shape
on request. Good to program in, but function calls are quite a bit
more expensive.
Realizing that most system code at the time of C's invention was still
written in assembler and PDP-11's were almost too small in memory to
do anything interesting (my laptop currently has roughly 243,000 times
the memory space of a PDP-11!), C's conventions provided a big
improvement in code correctness with a small cost when compared to
assembler...
Steve
----- Original Message -----
From: david@kdbarto.org
To:<tuhs at minnie.tuhs.org>
Cc:
Sent:Thu, 8 Jun 2017 11:20:24 -0700
Subject:Re: [TUHS] Array index history
Arnold gets it right on the Pascal indexing.
In UCSD Pascal you could specify any array bounds you would like and
the compiler would 0 base them for you by always doing a subtraction,
or addition if your min was negative, of your min array index. So a
little
run time cost for non-zero based arrays.
I’m not sure how other Pascal compilers did this.
I find it interesting that there are now a slew of testing programs
(Valgrind, Address Sanitizer, Purify, etc) that will add the
‘missing’
array bounds checking for C.
David
> On Jun 7, 2017, at 10:01 AM, tuhs-request at minnie.tuhs.org wrote:
>
> Date: Wed, 07 Jun 2017 07:20:43 -0600
> From: arnold at skeeve.com
> To: tuhs at tuhs.org, ag4ve.us at gmail.com
> Subject: Re: [TUHS] Array index history
> Message-ID: <201706071320.v57DKhmJ026303 at freefriends.org>
> Content-Type: text/plain; charset=us-ascii
>
> Pascal (IIRC) allowed you to specify upper and lower bounds,
something
> like
>
> foo : array[5..10] of integer;
>
> with runtime bounds checking on array accesses. (I could be wrong
---
> it's been a LLLLOOONNNGGG time.)
>
> HTH,
>
> Arnold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170609/2cd98147/attachment.html>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-09 21:21 ` Steve Johnson
@ 2017-06-09 21:52 ` Arthur Krewat
0 siblings, 0 replies; 52+ messages in thread
From: Arthur Krewat @ 2017-06-09 21:52 UTC (permalink / raw)
On 6/9/2017 5:21 PM, Steve Johnson wrote:
> C's conventions provided a big improvement in code correctness with a
> small cost when compared to assembler..
Being an assembler snob for a number of years when I first started
programming, having started with MACRO-10 on a PDP-10 in high school, I
was reluctant to consider C as an alternative.
At one point early on, I decided I would see what the difference was in
actual performance. So, on an IBM-AT, I wrote two programs. Both did a
wire-frame rotation of a 3D cube, rotating around both the X and Y axis.
They both used my own graphics library written in assembler that used
the basic BIOS graphics calls to draw lines in 3D.
One program was written in straight Intel 80286 assembler. The other, in
C, C86 from Computer Innovations, Inc.
The straight assembler version, I wrote using double-word integers. One
word for everything above the decimal point, one word for everything
below the decimal point. Now, because of the loss of precision, and that
I defined the matrices for rotation as static integers, after a few
hundred iterations, the cube would start to deform but it was a proof of
concept.
The C version, I used real sin(), cos(), but - the interesting part is
that I didn't have a floating point coprocessor - so the floating point
was emulated in the supplied math library.
The assembler version ran at a ratio of 3:4 compared to the C
version.Meaning if the assembler version did X rotations in 3 minutes,
the C version did it in 4 minutes. BUT - the C version cube didn't
deform over time, because the accuracy was intact.
After that, I gave up on assembler except where critical. C as a concept
did what I needed it to do ;)
On topic for this conversation is the fact that arrays in C are
basically a perfect mapping to assembler. if you moved from assembler to
C like I did, there was no concern over "arrays should start at 1". It
was just intuitive anyway.
On the other hand, if you went from some other language to C, well, I
can understand the alien-ness.
art k.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
[not found] <mailman.882.1496854900.3779.tuhs@minnie.tuhs.org>
2017-06-08 18:20 ` David
@ 2017-06-08 22:29 ` Johnny Billquist
2017-06-08 23:16 ` Ron Natalie
1 sibling, 1 reply; 52+ messages in thread
From: Johnny Billquist @ 2017-06-08 22:29 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
On 2017-06-07 19:01, "Ron Natalie"<ron at ronnatalie.com> wrote:
> The original FORTRAN and BASIC arrays started indexing at one because everybody other than computer scientists start counting at 1.
FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
actually start with 0. However, BASIC is weird, in that the DIM
statement is actually specifying the highest usable index, and not the
size of the array.
Thus:
DIM X(10)
means you get an array with 11 elements. So, people who wanted to use
array starting at 1 would still be happy, and if you wanted to start at
0, that also worked. You might unintentionally have a bit of wasted
memory, though.
> These languages were for scientists and the beginner, so you wanted to make things compatible with their normal concepts.
True.
> PASCAL on the other hand required you to give the minimum and maximum index for the array.
In a way, PASCAL makes the most sense. You still what range you want,
and you get that. Anything works, and it's up to you.
That said, PASCAL could get a bit ugly when passing arrays as arguments
to functions because of this.
> Of course, C’s half-assaed implementation of arrays kind of depends on zero-indexing to work.
:-)
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 22:29 ` Johnny Billquist
@ 2017-06-08 23:16 ` Ron Natalie
2017-06-08 23:41 ` Steve Nickolas
` (2 more replies)
0 siblings, 3 replies; 52+ messages in thread
From: Ron Natalie @ 2017-06-08 23:16 UTC (permalink / raw)
> FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
actually start with 0. However, BASIC is weird, in that the DIM statement is
actually specifying the highest usable index, and not the size of the array.
Eh? Not in any BASIC I ever used. They all started at 1. Can't vouch
for the later Microsoft "visual" variants but the original 1970's era BASIC
started with 1.
DIM X(10) gave you ten elements from 1...10
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 23:16 ` Ron Natalie
@ 2017-06-08 23:41 ` Steve Nickolas
2017-06-09 15:12 ` Random832
2017-06-09 0:21 ` Johnny Billquist
2017-06-09 0:25 ` Pete Turnbull
2 siblings, 1 reply; 52+ messages in thread
From: Steve Nickolas @ 2017-06-08 23:41 UTC (permalink / raw)
On Thu, 8 Jun 2017, Ron Natalie wrote:
>
>> FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
> actually start with 0. However, BASIC is weird, in that the DIM statement is
> actually specifying the highest usable index, and not the size of the array.
>
> Eh? Not in any BASIC I ever used. They all started at 1. Can't vouch
> for the later Microsoft "visual" variants but the original 1970's era BASIC
> started with 1.
> DIM X(10) gave you ten elements from 1...10
All M$ dialects that I am aware of start at 0 by default. Later ones have
OPTION BASE to change this or let you do DIM X(5 TO 7) if you want.
-uso.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 23:41 ` Steve Nickolas
@ 2017-06-09 15:12 ` Random832
2017-06-09 16:30 ` Ron Natalie
0 siblings, 1 reply; 52+ messages in thread
From: Random832 @ 2017-06-09 15:12 UTC (permalink / raw)
On Thu, Jun 8, 2017, at 19:41, Steve Nickolas wrote:
> On Thu, 8 Jun 2017, Ron Natalie wrote:
> > DIM X(10) gave you ten elements from 1...10
>
> All M$ dialects that I am aware of start at 0 by default.
In fact, they give you eleven elements from 0 to 10, which means that
code which *uses* 1..10 is compatible but wastes some space.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-09 15:12 ` Random832
@ 2017-06-09 16:30 ` Ron Natalie
0 siblings, 0 replies; 52+ messages in thread
From: Ron Natalie @ 2017-06-09 16:30 UTC (permalink / raw)
I stand corrected. I pulled up the original typewritten Dartmouth BASIC manual and indeed the indices start at zero (though many coding examples don't write the zeroth element). By default arrays were 11 elements long. You could change that with the DIM statement. Yes, the value given to DIM is the highest index making a DIM A(20) defining a 21 element array.
-----Original Message-----
From: TUHS [mailto:tuhs-bounces@minnie.tuhs.org] On Behalf Of Random832
Sent: Friday, June 9, 2017 11:12 AM
To: tuhs at minnie.tuhs.org
Subject: Re: [TUHS] Array index history
On Thu, Jun 8, 2017, at 19:41, Steve Nickolas wrote:
> On Thu, 8 Jun 2017, Ron Natalie wrote:
> > DIM X(10) gave you ten elements from 1...10
>
> All M$ dialects that I am aware of start at 0 by default.
In fact, they give you eleven elements from 0 to 10, which means that code which *uses* 1..10 is compatible but wastes some space.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 23:16 ` Ron Natalie
2017-06-08 23:41 ` Steve Nickolas
@ 2017-06-09 0:21 ` Johnny Billquist
2017-06-09 0:25 ` Pete Turnbull
2 siblings, 0 replies; 52+ messages in thread
From: Johnny Billquist @ 2017-06-09 0:21 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]
All variants of BASIC by DEC does this. A few others I've tried also do. But since BASIC was not standardized for the longest time, it's hard to claim that BASIC really was one way or another. I have definitely not tried every dialect that has existed.
Johnny
Ron Natalie <ron at ronnatalie.com> skrev: (9 juni 2017 01:16:48 CEST)
>
>> FORTRAN, yes. BASIC (which dialect might we be talking about?)
>normally
>actually start with 0. However, BASIC is weird, in that the DIM
>statement is
>actually specifying the highest usable index, and not the size of the
>array.
>
>Eh? Not in any BASIC I ever used. They all started at 1. Can't
>vouch
>for the later Microsoft "visual" variants but the original 1970's era
>BASIC
>started with 1.
>DIM X(10) gave you ten elements from 1...10
--
Skickat från min Android-enhet med K-9 Mail. Ursäkta min fåordighet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170609/4064e9af/attachment.html>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 23:16 ` Ron Natalie
2017-06-08 23:41 ` Steve Nickolas
2017-06-09 0:21 ` Johnny Billquist
@ 2017-06-09 0:25 ` Pete Turnbull
2017-06-09 1:19 ` Toby Thain
2 siblings, 1 reply; 52+ messages in thread
From: Pete Turnbull @ 2017-06-09 0:25 UTC (permalink / raw)
On 09/06/2017 00:16, Ron Natalie wrote:
>
>> FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
> actually start with 0. However, BASIC is weird, in that the DIM statement is
> actually specifying the highest usable index, and not the size of the array.
>
> Eh? Not in any BASIC I ever used. They all started at 1. Can't vouch
> for the later Microsoft "visual" variants but the original 1970's era BASIC
> started with 1.
> DIM X(10) gave you ten elements from 1...10
Well, my experience matches Johnny's. I used many derivatives of
MicroSoft BASIC - PET, Apple INTBASIC, Applesoft, Exidy Sorcerer, and
others - and they all start at 0. AFAIR HP BASIC did so as well. The
original 1960s Dartmouth BASIC (for which I have a copy of the manual)
also started at 0 (cf. page 38); indeed if you didn't explicitly DIM an
array, you got eleven elements indexed 0...10.
--
Pete
Pete Turnbull
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-09 0:25 ` Pete Turnbull
@ 2017-06-09 1:19 ` Toby Thain
2017-06-09 2:14 ` Pete Turnbull
0 siblings, 1 reply; 52+ messages in thread
From: Toby Thain @ 2017-06-09 1:19 UTC (permalink / raw)
On 2017-06-08 8:25 PM, Pete Turnbull wrote:
> On 09/06/2017 00:16, Ron Natalie wrote:
>>
>>> FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
>> actually start with 0. However, BASIC is weird, in that the DIM
>> statement is
>> actually specifying the highest usable index, and not the size of the
>> array.
>>
>> Eh? Not in any BASIC I ever used. They all started at 1. Can't vouch
>> for the later Microsoft "visual" variants but the original 1970's era
>> BASIC
>> started with 1.
>> DIM X(10) gave you ten elements from 1...10
>
> Well, my experience matches Johnny's. I used many derivatives of
> MicroSoft BASIC - PET, Apple INTBASIC, Applesoft, Exidy Sorcerer, and
> others - and they all start at 0. AFAIR HP BASIC did so as well. The
> original 1960s Dartmouth BASIC (for which I have a copy of the manual)
> also started at 0 (cf. page 38); indeed if you didn't explicitly DIM an
> array, you got eleven elements indexed 0...10.
>
I wrote a lot of BBC BASIC. DIM(9) allocates ten elements, 0..9,
according to this:
http://www.riscos.com/support/developers/bbcbasic/part2/arrays.html
--Toby
^ permalink raw reply [flat|nested] 52+ messages in thread
[parent not found: <mailman.890.1496953026.3779.tuhs@minnie.tuhs.org>]
* [TUHS] Array index history
[not found] <mailman.890.1496953026.3779.tuhs@minnie.tuhs.org>
@ 2017-06-08 22:28 ` Johnny Billquist
0 siblings, 0 replies; 52+ messages in thread
From: Johnny Billquist @ 2017-06-08 22:28 UTC (permalink / raw)
On 2017-06-08 22:17, Dave Horsfall<dave at horsfall.org> wrote:
>
> Just to diverge from this thread a little, it probably isn't all that
> remarkable that programming languages tend to reflect the hardware for
> which they were designed.
>
> Thus, for example, we have the C construct:
>
> do { ... } while (--i);
>
> which translated right into the PDP-11's "SOB" instruction (and
> reminiscent of FORTRAN's insistence that DO loops are run at least once
> (there was a CACM article about that once; anyone have a pointer to it?)).
>
> And of course the afore-mentioned FORTRAN, which really reflects the
> underlying IBM 70x architecture (shudder).
FORTRAN stopped running the loops at least once already with FORTRAN 77.
The last who insisted on running loops at least once was FORTRAN IV.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
@ 2017-06-08 2:27 Doug McIlroy
2017-06-08 12:49 ` William Cheswick
0 siblings, 1 reply; 52+ messages in thread
From: Doug McIlroy @ 2017-06-08 2:27 UTC (permalink / raw)
> Who started this? Why was the change made?
Arrays in Fortran and Algol were indexed from 1 by default, but
Algol (IIRC) generalized that to allow first:last declarations.
NPL used first,last for the SUBSTR operation. But first,last
begets off-by-one errors. The successor slice begins at last+1.
The formula for the position of 1-indexed a[i,j] is a mess.
First,length is much cleaner: the successor begins at
first+length. I convinced the committee of that, so when
NPL became PL/I, first,length was the convention. Zero-
indexing is also a clean first,length notation. BCPL,
where a[i] was synonymous with rv(a+i), had it. Dennis, who
knew a good thing when he saw it, took it over. Dijkstra,
too, often inveighed against 1-indexing, and opined that
zero was the true computer-science way.
1-indexing certainly came into programming languages from
the math tradition for matrix notation. Of course in
math series are often indexed from zero, so one may
pick and choose. Off hand I can only think of one CS
context where 1 comes in handy: heapsort.
Doug
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 2:27 Doug McIlroy
@ 2017-06-08 12:49 ` William Cheswick
2017-06-08 12:56 ` Michael Kjörling
2017-06-08 15:04 ` Dave Horsfall
0 siblings, 2 replies; 52+ messages in thread
From: William Cheswick @ 2017-06-08 12:49 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 437 bytes --]
When he tests a microphone, Don Knuth says:
“Testing zero, one, two.”
> On 7Jun 2017, at 10:27 PM, Doug McIlroy <doug at cs.dartmouth.edu> wrote:
>
> Dijkstra,
> too, often inveighed against 1-indexing, and opined that
> zero was the true computer-science way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170608/2d36f742/attachment.html>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 12:49 ` William Cheswick
@ 2017-06-08 12:56 ` Michael Kjörling
2017-06-08 13:45 ` Dan Cross
2017-06-10 21:08 ` Nemo
2017-06-08 15:04 ` Dave Horsfall
1 sibling, 2 replies; 52+ messages in thread
From: Michael Kjörling @ 2017-06-08 12:56 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
On 8 Jun 2017 08:49 -0400, from ches at cheswick.com (William Cheswick):
> When he tests a microphone, Don Knuth says:
>
> “Testing zero, one, two.”
As opposed to Niklaus Wirth, who presumably would rather say:
"Testing lower bound, lower bound plus one, lower bound plus two."
--
Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se
“People who think they know everything really annoy
those of us who know we don’t.” (Bjarne Stroustrup)
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 12:56 ` Michael Kjörling
@ 2017-06-08 13:45 ` Dan Cross
2017-06-08 13:57 ` Ron Natalie
2017-06-10 21:08 ` Nemo
1 sibling, 1 reply; 52+ messages in thread
From: Dan Cross @ 2017-06-08 13:45 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 814 bytes --]
On Thu, Jun 8, 2017 at 8:56 AM, Michael Kjörling <michael at kjorling.se>
wrote:
> On 8 Jun 2017 08:49 -0400, from ches at cheswick.com (William Cheswick):
> > When he tests a microphone, Don Knuth says:
> >
> > “Testing zero, one, two.”
>
> As opposed to Niklaus Wirth, who presumably would rather say:
>
> "Testing lower bound, lower bound plus one, lower bound plus two."
"Testing: the set N, defined so that there are some elements 'b' and 'e' in
N with known values taken from the integers and such that b less than or
equal 'e' and every other element is both the natural successor of an
element in N and less than or equal to 'e'."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170608/7b311e3f/attachment.html>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 13:45 ` Dan Cross
@ 2017-06-08 13:57 ` Ron Natalie
0 siblings, 0 replies; 52+ messages in thread
From: Ron Natalie @ 2017-06-08 13:57 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]
My other favorite Wirth joke (I believe he coined himself) plays fun with the pronunciation of his name:
You can call me by name… VEERTH or by value… WORTH.
From: TUHS [mailto:tuhs-bounces@minnie.tuhs.org] On Behalf Of Dan Cross
Sent: Thursday, June 8, 2017 9:46 AM
To: Michael Kjörling
Cc: TUHS main list
Subject: Re: [TUHS] Array index history
On Thu, Jun 8, 2017 at 8:56 AM, Michael Kjörling <michael at kjorling.se> wrote:
On 8 Jun 2017 08:49 -0400, from ches at cheswick.com (William Cheswick):
> When he tests a microphone, Don Knuth says:
>
> “Testing zero, one, two.”
As opposed to Niklaus Wirth, who presumably would rather say:
"Testing lower bound, lower bound plus one, lower bound plus two."
"Testing: the set N, defined so that there are some elements 'b' and 'e' in N with known values taken from the integers and such that b less than or equal 'e' and every other element is both the natural successor of an element in N and less than or equal to 'e'."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170608/9946b599/attachment-0001.html>
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 12:56 ` Michael Kjörling
2017-06-08 13:45 ` Dan Cross
@ 2017-06-10 21:08 ` Nemo
1 sibling, 0 replies; 52+ messages in thread
From: Nemo @ 2017-06-10 21:08 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 423 bytes --]
On 08/06/2017, Michael Kjörling <michael at kjorling.se> wrote:
> On 8 Jun 2017 08:49 -0400, from ches at cheswick.com (William Cheswick):
>> When he tests a microphone, Don Knuth says:
>>
>> “Testing zero, one, two.”
>
> As opposed to Niklaus Wirth, who presumably would rather say:
>
> "Testing lower bound, lower bound plus one, lower bound plus two."
In his latest language Oberon, all arrays start at zero.
N.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 12:49 ` William Cheswick
2017-06-08 12:56 ` Michael Kjörling
@ 2017-06-08 15:04 ` Dave Horsfall
2017-06-08 15:09 ` William Pechter
` (3 more replies)
1 sibling, 4 replies; 52+ messages in thread
From: Dave Horsfall @ 2017-06-08 15:04 UTC (permalink / raw)
Just to diverge from this thread a little, it probably isn't all that
remarkable that programming languages tend to reflect the hardware for
which they were designed.
Thus, for example, we have the C construct:
do { ... } while (--i);
which translated right into the PDP-11's "SOB" instruction (and
reminiscent of FORTRAN's insistence that DO loops are run at least once
(there was a CACM article about that once; anyone have a pointer to it?)).
And of course the afore-mentioned FORTRAN, which really reflects the
underlying IBM 70x architecture (shudder).
I know that Burroughs' iron ran ALGOL; I shudder to think of any box that
runs native PERL...
Speaking of Burroughs (which we weren't), their OS was MCP (Master Control
Program) which we the great unwashed called Male Chauvinist Pig, no doubt
to their distress :-) Any other examples of poor acronyms designed by
ignorant marketoids?
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 15:04 ` Dave Horsfall
@ 2017-06-08 15:09 ` William Pechter
2017-06-08 16:53 ` Steve Nickolas
` (2 subsequent siblings)
3 siblings, 0 replies; 52+ messages in thread
From: William Pechter @ 2017-06-08 15:09 UTC (permalink / raw)
DEC Professional Operating System POS.
Great acronym there...
-----Original Message----
Speaking of Burroughs (which we weren't), their OS was MCP (Master Control
Program) which we the great unwashed called Male Chauvinist Pig, no doubt
to their distress :-) Any other examples of poor acronyms designed by
ignorant marketoids?
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 15:04 ` Dave Horsfall
2017-06-08 15:09 ` William Pechter
@ 2017-06-08 16:53 ` Steve Nickolas
2017-06-08 20:17 ` Larry McVoy
2017-06-09 0:03 ` Greg 'groggy' Lehey
3 siblings, 0 replies; 52+ messages in thread
From: Steve Nickolas @ 2017-06-08 16:53 UTC (permalink / raw)
On Fri, 9 Jun 2017, Dave Horsfall wrote:
> Speaking of Burroughs (which we weren't), their OS was MCP (Master Control
> Program) which we the great unwashed called Male Chauvinist Pig, no doubt
> to their distress :-) Any other examples of poor acronyms designed by
> ignorant marketoids?
Apple had SOS.
-uso.
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 15:04 ` Dave Horsfall
2017-06-08 15:09 ` William Pechter
2017-06-08 16:53 ` Steve Nickolas
@ 2017-06-08 20:17 ` Larry McVoy
2017-06-09 0:03 ` Greg 'groggy' Lehey
3 siblings, 0 replies; 52+ messages in thread
From: Larry McVoy @ 2017-06-08 20:17 UTC (permalink / raw)
> I know that Burroughs' iron ran ALGOL; I shudder to think of any box that
> runs native PERL...
Huh? If I couldn't have C on the iron I'd be ecstatic with perl 4 (I'm old,
never warmed up to perl 5).
In fact, while I was at Sun I proposed rewriting a pile of /usr/bin in
perl 4 just because it would be more maintainable. I did walk that back
at some point but I love me some perl.
I've moved on because I created my own C/perl combo language and that's
what I do most of my programming in these days.
http://mcvoy.com/lm/photos.l
is an example. I'm in Europe right now, you can see the results of photos.l
here (warning ~8MB of thumbnails):
http://mcvoy.com/lm/europe
I'm very fond of that language, it's like a scripting version of C,
has structs, but has all the fun stuff from perl.
Docs here:
http://www.mcvoy.com/lm/L/L.html
^ permalink raw reply [flat|nested] 52+ messages in thread
* [TUHS] Array index history
2017-06-08 15:04 ` Dave Horsfall
` (2 preceding siblings ...)
2017-06-08 20:17 ` Larry McVoy
@ 2017-06-09 0:03 ` Greg 'groggy' Lehey
3 siblings, 0 replies; 52+ messages in thread
From: Greg 'groggy' Lehey @ 2017-06-09 0:03 UTC (permalink / raw)
On Friday, 9 June 2017 at 1:04:39 +1000, Dave Horsfall wrote:
>
> And of course the afore-mentioned FORTRAN, which really reflects the
> underlying IBM 70x architecture (shudder).
I had promised myself that I wouldn't get involved in this thread, but
I had to step in here.
Yes, the IBM 704 had the CAS instruction (Compare Accumulator with
Storage), a three-way skip instruction that easily implemented the
FORTRAN Arithmetic IF. But the "index" registers were correctly
called decrement registers: their content was subtracted from the base
address. I assume that this was because the 704 was a ones-complement
machine whose basic arithmetic operation was subtraction, so this was
cheaper than adding the registers to the base address.
To implement indexing with the base 704 hardware, FORTRAN would have
had to have an upper bound of -0 (remember that number?).
Still, there were three decrement registers, and the original FORTRAN
was limited to three dimensions, evidently as a result.
> Speaking of Burroughs (which we weren't), their OS was MCP (Master
> Control Program) which we the great unwashed called Male Chauvinist
> Pig, no doubt to their distress :-)
This name (the original one) cropped up again in the 1982 film "Tron"
(http://www.imdb.com/title/tt0084827/). It was singularly
inappropriate.
Greg
--
Sent from my desktop computer.
Finger grog at lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170609/8e5952a9/attachment.sig>
^ permalink raw reply [flat|nested] 52+ messages in thread
[parent not found: <CAH_OBiewwwS6kbdWKUO-j3v=Do+Y9AzBn4ZkyVic7LOJN5WX7w@mail.gmail.com>]
end of thread, other threads:[~2017-06-10 21:08 UTC | newest]
Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-08 9:16 [TUHS] Array index history Richard Tobin
[not found] <mailman.882.1496854900.3779.tuhs@minnie.tuhs.org>
2017-06-08 18:20 ` David
2017-06-08 18:55 ` Ron Natalie
2017-06-09 21:21 ` Steve Johnson
2017-06-09 21:52 ` Arthur Krewat
2017-06-08 22:29 ` Johnny Billquist
2017-06-08 23:16 ` Ron Natalie
2017-06-08 23:41 ` Steve Nickolas
2017-06-09 15:12 ` Random832
2017-06-09 16:30 ` Ron Natalie
2017-06-09 0:21 ` Johnny Billquist
2017-06-09 0:25 ` Pete Turnbull
2017-06-09 1:19 ` Toby Thain
2017-06-09 2:14 ` Pete Turnbull
[not found] <mailman.890.1496953026.3779.tuhs@minnie.tuhs.org>
2017-06-08 22:28 ` Johnny Billquist
-- strict thread matches above, loose matches on Subject: below --
2017-06-08 2:27 Doug McIlroy
2017-06-08 12:49 ` William Cheswick
2017-06-08 12:56 ` Michael Kjörling
2017-06-08 13:45 ` Dan Cross
2017-06-08 13:57 ` Ron Natalie
2017-06-10 21:08 ` Nemo
2017-06-08 15:04 ` Dave Horsfall
2017-06-08 15:09 ` William Pechter
2017-06-08 16:53 ` Steve Nickolas
2017-06-08 20:17 ` Larry McVoy
2017-06-09 0:03 ` Greg 'groggy' Lehey
[not found] <CAH_OBiewwwS6kbdWKUO-j3v=Do+Y9AzBn4ZkyVic7LOJN5WX7w@mail.gmail.com>
[not found] ` <CAH_OBid5q-YeB6UYeOfjW68s3nb3TX_icC5dFMapfo=7_q5DUQ@mail.gmail.com>
[not found] ` <CAH_OBideJeNGiiys=VOEYcU1cffSg+6zDOD39HOU74vumQF0kA@mail.gmail.com>
[not found] ` <CAH_OBie_+dQXOC2OaZii5K=j1Ljmv-OvAVXvyypoLJ10jaysWA@mail.gmail.com>
[not found] ` <CAH_OBidXd1Lpgp8ttM3sWLfXDT0ms5EGAzEjPH9QkY+bXyev2w@mail.gmail.com>
[not found] ` <CAH_OBifge2RrwcDvSV46gwLAc0wHVtH++gdMBhXi-x8C0a_2jw@mail.gmail.com>
[not found] ` <CAH_OBic3MTy-20C_T2ciT2x+EjNZvXR2PJ0OzB0qRp1gd2OL-g@mail.gmail.com>
2017-06-07 12:56 ` shawn wilson
2017-06-07 13:16 ` Ron Natalie
2017-06-07 13:20 ` arnold
2017-06-07 13:50 ` Michael Kjörling
2017-06-07 14:02 ` arnold
2017-06-08 11:28 ` Christian Neukirchen
2017-06-08 14:56 ` shawn wilson
2017-06-07 14:58 ` Tony Finch
2017-06-07 23:57 ` Dave Horsfall
2017-06-07 16:31 ` Lyndon Nerenberg
2017-06-08 0:47 ` Bakul Shah
2017-06-07 17:59 ` Tim Bradshaw
2017-06-07 18:29 ` Clem Cole
2017-06-07 18:46 ` Arthur Krewat
2017-06-07 19:03 ` Ron Natalie
2017-06-07 19:15 ` Arthur Krewat
2017-06-07 19:49 ` Ron Natalie
2017-06-08 1:58 ` ARJANEN Loïc Jean David
2017-06-08 13:49 ` Random832
2017-06-08 13:55 ` Arthur Krewat
2017-06-08 18:41 ` Tim Bradshaw
2017-06-08 2:45 ` Robert Swierczek
2017-06-08 4:05 ` Dave Horsfall
2017-06-08 6:19 ` Peter Jeremy
2017-06-08 7:02 ` Dave Horsfall
2017-06-08 13:53 ` Ron Natalie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).