Try out https://nornagon.github.io/live, which also lets you edit constants without recompiling.
I've been working on something similar for teaching graphics programming to our undergrads. Uses esprima to parse the input JS and add some runtime error checking with line numbers, including unidentified variables and timeouts for loops:
Simpsons already did it. Well OK, @sanchothefat already did a similar thing using Processing.js over at http://hascanvas.com - bit old now but he had plenty of interesting user contributions over the years.
Can you elaborate on what is actually happening?
I like this. I have worked on a couple of things in a similar area.
This too suffers from the problem that has plagued me.
I tried to add this code to the program
Which is my usual check for what happens when you encounter an endless loop. Of course, I didn't get the entire thing typed in because the user interface froze when I typed the close bracket of (x>y).Javascript can't pre-empt. An endless loop is a killer. I'm going to write something long and detailed about this one day. It'll be a big rant.
I made a MediaWiki plugin for my approach. It uses a worker, which lets you do something about busy loops (you can kill it, not much else). The down side is that all of the drawing operations have to be passed through to the host as messages.
The other part of what I have been working on is a extremely simple API to use environments like this for novice programmers.
I made whio. https://github.com/Lerc/whio and I'm slowly building up a wiki as a intro to programming. http://fingswotidun.com/code/index.php/Main_Page
I teach some programming in a class of 10 year olds. I start off with http://jsbin.com/tinydraw/1/edit Which is a program they can focus on in one view and lets them draw pictures. Then I make suggestions and point them to the wiki. Where they go from there is amazing to see.
Just changing the number on the jsbin url shows where some of the kids have taken this. http://jsbin.com/tinydraw/45/edit http://jsbin.com/tinydraw/130/edit http://jsbin.com/tinydraw/148/edit
This one appears to be by a someone who copied an example from the wiki then modified it http://jsbin.com/tinydraw/48/edit
I like this one. Here a kid figured out from the wiki how to read the mouse. http://jsbin.com/tinydraw/50/edit Scattered through the versions are evolutions of this program until it ends up here, as a simple, but fairly complete game. http://jsbin.com/tinydraw/141/edit