4 ms·
> we don’t have a really widely supported construct in programming that is like a for loop, but with no dependency allowed between iterations Uhhh... we don't?
by epgui 1y ago
> we don’t have a really widely supported construct in programming that is like a for loop, but with no dependency allowed between iterations
Uhhh... we don't? It seems to me like we do. This is a solved problem. Depending on what you're trying to do, there's map, reduce, comprehensions, etc.
- dkarl 1y agoAnd for those who also don't want to be forced to sequence the computations, i.e., wanting to run them concurrently and potentially in parallel, each approach to concurrency supports its own version of this. For example, choosing Scala on the JVM because that's what I know best, the language provides a rich set of maps, folds, etc., and the major libraries for different approaches to concurrency (futures, actors, effect systems) all provide ways to transform a collection of computations into a collection of concurrent operations. Curious if the poster who said "we don't have a really widely supported construct" works in a language that lacks a rich concurrency ecosystem or if they want support baked into their language.
- epgui 1y agoThat's right-- Personally I like to think in functional programming terms, and with FP concurrency/parallelism is more or less a non-issue.