Concurrency and Parallelism - lcompilers/lpython GitHub Wiki

This is a brainstorming list of candidate ideas for adding concurrency and parallelism constructs to ASR. No decisions have been made and no pilot implementations have been started as of 28 September 2022.

  • Software Transactional Memory (STM) --- At the bottom level, STM furnishes a small, clean, and fast abstraction for concurrent access to data. Haskell and Clojure furnish successful, practical examples.

  • Rx, The Reactive Extensions --- LINQ is a query language roughly isomorphic to SQL. LINQ-Over-Objects is a successful implementation over collections of objects in memory. Rx is a successful implementation over asynchronous data streams.

  • Clojure's Five-Pointed Star: Atom, Agent, Var, Future, Promise --- Implementing Rx in Clojure revealed that all five of these constructs were required, and no more. This is strong evidence that these five constructs are sufficient and necessary for any concurrency abstractions. They inhabit a level above STM and below async / await.

  • async / await --- This popular abstraction might be the best and easiest to expose at the top level of ASR.