Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming and composability? #1

Closed
timholy opened this issue Apr 4, 2016 · 5 comments
Closed

Naming and composability? #1

timholy opened this issue Apr 4, 2016 · 5 comments

Comments

@timholy
Copy link

timholy commented Apr 4, 2016

Leftover from JuliaLang/julia#15648 (comment).

Clearly I'm late for bikeshedding the name, but I'm not sure that name conveys the way in which they are flexible...I keep thinking of wobbly windows! I do think OffsetArrays is a better name, and wonder whether you could combine forces?

More importantly, this seems to combine the functionality of OffsetArrays and FixedSizeArrays. If OffsetArrays were implemented as a thin-wrapper around an arbitrary array type, wouldn't this be more composable?

@eschnett
Copy link
Owner

eschnett commented Apr 4, 2016

Thank you! I didn't dare publicly ask for a better name (http://goo.gl/mV9MvD) , and "Flexible" was just the best thing with which I could come up. I don't like the name myself either.

Much of the generated code depends on which dimensions have a fixed size and which don't, and which dimensions have a fixed lower bound and which don't. (It's flexible in this respect!) So the array length might or might not be fixed.

The particular use case I needed was an array where all lower bounds are 0 (for convenience), and where the first dimension is fixed, but the second is arbitrary, as in (0:3, 0:*). This led to noticeable performance benefits in my application, which has inner loops that manipulate several arrays that each have several dimensions, some fixed, some not.

I looked at FixedSizeArrays and ImmutableArrays. Both are similar to FlexibleArrays, in the case of arrays with a fixed length. FixedSizeArrays seems to allow arbitrary choices for the underlying type -- a very neat idea, if the array length is fixed.

So maybe OffsetArraysMaybeFixedLowerBoundMaybeFixedSizeMaybeFixedLengthMaybeImmutableArrays...? Or maybe just GenericArrays. (Or EmacsArrays.)

@timholy
Copy link
Author

timholy commented Apr 4, 2016

OffsetArraysMaybeFixedLowerBoundMaybeFixedSizeMaybeFixedLengthMaybeImmutableArrays would certainly make everyone appreciate the wonders of tab completion. Let's go with that 😉.

I hadn't properly appreciated just how flexible this all is, and I certainly shouldn't comment on implementation without understanding it better!

@timholy timholy closed this as completed Apr 4, 2016
@eschnett
Copy link
Owner

eschnett commented Apr 4, 2016

Wait... I really don't like the current name, do you have a suggestion?

@timholy
Copy link
Author

timholy commented Apr 4, 2016

Maybe CustomBoundsArrays?

@timholy
Copy link
Author

timholy commented Apr 10, 2016

Or UnrolledBoundsArrays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants