Pure (programming language): Difference between revisions

Content deleted Content added
No edit summary
WP:LINKs: update-standardizes, needless WP:PIPEs > WP:NOPIPEs; adds. Small WP:COPYEDIT WP:EoS clarify.
Line 16:
|latest release version = 0.68
|latest release date = {{Start date and age|2018|04|11|df=yes}}
|typing = [[Strong and weak typing|Strongstrong]], [[Type system#DYNAMIC|dynamic]]
|implementations =
|dialects =
|operating system = [[Cross-platform software|Cross-platform]]: [[FreeBSD]], [[Linux]], [[macOS]], [[Microsoft Windows|Windows]]
|license = [[GNU Lesser General Public License]]
|influenced by = [[Q (programming language from Kx Systems)|Q]], [[Haskell (programming language)|Haskell]], [[Lisp (programming language)|Lisp]], [[Alice (programming language)|Alice]], [[MATLAB]]
|influenced =
|website = {{URL|https://agraef.github.io/pure-lang/}}
}}
 
'''Pure''', successor to the equational language '''Q''', is a dynamically typed, [[Functional programming|functional]] [[programming language]] based on [[term rewriting]]. It has facilities for user-defined [[operatorOperator (computer programming)|operator]] [[Syntax (programming languages)|syntax]], [[Macro (computer science)|macros]], [[arbitrary-precision arithmetic]] (multiple-precision numbers), and compiling to native code through the [[LLVM]]. Pure is [[free and open-source software]] distributed (mostly) under the [[GNU Lesser General Public License]] version 3 or later.
 
== Overview ==
Pure comes with an [[Interpreter (computing)|interpreter]] and [[debugger]], provides [[Garbage collection (computer science)|automatic memory management]], has powerful functional and symbolic programming abilities, and interfaces to [[Library (computing)|libraries]] in [[C (programming language)|C]] (e.g., for numerics, low-level protocols, and other such tasks). At the same time, Pure is a ''small'' language designed from scratch; its interpreter is not large, and the library modules are written in Pure. The syntax of Pure resembles that of [[Miranda (programming language)|Miranda]] and [[Haskell (programming language)|Haskell]], but it is a [[free-format language]] and thus uses explicit delimiters[[delimiter]]s (rather than [[off-side rule]] indents) to denote program structure.
 
The Pure language is a successor of the equational programming language Q, previously created by the same author, Albert Gräf at the [[University of Mainz]], Germany. Relative to Q, it offers some important new features (such as local functions with [[lexical scoping]], efficient vector and matrix support, and the built-in C interface) and programs run much faster as they are [[Just-in-time compilation|compiled just-in-time]] to native code on the fly. Pure is mostly aimed at mathematical applications and [[scientific computing]] currently, but its interactive interpreter environment, the C interface and the growing set of addon modules make it suitable for a variety of other applicationsuses, such as [[artificial intelligence]], symbolic computation, and real-time multimedia processing.
 
Pure [[Plug-in (computing)|plug-ins]] are available for the [[Gnumeric]] spreadsheet and Miller Puckette's [[Pure Data]] graphical multimedia software, which make it possible to extend these programs with functions written in the Pure language. Interfaces are also provided as library modules to [[GNU Octave]], [[OpenCV]], [[OpenGL]], the [[GNU Scientific Library]], [[FAUST (programming language)|FAUST]], [[SuperCollider]], and liblo (for [[Open Sound Control]] (OSC)).
Line 140:
</syntaxhighlight>
 
Calling [[C (programming language)|C]] functions from Pure is very easy. E.g., for a [["Hello, World!" program]], the following imports the <code>puts</code> function from the [[C library]] and uses it to print the string <code>"Hello, world!"</code> on the terminal:
 
<syntaxhighlight lang="c">
Line 160:
 
== Notes ==
 
{{Reflist}}
 
==External links==
* {{Official website|https://agraef.github.io/pure-lang/}}
* [http://puredocs.bitbucket.org/ Pure language and library documentation]
* [http://purelang.bitbucket.org/quickref/pure-quickref.pdf Pure quick reference]