Can you list programming languages where array indexing does not begin at zero?
@nixCraft Matlab
@joakimfors @nixCraft I strongly reject the idea of calling MatLab a programming language. It has components of a language and some things people do with it have some resemblance with programming. But other than that it is IMHO not more than a prototyping framework. At least that's my experience from writing a bachelor's thesis with MatLab in the title. 
@nils_ballmann @nixCraft Well, it's not better or worse than brainfuck or whitespace 
@nixCraft R! ("list" of one, but it's the only one I can think of offhand)
triggered by the last post?
@epistomai lol πŸ˜‚
@nixCraft to be honest, I always found it weird starting at 1, so I no longer remember one pl
@nixCraft Technically Lua, but it you _can_ start arrays at 0, they just customarily start at 1
@mr_daemon
that seems even worse πŸ₯²
@nixCraft
@attero @nixCraft They're all static IIRC, so it mitigates any ambiguity AFAIK

@nixCraft

1: Fortran

(Defaults to 1, but you can make set it to be 0 if you want. Or 50. Or (-37). Or any other integer).

@nixCraft Pascal, Algol xx, PL/1, … πŸ˜…

@nixCraft Nope.
But Wikipedia can!

https://en.m.wikipedia.org/wiki/Comparison_of_programming_languages_(array)

(FWIW I only got Fortran right.)

Comparison of programming languages (array) - Wikipedia

@nixCraft pascal. I one wrote a program where the array indeed was -2…+2
@nixCraft Can you list programming languages that don't have array indexing?

@Serpent7776 @nixCraft Maybe 'Brainfuck' ? :D

Just a guess...

@qwc Brainfuck doesn't have arrays :D
Unless you treat memory tape as an array. Then each memory access can be treated as implicit indexing using current memory location.
@Serpent7776
Fullfills your question. :)
@nixCraft ALGOL APL AWK CFML COBOL Fortran FoxPro Julia Lingo Lua MATLAB PL/1 R RPG Sass Smalltalk Wolfram XQuery

some because mathematicians start from 1, and some because 0 makes for a bad value to start from in an associative table
@nixCraft Lua, Matlab, R would be the first ones coming to my mind.

@nixCraft #Perl versions prior to 2019’s v5.30.0 let you change the base index value with the $[ special variable, mainly to placate #AWK migrations: https://perldoc.perl.org/variables/$%5B

(It had been deprecated since 2010’s v5.12.0)

$[ - Perldoc Browser

@mjgardner @nixCraft This is quite cool - why was it omitted?

@demiguise @nixCraft It had always been discouraged since #Perl 5.000’s release in 1994: https://github.com/Perl/perl5/blob/a0d0e21ea6ea90a22318550944fe6cb09ae10cda/pod/perlvar.pod#user-content-pod27

As to β€œwhy”—you’d have to ask either #LarryWall or #AndyDougherty.

perl5/pod/perlvar.pod at a0d0e21ea6ea90a22318550944fe6cb09ae10cda Β· Perl/perl5

πŸͺ The Perl programming language. Contribute to Perl/perl5 development by creating an account on GitHub.

GitHub

@mjgardner @demiguise @nixCraft I believe it was because it was so fragile. If you didn't scope it correctly, it could break all arrays.

Even if you did scope it correctly, it could break programmer's brains because if you didn't see that indexing started with zero, it would be very easy to mishandle arrays.

@nixCraft Doesn't seem like SQL is mentioned here yet, though it is a language after all. Note that not just AUTO_INCREMENT starts at 1, but actual array indices do as well: https://docs.data.world/documentation/sql/concepts/intermediate/Working%20with%20arrays.html#element_at
Working With Arrays

Learn how to work with arrays in this SQL tutorial. Visit for a full course on learning the basics of SQL.

docs.data.world
@nixCraft visual basic pre .net where you had to set OptionExplicit or something to make arrays start at zero.
@nixCraft I think it might be the case for Ada
@nixCraft Should the list begin at 0, or 1?
@nixCraft, Visual Basic Script, and maybe all other BASICs
@nixCraft #Haskell Arrays can be indexed by any type, and can have bounds arbitrarily drawn from that type: https://www.haskell.org/onlinereport/haskell2010/haskellch14.html#x22-20100014 (specification) and https://hackage.haskell.org/package/array-0.5.7.0/docs/Data-Array.html (implementation).
14 Data.Array

@nixCraft BASIC and XQuery come to mind
@nixCraft I believe LUA is one of those which starts at 1?
@nixCraft I think VBA start at 1, because, well its fwas made for not programming people.
@nixCraft awk's arrays are associative, but if you use n=split(...) the array elements used are 1..n

@nixCraft A few I know of include:

1. Lua
2. Zsh
3. CSS Grid properties

@nixCraft 4th Dimension RDMS Programming Language, though interestingly enough, index zero was accessible.
@nixCraft To clarify: the first element would always be [1], but one could use [0] to store a temporary value, for example.
@nixCraft Right off the bat, FORTRAN and COBOL. And, IIRC, Pascal allowed array declarations to specify the range of indices.

@nixCraft I think in awk you can index with whatever you like.
From "first" over "-1" to "infinity"

Testing...
Yes.

:/data/user/0/com.termoneplus/app_HOME $
:/data/user/0/com.termoneplus/app_HOME $ awk 'BEGIN{
> a["first"]="hello"
> a[-1]="not"
> a["infinity"]="a lot"
>
> for (i in a) {
> print i " " a[i]
> }
> }'

first hello
infinity a lot
-1 not

:/data/user/0/com.termoneplus/app_HOME $