DSLX: No way to do for-loop parallel sends
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Say I have N components that I want to send to in parallel. I'll need a way of collecting their tokens so we can join on them later.
Something like:
```
const NUM_THINGS = u32:4;
let toks = token[NUM_THINGS]:[???, ...];
for toks = for (i, toks) in range(0, NUM_THINGS) {
let x = send(tok, chan[i], foo);
update(toks, i, x);
}(toks);
let tok = join(toks);
```
1. There's no _clean_ way to declare a literal token. You can fudge it by doing `join()` with no arguments.
2. You can't declare literal token arrays: `TypeInferenceError: uN[4] Annotated type for array literal must be an array type; got ubits token[4]`.
3. `join()` doesn't accept arrays.
Contributor guide
Assessment
This issue has not been assessed yet.