Futhark (programming language): Difference between revisions

Content deleted Content added
Template:Infobox programming language, WP:REFerence WP:CITation: parameters: add, reorders, update-standardizes, conform to master templates. WP:LINKs: underscores > spaces, update-standardizes, needless: WP:PIPEs > WP:NOPIPEs, semi-WP:EASTEREGGs for WP:LEAST surprise, adds. MOS:FIRSTABBReviations clarify, define before WP:ABBRs in parentheses. WP:CATEGORYs add.
Wtoteqw (talk | contribs)
Importing Wikidata short description: "Programming language"
 
(8 intermediate revisions by 3 users not shown)
Line 1:
{{Short description|Programming language}}
{{Infobox programming language
|name = Futhark
|paradigm = [[Array programming|Arrayarray]], [[Functional programming|functional]]
|family = [[ML (programming language)|ML]]
|designer = Troels Henriksen, Cosmin Oancea, Martin Elsman
Line 8 ⟶ 9:
|latest release version =
|latest release date =
|typing = [[Type inference|Inferredinferred]], [[Static typing|static]], [[Strong and weak typing|strong]], [[Hindley–Milner type system|Hindley–Milner]], [[Uniqueness type|uniqueness]], [[Dependent type|dependent]]
|implementations =
|dialects =
|influenced by = [[APL (programming language)|APL]], [[Haskell]], [[NESL]], [[Standard ML]]
|influenced =
|operating_systemoperating system = [[Cross-platform software|cross-platform]]
|license = [[ISC license|ISC]]
|website = {{URL|futhark-lang.org}}
}}
 
'''Futhark''' is a [[functionalComparison of multi-paradigm programming languages|multi-paradigm]], [[High-level programming language|high-level]], [[Functional programming|functional]], [[dataData parallelism|data parallel]], [[arrayArray programming|array]] [[programming language]]. It is a [[Dialect (computing)|dialect]] of the language [[ML (programming language)|ML]], originally developed at [[UCPH Department of Computer Science]] (DIKU) as part of the HIPERFIT project.<ref>{{cite web |url=http://hiperfit.dk/ |title=Home |website=hiperfit.dk}}</ref> It focuses on enabling data parallel programs written in a functional style to be executed with high performance on [[massively parallel]] hardware, in particular onespecially [[graphics processing unit]]s (GPUs). Futhark is strongly inspired by [[NESL]], and its implementation uses a variant of the [[flattening transformation]], but imposes constraints on how parallelism can be expressed in order to enable more aggressive compiler optimisations. In particular, irregular nested data parallelism is not supported.<ref>{{cite conference |last1=Henriksen |first1=Troels |last2=Serup |first2=Niels G. W. |last3=Elsman |first3=Martin |last4=Henglein |first4=Fritz |last5=Oancea |first5=Cosmin |date=2017 |url=https://futhark-lang.org/publications/pldi17.pdf |title=Futhark: Purely Functional GPU-Programming with Nested Parallelism and In-Place Array Updates |publisher=ACM |book-title=Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation |conference=PLDI 2017}}</ref> It is [[free and open-source software]] released under an [[ISC license]].
 
== Overview ==
Futhark is a language in the [[ML (programming language)|ML]] family, with an indentation-insensitive syntax derived from [[OCaml]], [[Standard ML]], and [[Haskell]]. The [[type system]] is based on a [[Hindley-MilnerHindley–Milner type system]] with a variety of extensions, such as [[uniqueness type]]s and [[Dependent type|size-[[dependent typestype]]s. Futhark is not intended as a [[general-purpose programming language]] for writing full applications, but is instead focused on writing computational''[[compute "kernels"kernel]]s'' (not necessarilyalways the same as a [[Compute kernel|''GPU kernel]]'') which are then invoked from applications written in conventional languages.<ref>{{cite web |url=https://futhark.readthedocs.io/en/latest/ |title=Futhark User's Guide |website=futhark.readthedocs.io}}</ref>
 
Futhark is named after [[Runes#Runic_alphabets|the first six letters of the Runic alphabet]].<ref>{{cite thesis |last=Troels |first=Henriksen |date=November 2017 |title=Design and Implementation of the Futhark Programming Language |url=https://futhark-lang.org/publications/troels-henriksen-phd-thesis.pdf |degree=PhD |publisher=University of Copenhagen |access-date=2024-05-25}}</ref>{{rp|2}}
Futhark is a language in the [[ML (programming language)|ML]] family, with an indentation-insensitive syntax derived from [[OCaml]], [[Standard ML]], and [[Haskell]]. The type system is based on [[Hindley-Milner]] with a variety of extensions, such as [[uniqueness type]]s and [[Dependent type|size-dependent types]]. Futhark is not intended as a [[general-purpose programming language]] for writing full applications, but is instead focused on writing computational "kernels" (not necessarily the same as a [[Compute kernel|GPU kernel]]) which are then invoked from applications written in conventional languages.<ref>{{cite web|url=https://futhark.readthedocs.io/en/latest/|title=Futhark User's Guide|website=futhark.readthedocs.io}}</ref>
 
== Examples ==
 
=== Dot product ===
 
The following program computes the [[dot product]] of two vectors containing double-precision numbers.
 
Line 43:
 
=== Matrix multiplication ===
 
The following program performs [[matrix multiplication]], using the definition of dot product above.
 
Line 54 ⟶ 53:
</syntaxhighlight>
 
NoteThis shows how the types enforce that the function is only invoked with matrices of compatible size. FurtherAlso, thisit is an example of nested [[data parallelism]].
 
== References ==
{{Reflist}}<!-- Inline citations added to your article will automatically display here. See en.wikipedia.org/wiki/WP:REFB for instructions onshows how to add citations. -->
{{Reflist}}
 
{{ML programming}}
{{Parallel computing}}
 
[[Category:Programming languages]]
[[Category:DependentlyHigh-level typedprogramming languages]]
[[Category:Functional languages]]
[[Category:Parallel computing]]
[[Category:Array programming languages]]
[[Category:Dependently typed languages]]
[[Category:Dependently typed programming]]
[[Category:Programming languages]]
[[Category:Statically typed programming languages]]
[[Category:Dependently typed languages]]
[[Category:ML programming language family]]
[[Category:Free compilers and interpretersopen source compilers]]
[[Category:2014 software]]
[[Category:Programming languages created in 2014]]
[[Category:Software using the ISC license]]