Re:FOAM: New JavaScript Framework by Google Engineers
by peterhunt on Monday April 27, 2015 @05:38AM
(#9445195)
React is pretty revolutionary. It turns rendering code into a simple pure function, which is a necessary step for where you want to end up.
[ Parent
| on HN ]
Re:FOAM: New JavaScript Framework by Google Engineers
by seanmcdirmid on Monday April 27, 2015 @06:30AM
(#9445349)
Rendering code is easy to express as pure functions...that is mostly how OpenGL and DirectX work, after all. React doesn't help very much with the state of your application (nor is it meant to). That being said, being able to treat the DOM as something to be rendered efficiently in immediate mode is quite useful.
Re:FOAM: New JavaScript Framework by Google Engineers
by eropple on Monday April 27, 2015 @10:05AM
(#9446336)
OpenGL is a big ol' box of state in almost everything it does. I'm not sure how you get pure functions out of that.
Re:FOAM: New JavaScript Framework by Google Engineers
by seanmcdirmid on Monday April 27, 2015 @10:29AM
(#9446502)
Immediate shader mode is fairly stateless, pixel and vertex shaders are as functional as one can get. Let's not talk about the fixed function APIs that no one uses anymore.
Re:FOAM: New JavaScript Framework by Google Engineers
by eropple on Monday April 27, 2015 @10:47AM
(#9446617)
I'm not sure what you mean by "immediate shader mode". Even direct state access mode is tweaking knobs in a state machine that can have very strange side effects if you don't re-set the state every time (and that's antithetical to pure functional programming). When not using DSA--I mean, just grep for "bind" in any OpenGL codebase...
Re:FOAM: New JavaScript Framework by Google Engineers
by seanmcdirmid on Monday April 27, 2015 @11:07AM
(#9446748)
The hardware has state that is exposed more or less directly, but texture management is all just plumbing and easily wrapped. Most of my experience is with directX though, which seems to have a much cleaner API.
Anyways, immediate mode UIs abound for game stacks given the ease at which they can be mapped to the GPU directly.
Re:FOAM: New JavaScript Framework by Google Engineers
by eropple on Monday April 27, 2015 @11:11AM
(#9446773)
DirectX still uses stuff like ID3D11DeviceContext::PSSetShaderResources to set application-global state that's required to do anything. It is fundamentally stateful and non-pure. I'm not sure why you're trying to argue this point.
Re:FOAM: New JavaScript Framework by Google Engineers
by forthefuture on Monday April 27, 2015 @06:54AM
(#9445422)
Benchmarks for React tell a different story. It's like two orders of magnitude slower than multiple alternatives. If you are performance critical, React is not possible to use in production, and likely will never be considering Facebook's development practices.
Re:FOAM: New JavaScript Framework by Google Engineers
by antris on Monday April 27, 2015 @06:57AM
(#9445434)
I've deployed two applications to production that use React and in neither has React created a performance bottleneck. Both of them are heavily used in mobile, too. And they work wonderfully.
Benchmarks don't mean much when you're shipping real software to production.
Re:FOAM: New JavaScript Framework by Google Engineers
by Nemcue on Monday April 27, 2015 @09:58AM
(#9446291)
You're reading too much into benchmarks without understanding what the alternatives are.
Sure there are faster ways of rendering a template; just use format strings! Wow — super fast!
It's a nonsensical way of reasoning about frameworks.