
Cruncher: An implementation of Bret Victor's Scrubbing Calculator - luu
https://github.com/osnr/cruncher
======
osnr
Hey all! I've been working on this on-and-off for a few months, but it is sort
of in a broken state right now on GitHub. I'm playing with some modifications
to the charts and dependency graph, and the localStorage autosave/load is a
bit glitchy.

Just saw Dan posted it now, and figured I should chime in (and push my last
few commits).

The version here works the OK-est, but it still needs work:
[http://www.omarrizwan.com/cruncher/](http://www.omarrizwan.com/cruncher/)

Hoping to get back to it sometime within the next few weeks.

~~~
ivan_ah
Thx for the link to the better demo.

I like all the graphical add-ons like the data flow graph: you have an
expression graph so why not show it to the user...

This file is very interesting:
[https://github.com/osnr/cruncher/blob/master/src/jison/parse...](https://github.com/osnr/cruncher/blob/master/src/jison/parser.jison)
How would one have to change the grammar to allow for things like sin(30°) in
the equations?

------
leephillips
Victor has some interesting ideas about interfaces, but his campaign to
replace simple, powerful, and quick algebraic manipulation with slow,
laborious, trial-and-error pushing of numbers around with a mouse is, I think,
seriously misguided. Algebra, in addition to giving you an exact solution more
quickly, can help you discover general formulas for your problem, and reveal
relationships between things, that you can use again the next time the problem
comes up. The scrubbing calculator approach means you have to start over from
scratch each time. You're throwing away all the conceptual power of
mathematics and trying to replace it with arithmetic.

~~~
asolove
I don't think this is inherent in the idea. You can absolutely make an
interface somewhat like this that could arrive at general solutions. Indeed, I
think Bret would consider this most of the point. He covers this in "Up and
down the ladder of abstraction" [0]

If by algebra you mean "the transformation of one written notation to another
by rule," that is only one way of finding general solutions to mathematical
problems. There is a lot of writing about "how" people doing original math
think, and many of them work in ways far divorced from algebraic notation.
Some seem to develop graphical models they picture in their head, others
report using other senses like sound and smell.

Freeman Dyson on Feynman: "The reason Dick's physics was so hard for ordinary
people to grasp was that he did not use equations... Dick just wrote down the
solutions out of his head without ever writing down the equations. He had a
physical picture of the way things happen, and the pictures gave him the
solutions directly with a minimum of calculation."

Einstein on his thinking: "The words of language, as they are written or
spoken, do not seem to play any role in my mechanism of thought. The psychical
entities which seem to serve as elements of thought are certain signs (
symbols ) and more or less clear images which can be voluntarily reproduced
and combined... The above mentioned elements are, in my case, of visual and
some muscular type."

More interesting discussion here:
[http://www.sv.vt.edu/classes/ESM4714/methods/vizthink.html](http://www.sv.vt.edu/classes/ESM4714/methods/vizthink.html)

The idea that "real math is bare symbols" isn't true. Not only isn't it true
for doing groundbreaking math, it isn't true even for easy math. I would
challenge you to teach children mathematics as a purely symbolic game, never
showing them that numbers correspond to physical entities, or that derivatives
correspond to tangents on a curve. Those of us who are "good" at algebra are
good at it because we understand it in a way deeper than the symbols.

Yes, symbolic notation is a great form of communication and necessary for
proof, but it is usually not the way to create the initial intuitive spark
underlying a solution.

[0]
[http://worrydream.com/LadderOfAbstraction/](http://worrydream.com/LadderOfAbstraction/)

~~~
RogerL
I'm not trying to be waspish, but are you suggesting we just be like Feynman?
I will say I'm rather dubious we can achieve that with a simple interface
change.

There is certainly merit and utility to graphical representation; we all use
it via matlab, python+scientific packages, and so on. And, of course, the
faster we can change something and see the result the better. It is not always
an incremental change, but a pretty fundamental change, to see something
change in real time.

Yet, this only really works in tiny cases. I recall Victor demonstrating using
scrubbing variables to change how a game reacts. Okay, but the vastest amount
of the programming I do (and I do fairly numerical things in the computer
vision line) I either don't see the utility, or practicality. I can't variable
scrub my way to a better algorithm.

I've seen, for example, graphical demonstrations of things like binary tree
algorithms, sorting, and the like. It's momentarily interesting, but I can't
claim that it really made any difference in my understanding of the subject. I
think this is a case where people vary. I am not terribly visual, and most of
Victor's arguments go over like a lead balloon with me. Yet, I cannot deny the
excitement of others. I find it far more commodious to work with, for example,
linear algebra. Certainly there are times when I am drawing 3D arrows and the
like to work out a problem, but by-and-large the symbolic representation
serves far better.

There is a reason we use text for communication on HN, and not pictures. It is
not because we lack vision or foresight (no pun intended), but because it is
the most expressive and flexible way to communicate our ideas. And, of course,
sometimes we labor away, trying to communicate in words what would be so easy
to illustrate with a single image. Neither is 'best'; we just use the best
tool for the job.

None of that is to argue against one of your points - that math is more than
symbolic representation. Once you are reduced to applying symbolic rules to an
equation you are often quite lost, and that is often not taught in schools.
Yet so much of math really cannot be done graphically at all, yet we succeed.
A lot of people stall out in math (I think) at after the algebra/calc I,II,III
level because beyond that there is often no recourse to graphics and physical
representations; graphics can be as much a crutch as a help.

Anyway, visual thinking is certainly a form of thinking that should not be
downplayed, but it is not how some to many brains work, nor is it even
possible in many forms of important thought (I leave savants to one side, we
can not make decisions based on exceptional/unique people).

------
taeric
So... I have to confess I can't figure out how to get this to do anything. :(
I'm guessing I'm supposed to be able to "scroll" to change some values.
However, I can't even get it to calculate anything. Does this only work from
chrome?

~~~
arikrak
Same here, but then I saw the creator's link above, which works.

------
nullz
If you haven't seen it yet, checkout this value and time scrubber, a pretty
faithful recreation of Bret Victor's demo
[http://www.fullstack.io/choc/](http://www.fullstack.io/choc/)

------
cvalleskey
In Photoshop you can increase/decrease a value with more control by holding
Shift (+/\- 10) or Option (+/\- 0.1). Similar shortcuts might aid in finer
value control without adding anything to the UI.

