Live data from Hacker News

Notch trying jsFiddle

jsfiddle.net

91–100 of 143 posts

Re: Notch trying jsFiddle

#91
post #16

Earlier quoted context omitted.

No I really mean low level :-) Javascript is high level, but here notch is using it as a low level framebuffer.

I respectfully disagree with your use of low level, though I do understand your analogy about the pixelbuffer being like a frame buffer. But he's actually using Javascript arrays which can get passed around inside a javascript VM, and do not have a set size. Not very "low level". I spent a moment and changed the arrays to Float32Arrays which have set sizes and sit in memory without being fucked with by the VM and spe…

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

Re: Notch trying jsFiddle

#93
post #23

Such a great example of what can be done in javascript/canvas. As it is, I was completely blown away by how little code it actually took to do that. My only gripe would be, why couldn't he have used descriptive variable names, so I can better go through and understand it? :-)

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.

I would never have thought canvas performance would be good enough for this.

Re: Notch trying jsFiddle

#95
post #23

Such a great example of what can be done in javascript/canvas. As it is, I was completely blown away by how little code it actually took to do that. My only gripe would be, why couldn't he have used descriptive variable names, so I can better go through and understand it? :-)

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.

Reminds me of when I wrote a Game of Life implementation in JavaScript in college using a bunch of tiny absolutely positioned .

Re: Notch trying jsFiddle

#96

Earlier quoted context omitted.

Nice :) Shows you how fast ARM is progressing...

But only 4-5 fps on my iPad 3. Hmmmph, thought that'd be faster.

My iPhone 5 is considerably smoother and faster than my iPad 3. That's surely also related to the iPad's insane pixel count, but the iPhone also loads and switches apps faster, before CPU-based rendering is a factor.

Re: Notch trying jsFiddle

#97
Interesting for an untrained programmer to tweak and see what happens each time - changing colours, speeds, sizes, reversing the flow, changing textures, etc. Accomplishes so much with such concise code.

Re: Notch trying jsFiddle

#98
post #16

Earlier quoted context omitted.

No I really mean low level :-) Javascript is high level, but here notch is using it as a low level framebuffer.

I respectfully disagree with your use of low level, though I do understand your analogy about the pixelbuffer being like a frame buffer. But he's actually using Javascript arrays which can get passed around inside a javascript VM, and do not have a set size. Not very "low level". I spent a moment and changed the arrays to Float32Arrays which have set sizes and sit in memory without being fucked with by the VM and spe…

If possible the map array should be uint8_t, while texmap uint32_t

Re: Notch trying jsFiddle

#99

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

Or if it works at all like Scrubby (http://nornagon.github.com/scrubby/) which was on HN a couple days ago, it might rewrite all constants into global lookup table indexes, which surely wreaks havoc on performance.
Post reply on HN