Previous | Next --- Slide 55 of 94
Back to Lecture Thumbnails
Kecleon

definitely seeing syntax from other programming languages/libraries as well, foreach is used in javascript, and gather is used in pytorch. Interesting to see the history of those syntax.

ngeller

Is there any reason NOT to include abstractions like this in new/modern programming languages? As @Kecleon mentioned, some of these abstractions are beginning to pop up elsewhere, and given the paradigm shift toward parallel computing, this makes sense. Surely there must be some tradeoffs, though.

evs

I didn't catch this from the lecture but does the foreach loop take the interleaving approach? So is the very first SIMD instruction on the indices 0 - 8?

rubensl

I think the very first SIMD instruction would operate on indices 0-7 since there are 8-wide, it wouldn't include 8.

tanner

@ngeller it also depends on the types of computations that the programming language is designed to facilitate. For example, I can't think of a great use for such a construct in a programming language geared toward systems programming -- for example, C. Granted, C is old. But even in newer languages like Rust -- which is gathering steam in various OS projects (from Google's Fuschia, to even Linux (https://www.zdnet.com/article/linus-torvalds-on-where-rust-will-fit-into-linux/)) -- such a construct is, as far as I can tell, absent. The way I see it, the community behind any language could choose to build such a construct into their language, but would only do so if they anticipate it seeing large use.

alexder

I'm curious to know how this is parallelized under the hood. I'm assuming that every iteration of this loop is assigned its own thread/process and that is determined at runtime.

Please log in to leave a comment.