5 ms·
I started on BASIC, too, when I was 9. I think the sandbox of today would need to run inside the browser to achieve the instant gratification of BASIC back in
by pmjordan 16y ago
I started on BASIC, too, when I was 9.
I think the sandbox of today would need to run inside the browser to achieve the instant gratification of BASIC back in the day. I wonder if JavaScript could be the new BASIC - I find it hard to judge how hard it would have been to learn for my 9-year-old self. The barrier to entry for JS programming is probably a little too high (you need to know HTML, need to host your code, etc.) but a simple web based JavaScript environment with a REPL and some wrapper functions for a Canvas element and keyboard & mouse input might just do the trick.
A technical problem I can see with that is the event-based model of the browser, which is probably harder to understand than the explicit event loop. You'd need a blocking waitForNextFrame() of some kind. I guess you'd have to precompile and transform the code into continuation-style closures. Or just call their code periodically with setInterval(). Either way, the framework could gather up relevant events between frames to make them available more easily.
Damn, I really want to make this now.
- arethuza 16y agoChrome and Safari have a REPL console - you can type JavaScript and get immediate feedback. Great idea for a library that builds on what modern browsers can do to provide an environment that is similar to the old micros (I started programming on a Apple II).
- pmjordan 16y agoChrome and Safari have a REPL console - you can type JavaScript and get immediate feedback. As do Firefox (with Firebug) and Opera (Dragonfly). The mental model of raw client side JS, along with actually saving your code isn't exactly "instant gratification" though. This should be a web service that lets you easily save your code, and gets rid of most of the accidental browser complexity. And while we're at it, you should be able to embed the stuff you made elsewhere, hosted or not. (though IE throws a spanner in the works if you're using Canvas and want to embed it to show others) This is sounding better and better the more I think about it.
- arethuza 16y agoYou could use the client side database support in Chrome/Safari to save local copies of code and allow stuff to be loaded back into the environment of the current page.
- steveklabnik 16y agoYou should check out http://tryruby.org http://tryruby.org, http://tryhaskell.org http://tryhaskell.org, and http://tryerlang.org http://tryerlang.org. If you'd like to see the source, http://github.com/Sophrinix/TryRuby http://github.com/Sophrinix/TryRuby
- pmjordan 16y agoThose run server side though, right? And I don't see any obvious way of displaying graphics, which is probably the closest you'll get to "tactile" feedback when programming.
- steveklabnik 16y agoIt's true, it's all server side. TryRuby's history (if I remember right) is that it comes straight from Hackety, so I don't think graphics displaying was really a consideration...