Wolfram Language
![]() | This article has multiple issues.Please helpimprove itor discuss these issues on thetalk page.(Learn how and when to remove these template messages)
|
![]() | |
Paradigm | Multi-paradigm:term-rewriting,functional,procedural,array |
---|---|
Designed by | Stephen Wolfram |
Developer | Wolfram Research |
First appeared | 1988 |
Stable release | 14.1.0[1]
/ July 31, 2024 |
Typing discipline | Dynamic,strong |
OS | Cross-platform |
License | Proprietary |
Filename extensions | .nb,.m,.wl |
Website | www |
Majorimplementations | |
Mathematica,Mathics,Expreduce,MockMMA | |
Influenced by | |
Influenced | |
TheWolfram Language(/ˈwʊlfrəm/WUUL-frəm) is a proprietary,[7]general,very high-levelmulti-paradigm programming language[8]developed byWolfram Research.It emphasizessymbolic computation,functional programming,andrule-based programming[9]and can employ arbitrarystructuresand data.[9]It is the programming language of the mathematical symbolic computation programMathematica.[10]
History
[edit]The Wolfram Language was part of the initial version of Mathematica in 1988.[11]
Symbolic aspects of the engine make it a computer algebra system. The language can perform integration, differentiation,matrixmanipulations, and solvedifferential equationsusing a set of rules. Also, the initial version introduced the notebook model and the ability to embed sound and images, according toTheodore Gray's patent.[12]
Wolfram also added features for more complex tasks, such as 3D modeling.[13]
A name was finally adopted for the language in 2013, as Wolfram Research decided to make a version of the language engine free forRaspberry Piusers, and they needed to come up with a name for it.[14]It was included in the recommended software bundle that theRaspberry Pi Foundationprovides for beginners, which caused some controversy due to the Wolfram language'sproprietarynature.[15]Plans to port the Wolfram language to theIntel Edisonwere announced after the board's introduction atCES 2014but were never released.[16]In 2019, a link was added to make Wolfram libraries compatible with theUnitygame engine, giving game developers access to the language's high-level functions.[17][18]
Syntax
[edit]The Wolfram Language syntax is overall similar to theM-expressionof 1960sLISP,with support forinfix operatorsand "function-notation" function calls.
Basics
[edit]The Wolfram language writes basic arithmetic expressions usinginfix operators.
(* This is a comment. *)
4+3
(* = 7 *)
1+2*(3+4)
(* = 15 *)
(* Note that Multiplication can be omitted: 1 + 2 (3 + 4) *)
(* Divisions return rational numbers: *)
6/4
(* = 3/2 *)
Function calls are denoted with square brackets:
Sin[Pi]
(* = 0 *)
(* This is the function to convert rationals to floating point: *)
N[3/2]
(* = 1.5 *)
Lists are enclosed in curly brackets:
Oddlist={1,3,5}
(* = {1,3,5} *)
Syntactic sugar
[edit]The language may deviate from the M-expression paradigm when an alternative, more human-friendly way of showing an expression is available:
- A number of formatting rules are used in this language, including
TeXForm
for typeset expressions andInputForm
for language input. - Functions can also be applied using the prefix expression
@
and the postfix expression//
. - Derivatives can be denoted with the apostrophe
'
. - The infix operators themselves are considered "sugar"for thefunction notationsystem.
AFullForm
formatter desugars the input:[19]
FullForm[1+2]
(* = Plus[1, 2] *)
Functional programming
[edit]Curryingis supported.
Pattern matching
[edit]Functions in the Wolfram Language are effectively a case of simple patterns for replacement:
F[x_]:=x^0
The:=
is a "SetDelayed operator", so that the x is not immediately looked for.x_
is syntax sugar forPattern[x, Blank[]]
,i.e. a "blank" for any value to replace x in the rest of the evaluation.
An iteration ofbubble sortis expressed as:
sortRule:={x___,y_,z_,k___}/;y>z->{x,z,y,k}
(* Rule[Condition[List[PatternSequence[x, BlankNullSequence[]], Pattern[y, Blank[]], Pattern[z, Blank[]], PatternSequence[k, BlankNullSequence[]]], Greater[y, z]], List[x, z, y, k]] *)
The/;
operator is "condition", so that the rule only applies wheny>z
.The three underscores are a syntax for aBlankNullSequence[]
,for a sequence that can be null.
A ReplaceRepeated//.
operator can be used to apply this rule repeatedly, until no more change happens:
{9,5,3,1,2,4}//.sortRule
(* = ReplaceRepeated[{ 9, 5, 3, 1, 2, 4 }, sortRule] *)
(* = {1, 2, 3, 4, 5, 9} *)
Thepattern matchingsystem also easily gives rise to rule-based integration and derivation. The following are excerpts from the Rubi package of rules:[20]
(* Reciprocal rule *)
Int[1/x_,x_Symbol]:=
Log[x];
(* Power rule *)
Int[x_^m_.,x_Symbol]:=
x^(m+1)/(m+1)/;
FreeQ[m,x]&&NeQ[m,-1]
Implementations
[edit]The official and reference implementation of the Wolfram Language lies in Mathematica and associated online services. These are closed source.[21]Wolfram Research has, however, released a parser of the language under theopen sourceMIT License.[22]The parser was originally developed inC++but was rewritten inRustin 2023. The reference book isopen access.[23]
In the over three-decade-long existence of the Wolfram language, a number ofopen-sourcethird-party implementations have also been developed.Richard Fateman'sMockMMA from 1991 is of historical note, both for being the earliest reimplementation and for having received a cease-and-desist from Wolfram. Modern ones still being maintained as of April 2020[update]include Symja inJava,expreduce inGolang,andSymPy-basedMathics.[24]These implementations focus on the core language and thecomputer algebra systemthat it implies, not on the online "knowledgebase" features of Wolfram.
In 2019,[25]Wolfram Research released thefreewareWolfram Engine, to be used as a programming library in non-commercial software. This developer-only engine provides a command-line shell of the Mathematica evaluator (with a limited number of kernels) and requires signup and license activation over the web. The freely available Jupyter Notebook/Lab project provides a protocol (ZMQ) to connect their notebooks to various languages, this is available as an alternative to the text-only CLI interface via theWolfram Kernel for Jupyter.[26]
Naming
[edit]The language was officially named in June 2013 and has been used as the backend of Mathematica and other Wolfram technologies for over 30 years.[27][28]
See also
[edit]References
[edit]- ^"The Story Continues: Announcing Version 14 of Wolfram Language and Mathematica".Stephen Wolfram Writings.2024-07-31.Retrieved2024-07-31.
- ^Wolfram, Stephen."Tini Veltman (1931–2021): From Assembly Language to a Nobel Prize—Stephen Wolfram Writings".stephenwolfram writings.Retrieved22 January2021.
- ^Maeder, Roman E. (1994).The Mathematica® Programmer.Academic Press, Inc. p. 6.ISBN978-1-48321-415-3.
- ^"Wolfram Language Q&A".Wolfram Research.Retrieved2016-12-05.
- ^Somers, James."The Scientific Paper Is Obsolete".The Atlantic.Retrieved2018-04-10.
- ^Hickey, Rich."Clojure Bookshelf".Amazon.Archived fromthe originalon 2017-10-03.Retrieved2020-05-06.
- ^"Wolfram Open Code, Open Source, Open Data, Open Resources".wolfram.Retrieved2023-02-03.
- ^"Notes for Programming Language Experts about Wolfram Language".Wolfram.Retrieved2015-11-05.
- ^ab"What Should We Call the Language of Mathematica?—Stephen Wolfram Blog".Blog.stephenwolfram. 2013-02-12.Retrieved2015-11-05.
- ^"Celebrating Mathematica's First Quarter Century—Wolfram Blog".Blog.wolfram. 23 June 2013.Retrieved2015-11-05.
- ^Wolfram (1988). Mathematica, a System for Doing Mathematics By Computer.
- ^Hayes, Brian (1990-01-01)."Thoughts on Mathematica"(PDF).Pixel.
- ^"Wolfram Language & System Documentation Center".Reference.wolfram.Retrieved2015-11-05.
- ^"Putting the Wolfram Language (and Mathematica) on Every Raspberry Pi—Wolfram Blog".Blog.wolfram. 21 November 2013.Retrieved2015-11-05.
- ^Sherr, Ian (2013-11-22)."Premium Mathematica software free on budget Raspberry Pi - CNET".News.cnet.Retrieved2015-11-05.
- ^Daniel AJ Sokolov (2014-11-22)."Intels Edison: Pentium-System im Format einer SD-Karte | heise online".Heise.de.Retrieved2015-11-05.
- ^"The Wolfram Language will soon be integrated into Unity".Gamasutra. 2014-03-10.Retrieved2015-11-05.
- ^"Is there a way to use Wolfram Language in Unity3D?".Wolfram. 2017. Archived fromthe originalon 19 July 2017.Retrieved11 April2017.
- ^"FullForm".Wolfram Language Documentation.
- ^"Welcome to Rubi, the Rule-based Integrator".Rule-based Integration.
- ^McLoone, J (2 April 2019)."Why Wolfram Tech Isn't Open Source—A Dozen Reasons—Wolfram Blog".
- ^"codeparser: Parse Wolfram Language source code as abstract syntax trees (ASTs) or concrete syntax trees (CSTs)".GitHub.Wolfram Research, Inc.
- ^"Open Materials from Wolfram: Open Code, Open Source, Open Data, Open Resources".wolfram.
- ^Simon."Is there an open source implementation of Mathematica-the-language?".Mathematica Stack Exchange.
- ^Wolfram, Steven (21 May 2019)."Launching Today: Free Wolfram Engine for Developers—Stephen Wolfram Writings".
- ^"Free Wolfram Engine for Developers".wolfram.Retrieved19 January2021.
- ^Kastrenakes, Jacob (2013-11-14)."Wolfram announces 'most important' project: a programming language that models the world".The Verge.Retrieved2023-09-21.
- ^"Something Very Big Is Coming: Our Most Important Technology Project Yet—Stephen Wolfram Writings".writings.stephenwolfram.2013-11-13.Retrieved2023-09-21.
External links
[edit]- Array programming languages
- Notebook interface
- Computer algebra systems
- Cross-platform software
- Dynamically typed programming languages
- Finite element software
- Functional languages
- High-level programming languages
- Multi-paradigm programming languages
- Programming languages created in 1988
- Term-rewriting programming languages
- Wolfram Research