{{Short description|Inherent parallelism in expressed computation}} {{Use American English|date=February 2024}} {{Use mdy dates|date=February 2024}} {{More citations needed|date=February 2024}} In [[computer science]], '''implicit parallelism''' is a characteristic of a [[programming language]] that allows a [[compiler]] or [[Interpreter (computing)|interpreter]] to automatically exploit the [[parallel computing|parallelism]] inherent to the computations expressed by some of the language's constructs. A pure implicitly parallel language does not need special directives, operators or functions to enable parallel execution, in contrast to [[explicit parallelism]].
Programming languages with implicit parallelism include [[Axum (programming language)|Axum]], [[Binary Modular Dataflow Machine]] (BMDFM), [[High Performance Fortran]] (HPF), [[Id (programming language)|Id]], [[LabVIEW]], [[MATLAB]] M-code, [[NESL]], [[SAC programming language|Single Assignment C]] (SAC), Streams and Iteration in a Single Assignment Language ([[SISAL]]), [[Z-level programming language]] (ZPL), and pH.<ref>{{cite book |last=Nikhil |first=Rishiyur |author2=Arvind |author2-link=Arvind (computer scientist) |date=February 20, 2024 |title=Implicit Parallel Programming in pH |publisher=Morgan Kaufmann Publishers |isbn=978-1-55860-644-9}}</ref>
==Example== If a given problem involves performing the same operation on a group of numbers (such as taking the [[sine]] or [[logarithm]] of each in turn), a language that provides implicit parallelism might allow writing the instruction thus:
<syntaxhighlight lang="matlab"> numbers = [0 1 2 3 4 5 6 7]; result = sin(numbers); </syntaxhighlight>
The compiler or interpreter can calculate the sine of each element independently, spreading the effort across multiple processors if available.
==Advantages== A programmer that writes implicitly parallel code does not need to worry about task division or process communication, focusing instead on the problem that their program is intended to solve. Implicit parallelism generally facilitates the design of parallel programs and therefore results in a substantial improvement of programmer productivity.
Many of the constructs necessary to support this also add simplicity or clarity even in the absence of actual parallelism. The example above, of [[list comprehension]] in the <code>sin()</code> function, is a useful feature in of itself. By using implicit parallelism, languages effectively have to provide such useful constructs to users simply to support required functionality (a language without a decent [[for loop]], for example, is one few programmers will use).
==Disadvantages== Languages with implicit parallelism reduce the control that a programmer has over the parallel execution of a program, resulting sometimes in suboptimal [[parallel efficiency]]. The makers of [[Oz (programming language)|Oz]] language also note that their early experiments with implicit parallelism showed that implicit parallelism made [[debugging]] difficult and [[object model]]s unnecessarily awkward.<ref>{{cite report |last1=Haridi |first1=Seif |date=2006-06-14 |chapter=Introduction |url=http://www.mozart-oz.org/documentation/tutorial/node1.html#chapter.introduction |title=Tutorial of Oz |url-status=usurped |archive-url=https://web.archive.org/web/20110514010946/http://www.mozart-oz.org/documentation/tutorial/node1.html#chapter.introduction |archive-date=2011-05-14 |access-date=2007-09-20}}</ref>
A larger issue is that every program has some parallel and some serial logic. Binary [[input/output]] (I/O), for example, requires support for such serial operations as <code>Write()</code> and <code>Seek()</code>. If implicit parallelism is desired, this creates a new requirement for constructs and keywords to support code that cannot be [[Thread (computing)|threaded]] or distributed.
== Notes == {{Reflist}}
{{Parallel computing}}
[[Category:Parallel computing]] <!-- Hidden categories below --> [[Category:Articles with example MATLAB/Octave code]]
{{Comp-sci-stub}}