Hi Gerald —
Thanks for your response to our survey questions.
FWIW, I don't expect Chapel's current choice of having programmers specify
lower and upper bounds for ranges, domains, and array types to change.
The reasons I say this are because:
(a) it's a far more impactful change than the one currently being
discussed, to the extent that I think it's virtually unthinkable at
this point (simply because those types are used much more prevalently
than direct integral indexing of tuples, strings, and lists;
(b) it's not a change that our most dedicated users have requested
(where the change from 0- to 1-based indexing is one that such
users have either advocated for or expressed openness to);
(c) there are strong arguments for continuing to support arbitrary
lower bounds for these types; for example, when doing physical
simulations, to say that all grids must start at 0 or 1 raises
significant productivity hurdles when implementing various grids that
require boundary conditions, local patches, or the like. I'd argue
that Fortran's support for arbitrary local bounds on multidimensional
arrays is one of the reasons that it hasn't been completely displaced
by C/C++. We'd like Chapel to be a viable alternative in this regard.
Best wishes,
-Brad
---
Brad Chamberlain Principal Engineer
Cray, a Hewlett Packard Enterprise company
901 Fifth Ave, Suite 1000 | Seattle, WA 98164
+1-206-701-2077 br...@cray.com www.cray.com
On Tue, 5 Nov 2019, Gerald Henriksen wrote:
On Mon, 4 Nov 2019 23:59:01 +0000, you wrote:
Am I understanding you right, that you are suggesting that it become impossible
to declare lower and upper bounds for everything, including ranges, domains,
and arrays? 100% against this, couldn't disagree more if so. I'll hold off on
attacking a strawman until I know if that man made of straw is a decoy or the
real thing.
I'm saying the language should be consistent, and regardless of
whether the choice is 0-based or 1-based it should be applied to
everything possible.
Specifically thinking of this quote from the original email:
" As a specific example, I have no expectation that our LinearAlgebra
library would switch to using 0-based matrices if we were to make this
language change because 1-based indexing is arguably most typical and
natural for that context.
"
If you want to keep 1-based indexing for a library, then keep the
entire language as 1-based.
If you want the language to be 0-based, then change the library.
Anyone writing Chapel code shouldn't have to stop and think of context
to decide which indexing method is being used.
For example, the first C++ Linear Algebra library I looked at is
Armadillo, and on the page comparing Armadillo to Matlab(*) it shows
that Armadillo uses 0-based indexing. This means Armadillo is
consistent with C++.
The thing to be remembered is a lot of code is written by people who
are not programmers, nevermind experienced programmers, and thus the
language should be defaulting to consistency. The goal should be to
having the language do its best to minimize the potential for
accidental bugs, and varying the indexing between the core language
and a provided library is asking for trouble.
Now there may well be valid reasons to have features in the language
that can have a different indexing system. But they should be as few
as necessary, and ideally they should still default to whatever the
chosen language standard is so that a programmer needs to make a
specific decision to do something different.
* - http://arma.sourceforge.net/docs.html#syntax
_______________________________________________
Chapel-developers mailing list
chapel-develop...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/chapel-developers
_______________________________________________
Chapel-users mailing list
Chapel-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/chapel-users