4 ms·
Beyond surface similarities like an emphasis on data transformation over side-effects, I wouldn't call Mathematica a functional language. It's much better class
by brandonbloom 11y ago
Beyond surface similarities like an emphasis on data transformation over side-effects, I wouldn't call Mathematica a functional language. It's much better classified as a term rewriting language: https://en.wikipedia.org/wiki/Category:Term-rewriting_programming_languages https://en.wikipedia.org/wiki/Category:Term-rewriting_progra...
- 4ad 11y agoThen I guess you don't call Lisp a functional language either?
- strmpnk 11y agoThe syntactical building blocks might be similar but the execution model differs. While you could obviously achieve any sort of term evaluation with a metainterpreter, the TRS in Mathematica offers a rather smart rewriting system. It can easily express things like associative and commutative operators (esp. useful if you have a pattern that matches on a use of that operator), and alternate evaluation orders (outside-in, mixed, lazy, held, &c). These are hard to trivially implement w/o very different kind of interpreter. In this sense, most Lisp implementations pick a static evaluation strategy and leave implementing alternatives to a metainterpreter, which isn't exactly what's happening in Mathematica.
- brandonbloom 11y agoLisp's evaluation strategy is based on a very particular category of rewriting systems known as the lambda calculus. Mathematica's is an abstract rewrite system with a broad set of evaluation strategies that are not easily represented in the lambda calculus (without first implementing a term rewriting system).