3 ms·
imo that seems like some pretty weird semantics. how do you write an operation that needs to bundle together lists of different lengths?
by adgjlsfhk1 2y ago
imo that seems like some pretty weird semantics. how do you write an operation that needs to bundle together lists of different lengths?
- Athas 2y agoThe best answer is that you probably don't want to use Futhark for that - it's a specialised, rather restricted language. There are ways to encode irregular arrays, but it's not even remotely as ergonomic as in other languages (it can be plenty fast, however). For a particularly simple example, see https://futhark-lang.org/examples/triangular.html https://futhark-lang.org/examples/triangular.html In the future, or in a future similar language, one might well imagine an ability to "box" arrays, like in APL, which would allow true "arrays of arrays" with no restrictions on sizes.