Choc: Bret Victor's 'Learnable Programming' implemented in Javascript
fullstack.io
fullstack.io
It went into minus and I couldn't bring it back.
That said, you should be able to type in a value yourself. The code is completely editable.
http://research.microsoft.com/apps/pubs/default.aspx?id=2013...
However, when you change something inside the loop, its likely that everything will have to be re-executed. The only way around this is to break up the loop somehow. Or perhaps see Umut's work on self-adjusting computation:
http://www.umut-acar.org/self-adjusting-computation
Its an interesting research area.
Where he pretends to be in a late 70's conference, discussing how the current ideas about Smalltalk, GUI environments, parallel programming and so forth, can be used and how the computing world might look like in 30 years time (meaning nowadays).
Another project that this kinda reminds me of is LightTable. I haven't followed how it's shaping up, but the initial concept demo had some similar live editing stuff iirc.
There's no real-time execution, but it does show a (more or less) word-to-word relationship between Javascript and English, which is an alternative (and complementary) way to "explain" code to someone learning Javascript.
Note that my English "translation" is totally hand-crafted. From the description, Choc allows hand-crafted translations of individual library functions, but applying those translations to a program still gives you a mostly automatic translation which is not as easy to understand as a hand-crafted translation would be.
The idea being that you can step through the iteration (say an each, for, or any other iterator in Ruby) and see the state of all variables/objects at each step in the iteration - and then also allow it to handle nested loops, blocks, etc.
I was thinking a simple site like the Ruby Regex Tool[1] would work wonders.
I just haven't had the time to do something like that - I need to beef up my JS to execute that as elegantly as I would like. But I suspect that would be a very useful tool for Ruby devs.
#justsaying
[1] - http://rubular.com/
Pry is awesome though, it's just not really close to the things that Bret talks about. In fact, I think in one talk he specifically speaks against REPL's being interactive.
But....I may revisit it again.
One suggestion: please add some form of code intelligence, so that when I type "pad." a popup appears with all the public pad methods and their descriptors. That would encourage playing around even more imo.
However, I think that more visual debugging tools like this actually need to exist for professional developers as well. I think Bret would agree too.
I've been programming for over a decade and the first time I read the code for the bouncing ball example I had basically no idea what it meant. I could sort of tell that there was something drawing circles but that was about it.
By dragging the constants around and seeing every frame change (across time, not just a single frame) you're able to get an intuition about what each line of code is doing.
I'm not a child nor a beginning programmer and using this tool was super useful for me to gain insight on how it works.
I feel like the OP is missing the forest for the trees; the key takeaways from Bret Victor's lamenting seemed to indicate to me that we need Yet Another Programming Language, but one that non-programmers can actually use for "real programming" in conjunction with a "real IDE" (as opposed to one where you just "learn programming" but don't use for "real work").
I'm currently having my mind blown by Bret Victor's "Learnable Programming", but after that I'll send you guys the details of how my class has been working so far.
Also, I started learning Clojure and Clojurescript about a month ago, but I'd love to try my hand at building something nontrivial with them.
[1] http://en.wikipedia.org/wiki/Logo_%28programming_language%29
Would it be cool to have this "at large" for a full stack of software. Possibly, but I'm not completely convinced yet.
Edit: Seeing how you can "slide" numbers is also kind of neat, but again, I'm not sure it really helps understanding. If anything, I would think this is somewhat confusing, as I have to grasp changing the numbers treats is as if that number was changed on previous iterations.
I'm working on similar things for Go in my spare time, but I'm not yet that close to having cool results.