Tangle is a JavaScript library for creating reactive documents.
worrydream.com
worrydream.com
As a numbers geek one of my pet peeves is that people all too rarely play out different scenarios to help the reader gain an understanding of the underlying model/data/relationships/etc.
Now some sites do this well (e.g. OKCupid's blog), but there is still a disconnect between text and data display. The reader has to play with the graph itself and that does create a bit of a cognitive fracture that I think subtly inhibits a better understanding.
For more information on functional reactive programming, I'd recommend looking at FlapJax and FatherTime
CDF documents can only be written using Mathematica, are only playable using a special CDF Player (or Mathematica), and you have to license CDF for commercial use. Tangle is free and open source (under an MIT License), JS is "playable" in most web browsers, and JS can be written using any text editor.
http://reference.wolfram.com/mathematica/guide/Mathematica.h...
Wolfram|Alpha has an API that can be called using JavaScript (for a fee), so some mixed solution is also worth considering.
Besides the ideas I listed, I see it being used in scenarios where you have formulas based on a few inputs, and want to see what the output looks like when you mess with stuff, like physical dimensions in a design or financial stuff.
It's nice to have a real term for this sort of thing in "reactive document" or "reactive programming" or what have you. Not so nice to realize my idea isn't unique and brilliant. :)
You can see most of the logic in fern.ast.node.Node. self.refresh_impl is supposed to set self.value in a way appropriate to the subclass, and the Node functions handle the rest.
This is actually a pain to debug, especially with lots of nested scopes, but it seems to me like the evaluation should be lazy, rather than changing one object potentially re-computing the entire tree when you only cared about one part. You can call .refresh() on it manually if you need to get the computation out of the way.
It's not clear on the webpage but this was released under a MIT license
I think Flapjax didn't gain much traction largely because the website is ugly. Of course the the other reason is that regular event binding tends to be a good enough solution.
Some of the new client-side javascript solutions like knockout.js also offer reactive capabilities.
If you are into games, a solution to interactive picture generation by artists would be akin to a particle editor. You let them define a few parameters and valid ranges, then the artist supplies graphics in the right places: voila. A good looking animation. Now restrict the end user to a few well defined ranges of these parameters as well and you have an interactive picture.
Of course, if you can't slap your own UI (or there aren't better UI's), then that's problematic. Given the author's other work, though, I don't think that is a problem.
I keep meaning to put it on the back of a better library so that it doesn't hang up the page if you type a too-long string.
http://channel9.msdn.com/Events/MIX/MIX11/HTM07
It's available for the CLR as well:
EDIT: So now I see markbao's comment[1] referencing a page[2] with a guitar on it. His comment was not in the top of my window when I was perusing earlier. In this thread of comments, there is no reference directly to the Explorable Explanations page, thus I was wondering when my sanity plummeted (since there's no guitar icon on the Tangle page).
While the Explorable Explanations page is darn nifty, in my original comment I did not clearly communicate my actual intent. To clarify: If Dr. Prof. will be incorporating such things into his lectures and course media, I suggest that he also provide the reactive aural experience to reinforce the material.
[1] http://news.ycombinator.com/item?id=3140241 [2] http://worrydream.com/ExplorableExplanations/
http://mediawiki.org/wiki/October_2011_Coding_Challenge/Real...
edit: typo