4 ms·
Lua is the “last standing man” now.
by fosk 3y ago
Lua is the “last standing man” now.
- adregan 3y agoHold your horses, APL[1] is not dead yet. However, at some point in its history, APL did gain the ability to assign the Index Origin[2] to 0 if the problem called for it via: ⎕IO←0 0: intentionally started the indexes from 1 ;) 1: https://en.m.wikipedia.org/wiki/APL_(programming_language) https://en.m.wikipedia.org/wiki/APL_(programming_language) 2: https://aplwiki.com/wiki/Index_origin https://aplwiki.com/wiki/Index_origin
- pif 3y agoAnd FORTRAN
- goosedragons 3y agoR still uses 1 indexing, Julia as well.
- nine_k 3y agoEvery language for scientific computation uses 1-based indexes, to follow the tradition of using them in formulas. FORTRAN, APL, Julia, R, MATLAB, GNU Octane, etc. I remember that (some versions of) BASIC back in the day had an option to switch between 1-based and 0-based indexing, to appeal to both Fortran and C folks.
- Y_Y 3y agoIn physics, relativists usually count from 0. Furthermore on the numerical side, C is at least as popular as Fortran. Julia lets you switch the index base too. Finally a special mention for Mathematica, which appears to be 1-based, but in fact is a thinly disguised 0-based lisp, {a,b} is just List[a,b] is really just (List a b) so of course if you want b you ask for element 2, element 0 is the head and is just List.
- frozenport 3y agoNumpy