Wolfram Language Explained

Wolfram Language
Logo Size:120px
Paradigm:Multi-paradigm

term-rewriting, functional, procedural, array

Typing:Dynamic, strong
Designer:Stephen Wolfram
Developer:Wolfram Research
Latest Release Version:14.1.0[1]
Implementations:Mathematica, Mathics, Expreduce, MockMMA
Genre:Computer algebra, numerical computations, information visualization, statistics, user interface creation-->
Influenced By:
Influenced:
Operating System:Cross-platform
License:Proprietary
File Ext:.nb, .m, .wl

The Wolfram Language is a proprietary,[7] general, very high-level multi-paradigm programming language[8] developed by Wolfram Research. It emphasizes symbolic computation, functional programming, and rule-based programming[9] and can employ arbitrary structures and data.[9] It is the programming language of the mathematical symbolic computation program Mathematica.[10]

History

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, matrix manipulations, and solve differential equations using a set of rules. Also, the initial version introduced the notebook model and the ability to embed sound and images, according to Theodore 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 for Raspberry Pi users, and they needed to come up with a name for it.[14] It was included in the recommended software bundle that the Raspberry Pi Foundation provides for beginners, which caused some controversy due to the Wolfram language's proprietary nature.[15] Plans to port the Wolfram language to the Intel Edison were announced after the board's introduction at CES 2014 but were never released.[16] In 2019, a link was added to make Wolfram libraries compatible with the Unity game engine, giving game developers access to the language's high-level functions.[17] [18]

Syntax

The Wolfram Language syntax is overall similar to the M-expression of 1960s LISP, with support for infix operators and "function-notation" function calls.

Basics

The Wolfram language writes basic arithmetic expressions using infix 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=(* = *)

Syntactic sugar

The language may deviate from the M-expression paradigm when an alternative, more human-friendly way of showing an expression is available:

A formatter desugars the input:[19]

FullForm[1+2](* = Plus[1, 2] *)

Functional programming

Currying is supported.

Pattern matching

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. is syntax sugar for, i.e. a "blank" for any value to replace x in the rest of the evaluation.

An iteration of bubble sort is expressed as:sortRule := /; y>z -> (* 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 when . The three underscores are a syntax for a, for a sequence that can be null.

A ReplaceRepeated operator can be used to apply this rule repeatedly, until no more change happens: //. sortRule(* = ReplaceRepeated[{ 9, 5, 3, 1, 2, 4 }, sortRule] *)(* = *)

The pattern matching system 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

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 the open source MIT License.[22] The parser was originally developed in C++ but was rewritten in Rust in 2023. The reference book is open access.[23]

In the over three-decade-long existence of the Wolfram language, a number of open-source third-party implementations have also been developed. Richard Fateman's MockMMA 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 include Symja in Java, expreduce in Golang, and SymPy-based Mathics.[24] These implementations focus on the core language and the computer algebra system that it implies, not on the online "knowledgebase" features of Wolfram.

In 2019,[25] Wolfram Research released the freeware Wolfram Engine, to be used as a programming library in non-commercial software.[26]

Naming

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

External links

Notes and References

  1. Web site: The Story Continues: Announcing Version 14 of Wolfram Language and Mathematica. Stephen Wolfram Writings. 2024-07-31. en. 2024-07-31.
  2. Web site: Wolfram . Stephen . Tini Veltman (1931–2021): From Assembly Language to a Nobel Prize—Stephen Wolfram Writings . stephenwolfram.comwritings. . 22 January 2021 . en.
  3. Book: Maeder, Roman E. . The Mathematica® Programmer . Academic Press, Inc. . 1994 . 978-1-48321-415-3 . 6.
  4. Web site: Wolfram Language Q&A . Wolfram Research . 2016-12-05.
  5. News: The Scientific Paper Is Obsolete. Somers. James. The Atlantic. 2018-04-10. en-US.
  6. Web site: Clojure Bookshelf . Amazon.com . Hickey . Rich . https://web.archive.org/web/20171003001051/https://www.amazon.com/gp/richpub/listmania/fullview/R3LG3ZBZS4GCTH . 2017-10-03 . 2020-05-06.
  7. Web site: Wolfram Open Code, Open Source, Open Data, Open Resources . 2023-02-03 . www.wolfram.com . en.
  8. Web site: Notes for Programming Language Experts about Wolfram Language. Wolfram.com. 2015-11-05.
  9. Web site: What Should We Call the Language of Mathematica?—Stephen Wolfram Blog. 2013-02-12. Blog.stephenwolfram.com. 2015-11-05.
  10. Web site: Celebrating Mathematica's First Quarter Century—Wolfram Blog. 23 June 2013 . Blog.wolfram.com. 2015-11-05.
  11. Wolfram (1988). Mathematica, a System for Doing Mathematics By Computer.
  12. News: Thoughts on Mathematica. Hayes. Brian. 1990-01-01. Pixel.
  13. Web site: Wolfram Language & System Documentation Center. Reference.wolfram.com. 2015-11-05.
  14. Web site: Putting the Wolfram Language (and Mathematica) on Every Raspberry Pi—Wolfram Blog. 21 November 2013 . Blog.wolfram.com. 2015-11-05.
  15. Web site: Premium Mathematica software free on budget Raspberry Pi - CNET. Sherr. Ian. 2013-11-22. News.cnet.com. 2015-11-05.
  16. Web site: Intels Edison: Pentium-System im Format einer SD-Karte | heise online. Daniel AJ Sokolov. 2014-11-22. Heise.de. 2015-11-05.
  17. Web site: The Wolfram Language will soon be integrated into Unity. 2014-03-10. Gamasutra. 2015-11-05.
  18. Web site: Is there a way to use Wolfram Language in Unity3D?. 2017. Wolfram. 11 April 2017. https://web.archive.org/web/20170719095116/https://community.wolfram.com/groups/-/m/t/312155. deviated. 19 July 2017.
  19. Web site: FullForm . Wolfram Language Documentation.
  20. Web site: Welcome to Rubi, the Rule-based Integrator . Rule-based Integration.
  21. Web site: McLoone . J . Why Wolfram Tech Isn't Open Source—A Dozen Reasons—Wolfram Blog . 2 April 2019 . en.
  22. Web site: codeparser: Parse Wolfram Language source code as abstract syntax trees (ASTs) or concrete syntax trees (CSTs) . GitHub . Wolfram Research, Inc..
  23. Web site: Open Materials from Wolfram: Open Code, Open Source, Open Data, Open Resources . www.wolfram.com . en.
  24. Web site: Simon . Is there an open source implementation of Mathematica-the-language? . Mathematica Stack Exchange.
  25. Web site: Wolfram . Steven . Launching Today: Free Wolfram Engine for Developers—Stephen Wolfram Writings . 21 May 2019 . en.
  26. Web site: Free Wolfram Engine for Developers . www.wolfram.com . 19 January 2021 . en.
  27. Web site: Kastrenakes . Jacob . 2013-11-14 . Wolfram announces 'most important' project: a programming language that models the world . 2023-09-21 . The Verge . en-US.
  28. Web site: 2013-11-13 . Something Very Big Is Coming: Our Most Important Technology Project Yet—Stephen Wolfram Writings . 2023-09-21 . writings.stephenwolfram.com . en.