Comment

Comment by ianbicking

These comments would be a lot more interesting if people identified what was cool rather than just bitching about ego or syntax or licensing. I'm not going to be using the Wolfram Language, but I'd love to identify the best ideas from it. And it's a different enough language that I am confident there are interesting ideas in it.

My own contribution:

Idly looking about I come upon this page, which is not particularly notable: https://reference.wolfram.com/language/ref/Sow.html

What is notable is this example:

  In: Reap[Sow[a]; b; Sow[c]; Sow[d]; e]
  Out: {e, {{a, c, d}}}
Reap/Sow ss a funny language feature that I haven't imagined before, but that's not really the point. The point is that this is a runnable example – that's actually what is output. Typically when you run something like that you get "NameError: a is not defined". And "a" here is really a variable, of sorts – it's not a string or symbol (at least not a symbol in the sense that we know them in programming).

Given this, snippets of code are just as executable as entire programs. Every expression is like a function with the free variables as its parameters, and a sequence of expressions is a bit like function composition.

This is all natural from the perspective of mathematic notation. In a more traditional programming environment I think it's reminiscent of partial evaluation: https://en.wikipedia.org/wiki/Partial_evaluation – where you analyze a program and execute expressions opportunistically. It's really almost the same as partial evaluation, but the Wolfram Language knows a lot more about how you can execute different combinations of expressions than a typical language. A typical language does not really "believe" that (a+b) and (b+a) are equivalent. It doesn't know how to relate different operations. Nor do normal languages have a concept of simplification, so they can't speculatively try other arrangements (where none in isolation is clearly better or simpler than another) to see if simplifications are possible.

parent ianbicking 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton