3 ms·
> In most languages there’s a sharp distinction between programs, and data, and the output of programs. Not so in the Wolfram Language. It’s all completely flui
by mck- 13y ago
> In most languages there’s a sharp distinction between programs, and data, and the output of programs. Not so in the Wolfram Language. It’s all completely fluid. Data becomes algorithmic. Algorithms become data. There’s no distinction needed between code and data. And everything becomes both intrinsically scriptable, and intrinsically interactive. And there’s both a new level of interoperability, and a new level of modularity.
Sounds like Lisp :p
- taliesinb 13y agoIt's a little beyond that, in some ways. In the LISPs, you can view programs as data, but macros are different from, say, 'if'. The Read and Evaluate parts of the REPL are distinct phases. Whereas in Wolfram Language, If is just an ordinary symbol that has attribute HoldRest to ensure that it can prevent evaluation of its two clauses until it knows which one to evaluate. In other words, code is just data (expression) that happens to have specific rules that will cause it to evaluate in some way, yielding a new expression (which could be more code, or partially evaluated code, or data, or whatever). But you can also have rules attached to several symbols together. So for example, when you see a Foo containing a Bar, replace it with a Baz: Foo[___, Bar, ___] := Baz; It's a little like multiple dispatch, but it is slightly more general than even that. And totally pattern based (the pattern language is ridiculously rich). There's one more twist, which is that everything is not just serializable, but in some sense it is its serialization (called FullForm). It's hard to explain what this means without playing around with stuff. Also, the language has actual m-expressions, thank god, unlike most LISPs.