News for hackers. Stuff that matters.
Re:Launching Version 13.1 of Wolfram Language and Mathematica by codeulike on Thursday June 30, 2022 @01:49PM (#31935999)
Most languages I can understand how they work 'under the hood' but Mathematica just seems able to do things that I can barely imagine coding. E.g. A function that can produce the integral of any other arbitrary function?
Re:Launching Version 13.1 of Wolfram Language and Mathematica by rcollyer on Thursday June 30, 2022 @02:06PM (#31936206)
It's a set of rewrite rules with infinite outlook, i.e. a term will continue to be evaluated (rewritten) until it no longer changes. There are some limits to prevent recursion (4096 iterations is the typical limit), alongside ways to infer what the endpoint will be (again to combat infinite recursion). Alongside that, everything in the language is an expression, i.e. subject to rewrite rules. A function, then, just defines a rewrite rule, a constant (e.g. Pi) does the same with higher precedence than the functions, etc. So, a function can return another expression that is then evaluated until it no longer changes. For example, Sin[1] does not evaluate by default as it is exact while it's floating point representation is not, but Sin[0] does. Oh, the language is also homo-iconic, like Lisp, so that data and code are indistinguishable. I found that to be the hardest mental hurdle in understanding how wl functions.
Re:Launching Version 13.1 of Wolfram Language and Mathematica by moonchild on Thursday June 30, 2022 @03:02PM (#31937004)