News for hackers. Stuff that matters.
Re:Tangle: a JavaScript library for reactive documents by memset on Monday July 08, 2013 @11:57AM (#6007400)
I remember seeing this several years ago, and was thoroughly impressed. The gentleman who wrote this library used it in an interactive essay called "Ladder of Abstraction." [1]

Here is its previous HN discussion: [2]

[1] http://worrydream.com/LadderOfAbstraction/ [2] https://news.ycombinator.com/item?id=3099595

Re:Tangle: a JavaScript library for reactive documents by DavidChouinard on Monday July 08, 2013 @01:22PM (#6007889)
The gentleman who wrote it is Bret Victor. I highly recommend this talk [1] by him (500k views), he's a true visionary.

[1] https://vimeo.com/36579366

Re:Tangle: a JavaScript library for reactive documents by mtrimpe on Monday July 08, 2013 @01:53PM (#6008061)
Also consider reading his seminal essay called "Magic Ink" [1] and afterwards take a look at the publication date and try to remember where the web was back then.

[1] http://worrydream.com/MagicInk/

Re:Tangle: a JavaScript library for reactive documents by kolodny on Monday July 08, 2013 @03:26PM (#6008670)
Just watched that talk... amazing. Do any of the tools that he uses in that talk exist?
Re:Tangle: a JavaScript library for reactive documents by doorhammer on Monday July 08, 2013 @10:02PM (#6010647)
I believe LightTable [0] ran with some of the concepts in the video, and I remember one of Chris Granger's videos having an almost identical bit about mapping time over space in a ball/block jumping game and very similar themes. Either way, it's definitely worth checking out. Sorry if I get any of the details wrong, I'm a bit out of step with Clojure.

[0] An IDE that supports Clojure and Javascript right now, maybe Python soon? Bit behind on the news: http://www.lighttable.com/

Re:Tangle: a JavaScript library for reactive documents by joshdance on Monday July 08, 2013 @01:54PM (#6008065)
I have watched this video a few times and periodically revisit it. Sometimes we get to far into the woods and need to be reminded where we can go writing software.
Re:Tangle: a JavaScript library for reactive documents by MWil on Monday July 08, 2013 @12:02PM (#6007425)
I thought this was a few years old as well but I'm happy to be reminded of it.

I really enjoyed this http://worrydream.com/#!/ExplorableExplanations

Re:Tangle: a JavaScript library for reactive documents by lightcatcher on Monday July 08, 2013 @02:15PM (#6008185)
Although Bret Victor's ideas behind reactive documents are interesting, I think the first example on this page (regarding the state parks) is particularly unfriendly and difficult to gain any understanding from. My views very closely aligns with (and was influenced by) Evan Miller's blog post [1] on the top that I highly recommend you read. The overall gist is that equations are actually the friendliest way to spread information about the relationships between several (ie more than 3 or 4) variables.

The final paragraphs of Evan Miller's essay address this particular webpage (the Tangle demo) in particular.

[1] http://www.evanmiller.org/dont-kill-math.html

Re:Tangle: a JavaScript library for reactive documents by glurgh on Monday July 08, 2013 @05:59PM (#6009633)
Dijkstra wrote something (in the same vein, if not an exact topic-match) similar but a bit more strident in '85

http://www.cs.utexas.edu/users/EWD/transcriptions/EWD09xx/EW...

Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @03:52PM (#6008853)
Have yet to go through Evan's post, but as you point out, the equations might be the most accessible way to truly comprehend relationships between 4 or more variables.

However, libraries like Tangle are powerful tools to visualize and understand relationships between 2-3 variables.

Re:Tangle: a JavaScript library for reactive documents by dvt on Monday July 08, 2013 @06:46PM (#6009866)
Maybe visualize, but understand? Doubtful. I don't think the computational overhead justifies a complex subsystem instead of just something like "x = cos(theta)" without some fancy rotating control.
Re:Tangle: a JavaScript library for reactive documents by davorak on Monday July 08, 2013 @09:06PM (#6010477)
My take on the best way to write/use such a document would be first present the math, then a reactive example. The user should read the math formulate a hypothesis/visualization/understanding of the system then use the reactive document to verify or falsify the concept.

This does not remove mathematical understanding from the document, but adds an opportunity for quick verification of an understanding. And according to my vague understanding of learning and neural connection getting quick feedback is key to forming strong connections.

Re:Tangle: a JavaScript library for reactive documents by aroberge on Monday July 08, 2013 @01:05PM (#6007783)
After a previous discussion on HN, I used it as an experiment to visualize the convergence of Fourier and Taylor series http://personnel.usainteanne.ca/aroberge/

I think it would be really neat to have an entire mathematical textbook interactive in this fashion.

Re:Tangle: a JavaScript library for reactive documents by reeses on Monday July 08, 2013 @03:43PM (#6008793)
There's at least one textbook based on Wolfram's proprietary CDF format.

http://www.wolfram.com/mathematica/customer-stories/developi...

(I like your visualization page – a nice way to explain that part of wavelet compression.)

Re:Tangle: a JavaScript library for reactive documents by gavinpc on Monday July 08, 2013 @04:13PM (#6008977)
Wow, you taught me something. I've heard of the "Fourier transform" many times and it never clicked what it was for.

Thanks!

Re:Tangle: a JavaScript library for reactive documents by davewasmer on Monday July 08, 2013 @09:35PM (#6010562)
Just an FYI, but your choice of series colors for your graph are very difficult to differentiate as a colorblind person. Might consider changing one of the colors.
Re:Tangle: a JavaScript library for reactive documents by aroberge on Tuesday July 09, 2013 @05:58AM (#6011873)
Could you possibly check now? Also, there are two more interactive pages that are "hidden": http://personnel.usainteanne.ca/aroberge/mirror.html and http://personnel.usainteanne.ca/aroberge/single_lens.html
Re:Tangle: a JavaScript library for reactive documents by WickyNilliams on Monday July 08, 2013 @12:10PM (#6007481)
I saw this a few years back and was seriously impressed with the idea, not just as a JS library but the concept of interactive (or reactive as Brett calls them) documents. This is where HTML should be going as a form of media, armed with the question, "what can HTML do that other forms of media cannot?"

But a lot has changed since then - has this been superseded by client-side libraries with two-way data binding? e.g. angular or knockout. It would probably be quite trivial to duplicate the functionality in either of those libraries.

Re:Tangle: a JavaScript library for reactive documents by RussianCow on Monday July 08, 2013 @12:58PM (#6007747)
If what you're looking for is exactly what the example on the website shows (say, an interactive textbook), then I would just use Tangle because it's ready to go without much effort on your part. But if you wanted more flexibility, then of course you should use a move advanced library like Angular.
Re:Tangle: a JavaScript library for reactive documents by jjsz on Monday July 08, 2013 @01:09PM (#6007805)
How long would you say it'll take for it to be implemented in AngularJS?
Re:Tangle: a JavaScript library for reactive documents by WickyNilliams on Monday July 08, 2013 @01:41PM (#6007982)
I don't think it would be a big ask. Dependency tracking/resolution and two-way data binding is baked in, so you'd only have to create some ui components (e.g. a slider) to allow for altering of the values and everything else would just work. Though if you wanted to do it properly you'd probably encapsulate the functionality in a directive of some sort.
Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @12:04PM (#6007438)
We are wholly inspired by Bret's work, and are currently playing around with the tangle library to help students visualize the concept of area, perimeter, and volume. Here is a preview: http://tuvalabs.com/resources/area/

We also plan to open source this code in due time. Ignore the mess please.

Re:Tangle: a JavaScript library for reactive documents by bajsejohannes on Monday July 08, 2013 @01:38PM (#6007971)
A suggestion for the visual area widget: Count the boxes for the user. So in the first box you'd write 1, the second 2, etc. Then it's easy to verify that the numbers are indeed a counting (they increase by 1) and that the calculated are indeed checks out.

I'd write the numbers in gray so they don't dominate the image.

Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @01:49PM (#6008026)
Thanks for the feedback. There is a lot of work that still needs to be done to improve the UI for these tools, but our goal is to build a library of such visual tools for tens of relevant topics.
Re:Tangle: a JavaScript library for reactive documents by cwlb on Monday July 08, 2013 @09:18PM (#6010512)
I share your passion for revolutionizing math education, but I don't quite understand the attachment to "Common Core." Federal prescriptive nonsense is a huge obstacle for real innovation in education and outside of the need to make a sale I don't see why you'd limit yourselves.
Re:Tangle: a JavaScript library for reactive documents by dxbydt on Monday July 08, 2013 @03:39PM (#6008755)
personally, I feel uncomfortable reading stuff like "If the width is 2 units and the height is 2 units, the area is 4 square units since 2 times 2 is 4". 2 plus 2 is 4 as well, yeah ? As also, 2 ^ 2 = 4 The area is 4 regardless of what 2 times 2 is, or 2 plus 2 is, or 2 raised to 2. I get your intent, but the phrasing is questionable pedagogy at best.
Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @03:47PM (#6008824)
Definitely agree with you, and the phrasing will change as we improve the design of these pages. Thanks for the feedback!
Re:Tangle: a JavaScript library for reactive documents by tonylemesmer on Monday July 08, 2013 @03:13PM (#6008580)
Does it work with touch? (I do not have a touch device)
Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @03:48PM (#6008835)
The numbers should be draggable via touch.
Re:Tangle: a JavaScript library for reactive documents by mcintyre1994 on Monday July 08, 2013 @04:57PM (#6009230)
They'd be quite small touch targets assuming you wanted to view the shape and calculation as you change them. Have you considered making the shapes resizable by dragging?
Re:Tangle: a JavaScript library for reactive documents by hcarvalhoalves on Monday July 08, 2013 @04:15PM (#6008983)
Stuff like this, that explores the document nature of HTML, should be standard on the web, instead of the current crazy trend of reinventing desktop applications in the browser.
Re:Tangle: a JavaScript library for reactive documents by pmtarantino on Monday July 08, 2013 @11:50AM (#6007362)
I can imagine this in the science books of the future. I usually check with a few cases to see if I understand the subject correctly, but sometimes I have enough samples to test.

This would be great: the student can see the default example, learn the subject and then try to check if he understood it correctly seeing how it behaves changing the parameters!

Re:Tangle: a JavaScript library for reactive documents by _delirium on Monday July 08, 2013 @12:09PM (#6007473)
In a physics course I took some years ago, we used Mathematica notebooks for that. The professor had written out explanations of a few subjects we were studying in the style of tutorial notes or a paper handout, but within Mathematica so you could change the parameters and see updates in real time.
Re:Tangle: a JavaScript library for reactive documents by jjsz on Monday July 08, 2013 @01:11PM (#6007816)
So which one do you recommend for a first year CS student Mathematica or Tangle?
Re:Tangle: a JavaScript library for reactive documents by count on Monday July 08, 2013 @01:15PM (#6007843)
Pedagogy aside, Mathematica will serve them better from a 'other people use this' perspective over the years.
Re:Tangle: a JavaScript library for reactive documents by thauck on Monday July 08, 2013 @04:00PM (#6008904)
At this point, I might argue for IPython Notebook.
Re:Tangle: a JavaScript library for reactive documents by jjsz on Wednesday July 10, 2013 @09:37PM (#6023998)
The question I was going to make has been asked here: http://stackoverflow.com/questions/17483271/is-there-a-way-t...
Re:Tangle: a JavaScript library for reactive documents by nileshtrivedi on Monday July 08, 2013 @01:18PM (#6007863)
I am currently working on interactive 2-d physics simulation in the browser with much the same ideas. On the desktop we have apps like KDE Step but I haven't found anything similar for the web.

Currently I have particles,disks and boxes working with gravitation, coulomb and custom-defined forces. I also implemented Runge-Kutta method of integration instead of horribly inaccurate Euler's method. You can manipulate the objects, their parameters and laws even while the simulation is running.

I need to add basic collision detection and things like springs, links, and linear/angular motors and embedding the simulation as a widget before polishing it up and releasing.

Email me in case this sounds interesting and you would like to stay updated.

Re:Tangle: a JavaScript library for reactive documents by hsparikh on Monday July 08, 2013 @12:16PM (#6007514)
Precisely. In physics, testing extreme cases and boundary conditions is one of the first ways to get a better understanding of a system. Tangle can be a great tool to empower learners to do this visually.
Re:Tangle: a JavaScript library for reactive documents by kozhevnikov on Monday July 08, 2013 @12:09PM (#6007467)
Bar the obvious use in scientific texts I can imagine this being useful in client facing data-driven BDD tests, i.e. tools like Concordion [1], FitNesse [2], etc.

[1] http://www.concordion.org/ [2] http://fitnesse.org/

Re:Tangle: a JavaScript library for reactive documents by nilkn on Monday July 08, 2013 @06:42PM (#6009847)
This is a cool implementation, but the idea is not new. In fact, the majority of front-end JavaScript libraries right now are more or less aiming to do the same thing in their own way: AngularJS, Meteor, Ember, KnockoutJS, Bacon ... even d3js. The list goes on. These are all attempts at implementing reactive programming in the web, but they have different data and data binding models, and they may have different front-end goals (e.g., Ember tries to keep a 1-1 correspondence between document state and URLs).

There's also Elm, which implements a variant of reactive programming known as FRP.

Re:Tangle: a JavaScript library for reactive documents by hcarvalhoalves on Monday July 08, 2013 @07:35PM (#6010119)
I don't think AngularJS, Meteor or Ember are close to this though. The result might be the same, depending on the use case, but the philosophy isn't.

AngularJS for instance looks like more about components and data-binding (makes me remember the old Delphi days) in an attempt to use the browser as an application framework than "interactive documents".

Re:Tangle: a JavaScript library for reactive documents by nilkn on Monday July 08, 2013 @09:18PM (#6010508)
Those libraries are ultimately just more sophisticated versions of this on a bigger scale. Meteor in particular takes reactivity to a whole new level: changes are propagated immediately not only to you but to other users as well (if appropriate to the application, e.g., a chat room). The philosophy is more or less the same in all cases: make the page react immediately to what the user is doing without a full refresh. Some of those libraries take it further and tie the page directly to the application back-end or database if desired.

I think the main appeal of something like Tangle is to get the benefits of reactive programming while using only a very lightweight and simple library. It provides a very clean interface to a subset of the functionality.

Re:Tangle: a JavaScript library for reactive documents by dylanhassinger on Monday July 08, 2013 @12:14PM (#6007499)
Neat but Knockout.js does this really well, seems to be getting more traction these days.

http://knockoutjs.com

Re:Tangle: a JavaScript library for reactive documents by bpierre on Monday July 08, 2013 @12:09PM (#6007466)
Re:Tangle: a JavaScript library for reactive documents by nkuttler on Monday July 08, 2013 @11:53AM (#6007375)
This looks very interesting even if I can't think of a use case yet. It would be nice to see a license file though.
Re:Tangle: a JavaScript library for reactive documents by lccarrasco on Monday July 08, 2013 @12:00PM (#6007412)
Yes, a quick check through the source files indicates a MIT License, though it'd be better if it was made clear in a LICENSE file.

This project looks great, I hope it takes off.

Re:Tangle: a JavaScript library for reactive documents by iso8859-1 on Monday July 08, 2013 @07:51PM (#6010198)
It's a couple of years old... But at least Angular is taking off, which has the same declarative principle...
Re:Tangle: a JavaScript library for reactive documents by emehrkay on Monday July 08, 2013 @12:18PM (#6007523)
This is very interesting. As an aside: MooTools doesn't get enough love in the JS community. His Live Coding stuff was done with it (http://www.youtube.com/watch?v=-QJytzcd7Wo)

*it being MooTools and this library

Re:Tangle: a JavaScript library for reactive documents by fiatjaf on Monday July 08, 2013 @05:53PM (#6009589)
When I read this a year ago I was very impressed, but now I think (1) this was superseeded by Angular and stuff alike and (2) this is not good user experience, this is experience to experimenters, a restrict kind of user, very restrict. For the common user maybe a simple chart is better.
Re:Tangle: a JavaScript library for reactive documents by emhart on Monday July 08, 2013 @12:08PM (#6007463)
I'm in the process of writing my first serious academic paper, and while I'll still put the traditional document together, I think I'll try to make a second version using tangle where appropriate. Very cool, thanks for pointing this out.
Re:Tangle: a JavaScript library for reactive documents by angersock on Monday July 08, 2013 @03:19PM (#6008620)
Man, I would've loved something like this going through school--the final example of the performance of an analog filter and watching the root-locus plot change was really really cool.
Re:Tangle: a JavaScript library for reactive documents by Dirlewanger on Monday July 08, 2013 @05:09PM (#6009308)
Something like this is perfect update the horde of egregiously out-of-date STEM examples littered across academics' websites that all look just like this sans fancy JS.
Re:Tangle: a JavaScript library for reactive documents by arikrak on Tuesday July 09, 2013 @09:33AM (#6012540)
He has some great stuff on the site, and I'm thinking of using Tangle to help teach math, but I'm wondering if letting people drag numbers is really so helpful?
Re:Tangle: a JavaScript library for reactive documents by hrktb on Tuesday July 09, 2013 @09:56AM (#6012652)
For a mortgage simulation, or any kind of matrix type calculation, dragging the numbers might be simpler and easier to understand than having a standard form (even with seamless inline text input)
Re:Tangle: a JavaScript library for reactive documents by arms on Monday July 08, 2013 @07:22PM (#6010069)
Very cool. This is one of those things that makes me wonder "where can I use this next?" Even more impressive is that this is apparently a few years old.
Re:Tangle: a JavaScript library for reactive documents by pallandt on Monday July 08, 2013 @12:51PM (#6007696)
Very neat, reminds me of Mathematica Notebooks.
Re:Tangle: a JavaScript library for reactive documents by pjmlp on Monday July 08, 2013 @01:39PM (#6007973)
Really nice.

Rediscovering Lisp and Smalltalk interactive environments.

Re:Tangle: a JavaScript library for reactive documents by iso8859-1 on Monday July 08, 2013 @07:48PM (#6010186)
According to Bret in his "Inventing on Principle", a REPL is not enough interactivity :P
Re:Tangle: a JavaScript library for reactive documents by pjmlp on Tuesday July 09, 2013 @02:29AM (#6011394)
Except the original Lisp and Smalltalk environments are much more than a simple REPL.

Sometimes I wish people would learn about computing history.

Presentation from Kalman Reti about Lisp Machines, check the interactivity starting at 00:44:00 and how to introduce mouse sensitive images at 01:00:00

http://www.loper-os.org/?p=932

Xerox presentations about Smalltalk-80

http://www.youtube.com/watch?v=JLPiMl8XUKU

http://www.youtube.com/watch?v=Cn4vC80Pv6Q

http://www.youtube.com/watch?v=ODZBL80JPqw

Re:Tangle: a JavaScript library for reactive documents by est on Tuesday July 09, 2013 @04:09AM (#6011623)
For me "more-than-REPL" just looks like a code visualization tool where you can jump between symbolics. Mouse sensitive images looks just like a prototype of AutoCAD

screenshot if anyone is interested.

http://i.imgur.com/FjaDFgi.png

http://i.imgur.com/sGNN3la.png

Bret Victor's work is much, much more impressive, you can change variable values and see results in realtime. In that Mario game example, you can see Mario's trajectory and adjust values to see how physical parameters affect the height and distance Mario can jump, and modify gravity ticking equation to see Mario jump & walking up-side-down.

Re:Tangle: a JavaScript library for reactive documents by pjmlp on Tuesday July 09, 2013 @04:24AM (#6011657)
I am not saying his work is not great, far from it.

What I mean is that these ideas were already present in such environments.

The "more-than-REPL" stated by me, means that these environments allowed for an interactive type of work that went further than a simple textual REPL.

Many young HN readers tend to associate REPL to the pure REPL textual version they have access to, while using vi and emacs on their UNIX boxes.

Re:Tangle: a JavaScript library for reactive documents by lispm on Thursday July 11, 2013 @11:48AM (#6026789)
You could do that on a Lisp Machine, too. Symbolics sold a complete interactive animation and game development system. Nintendo used it in the early years. The software later got ported.
Re:Tangle: a JavaScript library for reactive documents by seanmcdirmid on Tuesday July 09, 2013 @01:44AM (#6011289)
Ya, parent is just living in the past.
Re:Tangle: a JavaScript library for reactive documents by pjmlp on Tuesday July 09, 2013 @02:30AM (#6011400)
Parent is an old dog that gets amazed how little HN young kids know about computer history.
Re:Tangle: a JavaScript library for reactive documents by seanmcdirmid on Tuesday July 09, 2013 @03:42AM (#6011574)
Parent really thinks Smalltalk had the capabilities, realized or not, to do the demos that Bret did in Inventing on Principle. Smalltalk and Lisp have never shown the capability, and in fact just can't do it. Time travel was just never a big thing there.

The Smalltalkers do this all the time; I had even Ralph Johnson poo hoo my 2007 live programming talk. But you get the feeling that these people really think nothing new can be invented after the 80s. They say "Smalltalk" already does this! And you say "show me" and then they just shut up.

Re:Tangle: a JavaScript library for reactive documents by pjmlp on Tuesday July 09, 2013 @04:00AM (#6011604)
Well for starts it is a bit hard to get a Xerox system at the shop around the corner.

Second, I mentioned it was a good idea to follow these ideas.

My only point is that they aren't new and many live programming advocates sell them as if they were new.

Re:Tangle: a JavaScript library for reactive documents by seanmcdirmid on Tuesday July 09, 2013 @04:29AM (#6011668)
All the ideas presented in Christopher Hancock's 2003 dissertation on live programming are compared adequately against previous work. There are plenty of advocates out there for anything that don't do their homework and don't bother with related/previous work sections...only academics like us concern ourselves with that.
Re:Tangle: a JavaScript library for reactive documents by likeclockwork on Tuesday July 09, 2013 @02:04AM (#6011341)
It seems like it'd be easy to rig this kind of thing up with Angular.
Re:Tangle: a JavaScript library for reactive documents by ppradhan on Monday July 08, 2013 @12:22PM (#6007546)
this is inspired! I like it.