Because most of Mathematica is written in Mathematica, you can actually introspect large parts of the codebase (by using DownValues). Try e.g.:
DownValues[GraphPlot]
Sometimes various symbols are 'ReadProtected', which prevents you from seeing their internal definition. But guess what? You can just Unprotect them and remove that attribute. And even introduce new definitions to monkey-patch the language!Only a smallish subset of the language is written in C (for speed).
Edit: It's also kinda fun to use
Names["*`*"]
to see all the defined symbols in a fresh kernel -- there's a lot of hidden stuff there. Try Names["Internal`*"]
Names["Developer`*"]
to see some stuff the developers kept to themselves :)Interesting! Most things I tried cannot be introspected though (e.g. DSolve, LaplaceTransform) and it's of course a far cry from a commented source file or notebook. Still, more than I thought was possible with Mathematica.
> a new kind of science developed that produced results through opaque processes in closed source proprietary software.
The amount of restraint you've just shown in describing NKS is superhuman.
I share the dream of an open source Mathematica. It's so rich, elegant and powerful, using it would be a no-brainer. But in its present state? Nope. I've been bitten too many times by the proprietary nature of Matlab, in which I have invested a lot of work, to repeat the mistake. More specifically and from the top of my mind, I found that proprietary means:
Notably absent from the list is the notion that I cannot check what is happening in the proprietary code. That is because the Matlab functions I needed to check were written in Matlab and perfectly readable. I'm sure the issue is real though, and I would be concerned if a new kind of science developed that produced results through opaque processes in closed source proprietary software.[1] http://www.bestofama.com/Stephen_Wolfram/qisot