Live data from Hacker News

Notch trying jsFiddle

jsfiddle.net

71–80 of 143 posts

Re: Notch trying jsFiddle

#71

This shows how far the browser has to go....was it just me, or did your browser start to choke while rendering this? It rendered it fine, but I could tell that the DOM was being abused heavily. I don't mean that in a bad way, but it just felt very 'heavy'. On the flip side, this is awesome that the browser can do this - and it's awesome that browsers can do this.

The DOM is not being heavily abused; it's just a canvas element and nothing else. The demo is so CPU intensive because the code is drawing the rasterized image pixel by pixel on the canvas, instead of relying on the GPU and using WebGL which would, AFAIK, result in much better performance.

One positive effect of doing this is that the code is _very_ portable and doesn't require any crazy feature in the browser or the PC (for example, i'm able to see the demo on my work computer even though WebGL doesn't work on it because of lack of drivers).

Re: Notch trying jsFiddle

#72

"Notch coding in JS" is a bit more descriptive than "trying jsfiddle", specially since it looks like code posted after the fact. A minecraft-like env rendered on canvas with it's own mini-3d-engine is amazing nonetheless :D

To be fair, that's the description notch used in his tweet: https://twitter.com/notch/status/275331530040160256 :)

"Trying jsfiddle.net" was in reference to his previous tweet, the previous host he used crashed under the load from his twitter link. He wasn't "trying jsfiddle.net", he was "trying jsfiddle [as an alternative to the previous host that crashed]"

Re: Notch trying jsFiddle

#73

This would be a great demo to see running in a responsive programming environment, ala Bret Victor's amazing Inventing on Principle talk ( http://vimeo.com/36579366 ). I want to be able to click on hex values and get a color picker that updates the demo in realtime, and be able to click on various magic numbers and drag a slider to change them. Incidentally, Bret Victor's talk was the starting point for Khan Academy'…

This "responsive programming environment" you speak of has been around for a really long time. Don't expect sliders and colorpickers to do cool stuff, but this should be a good jumping off point for you to start learning from: http://stackoverflow.com/questions/3305164/how-to-modify-mem...

Re: Notch trying jsFiddle

#74
post #73

This would be a great demo to see running in a responsive programming environment, ala Bret Victor's amazing Inventing on Principle talk ( http://vimeo.com/36579366 ). I want to be able to click on hex values and get a color picker that updates the demo in realtime, and be able to click on various magic numbers and drag a slider to change them. Incidentally, Bret Victor's talk was the starting point for Khan Academy'…

This "responsive programming environment" you speak of has been around for a really long time. Don't expect sliders and colorpickers to do cool stuff, but this should be a good jumping off point for you to start learning from: http://stackoverflow.com/questions/3305164/how-to-modify-mem...

Thanks, I'm plenty aware of gdb and debuggers:) (ex-google software engineer, etc etc) Go watch the video. Bret presents a very cogent vision for a dramatic improvement on most of today's standard engineering/design tools.

Re: Notch trying jsFiddle

#80
post #23

Earlier quoted context omitted.

This code uses zero canvas / javascript specific functions. It is using basic trigonometric functions and is using canvas only to write RGB pixels. Canvas are much more powerful and high level than that, but this is not a good example as Notch just needed to set pixels.

Having watched Notch write Prelude of the Chambered (which I then ported to JRuby) it seems he really loves this direct pixel manipulation style - as do I! The sad part, though, is it doesn't particularly scale well with canvas (yet) and using sprites, shape primitives, or even WebGL is way to get full speed at a regular resolution. (Imagine a 640x480 pixel field of randomized colors, you can get hundreds of FPS for…

For those interested, here are the first three hours of the "Prelude of the Chambered" stream.

http://www.youtube.com/watch?v=rhN35bGvM8c&t=10m05s&...

Post reply on HN