Skip to content
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.

Add support for fixed sized arrays #47

Closed
densh opened this issue Jun 5, 2015 · 3 comments
Closed

Add support for fixed sized arrays #47

densh opened this issue Jun 5, 2015 · 3 comments
Labels

Comments

@densh
Copy link
Owner

densh commented Jun 5, 2015

They would be embeddable into offheap classes as they are fixed size. The length would be statically known which can improve performance of some of the operations. As length is known there would be no need to store in the header of the allocated data.

From the point of view of API it would probably look something along the lines of:

val a1 = FixedArray(1, 2, 3) // a1: FixedArray[_3, Int]
val a2 = farr.map(_ * 2)     // loop can be fully unrolled here

Where _3 is some encoding of type-level integers (probably based on consant types.)

@densh densh changed the title Consider adding support for fixed sized arrays. Add support for fixed sized arrays Jun 7, 2015
@densh densh added this to the 0.1 milestone Jun 8, 2015
@densh
Copy link
Owner Author

densh commented Jun 16, 2015

This depends on #39 as we need to implement operations we care about on regular arrays first. Some of them where output size of the array might be smaller than input size (e.g. filter) are going to be quite problematic as one would have to express size changes in the types for it to work. I think I underestimated complexity of the implementation here and we should wait for 0.1 to happen first.

@densh densh removed this from the 0.1 milestone Jun 16, 2015
@densh
Copy link
Owner Author

densh commented Jun 28, 2016

Given little to no interest I'm closing the issue. At the same time we're likely to have fixed-size arrays in Scala Native for interop reasons. scala-native/scala-native#35

@densh densh closed this as completed Jun 28, 2016
@l15k4
Copy link

l15k4 commented Jan 24, 2017

Hey, making fixed size arrays Allocatable would be also useful in order to be able to build arrays of arrays and thus be able to introduce other collections types like Maps.

#114

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

No branches or pull requests

2 participants