The Wolfram Language is the underlying language originally used in Mathematica, but now available for use in multiple contexts.
Wolfram Language has several interfaces:
* The command line kernel interface on Raspberry Pi (just called _The Wolfram Language_) which runs interactively and can't produce graphical input.
* _Mathematica_ which is a rich text/maths editor with interactive Wolfram built in: pressing shift+Return on a "code cell" creates an output cell with the result, which is not dynamic
* _Wolfram Workbench_ which is Eclipse interfaced to the Wolfram Language backend
The code in this example can be typed in to any interface and edited with Wolfram Workbench. Loading directly into Mathematica may be awkward because the file contains no cell formatting information (which would make the file a huge mess to read as text) - it can be viewed/edited but may require some setting up.
```
(* This is a comment *)
(* In Mathematica instead of using these comments you can create a text cell
and annotate your code with nicely typeset text and images *)
(* Typing an expression returns the result *)
2*2 (* 4 *)
5+8 (* 13 *)
(* Function Call *)
(* Note, function names (and everything else) are case sensitive *)
Sin[Pi/2] (* 1 *)
(* Alternate Syntaxes for Function Call with one parameter *)
Sin@(Pi/2) (* 1 *)
(Pi/2) // Sin (* 1 *)
(* Every syntax in WL has some equivalent as a function call *)
Times[2, 2] (* 4 *)
Plus[5, 8] (* 13 *)
(* Using a variable for the first time defines it and makes it global *)
x = 5 (* 5 *)
x == 5 (* True, C-style assignment and equality testing *)
x (* 5 *)
x = x + 5 (* 10 *)
x (* 10 *)
Set[x, 20] (* I wasn't kidding when I said EVERYTHING has a function equivalent *)
x (* 20 *)
(* Because WL is based on a computer algebra system, *)
(* using undefined variables is fine, they just obstruct evaluation *)
cow + 5 (* 5 + cow, cow is undefined so can't evaluate further *)
cow + 5 + 10 (* 15 + cow, it'll evaluate what it can *)