Live data from Hacker News

Notch trying jsFiddle

jsfiddle.net

131–140 of 143 posts

Re: Notch trying jsFiddle

#131

Earlier quoted context omitted.

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…

> 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. It doesn't just not scale well with canvas, it doesn't scale well with modern har…

I agree this is not taking advantage of the GPU, but it's not making a draw call for every pixel either.

It looks to me like it's probably making a single call for each frame. Perhaps it mostly depends on how well the pixels.data[] call is implemented.

Re: Notch trying jsFiddle

#132

Earlier quoted context omitted.

Thanks for the livecoding link. I assume there's some overhead in constantly checking for and applying code changes - that's probably the reason for the lower frame rate.

Good point, I hadn't thought about the fact they might be polling for changes. Might be better if livecoding used an event based model to check for updates...

How do you suppose event-based models are notified of changes? Ultimately you are still polling, you're just abstracting it out of your higher-level design.

Re: Notch trying jsFiddle

#133
post #94

Obligatory flash port: http://wonderfl.net/c/sqL5

That's faster than the JS demo (even the improved one) in any browser. It's sad that browsers still don't have at least the same performance as flash :(

It's faster because he made the Flash version use strongly-typed arrays.

Re: Notch trying jsFiddle

#134

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'…

Here is a version adapted for Tributary: http://tributary.io/inlet/4199801/

Press play in the bottom left to have it go, and scrub numbers/colors to your hearts content!

Part of the reason it slows down in livecoding is because of the way the original code uses setInterval, and every change reevaluates the code which polutes the scope and starts way too many threads going. I've added optional functionality to Tributary which gives you a run loop (using requestAnimationFrame) that doesn't polute anything.

Hope this helps!

Re: Notch trying jsFiddle

#135

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'…

Thanks for the livecoding link. I assume there's some overhead in constantly checking for and applying code changes - that's probably the reason for the lower frame rate.

it's not polling, its reevaluating code when codemirror triggers an event for text changing (which uses the dom underneath).

the problem is from calling setInterval every time the code is evaluated, leading to way too many function calls/second

Re: Notch trying jsFiddle

#136
post #101

Earlier quoted context omitted.

Side by side, this is amazingly smoother than the OP.

For me, the difference is only visible using Firefox. Chromium even renders the inefficient original version smoothly.

The magic of Just In Time compilation perhaps?

Re: Notch trying jsFiddle

#138

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'…

Here is a version adapted for Tributary: http://tributary.io/inlet/4199801/ Press play in the bottom left to have it go, and scrub numbers/colors to your hearts content! Part of the reason it slows down in livecoding is because of the way the original code uses setInterval, and every change reevaluates the code which polutes the scope and starts way too many threads going. I've added optional functionality to Tributa…

Very awesome:) It's _almost_ fast enough to feel like you're modifying it in realtime on my macbook air. This is a great demo of what might be possible with this responsive programming approach.

Re: Notch trying jsFiddle

#139
post #80

Earlier quoted context omitted.

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&...

Thanks so much for this! I watched this back when ludum dare was happening, but after he moved his streaming channel to twitch.tv this part of the stream was lost.
Post reply on HN