5 ms·
Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are
by amelius 12y ago
Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?
- lukev 12y agoIt's easy to speculate that better solutions are possible, but noone has ever actually done it. React (used from a more functional language, like ClojureScript) is the closest system to the world you describe which actually exists. And no, papers and toy proof-of-concepts don't count. They are extremely interesting, and a necessary first step, but someone needs to build something large and demonstrate effectiveness in the real world before you can make an honest bid for large-scale adoption. As far as I know, no other FRP or functional UI system has done any better than React on that front, yet.
- amelius 12y agoTrue. But consider this: if we had a functional-style language that did not do any incremental computation, only the minimal React-style of re-rendering, that would already be infinitely better. Because it would mean we wouldn't have to totally rewrite our code whenever incremental computation became a reality. In other words, we can do it in steps.
- city41 12y agoI recommend checking out ClojureScript. The community is really moving in this direction. I find cljs takes React from good to great (I wrote a simple blog post about that here [0]), and up and coming frameworks like reframe [1] are going to make it even better. reframe and even vanilla Reagent/Om/etc are heading in the direction you desire. ClojureScript still has some warts to iron out, but all in all I feel like it's our current best bet for some truly amazing apps in the browser. [0] -- http://www.mattgreer.org/articles/reagent-rocks/ http://www.mattgreer.org/articles/reagent-rocks/ [1] -- https://github.com/Day8/re-frame https://github.com/Day8/re-frame
- tptacek 12y agoYou should write an article or a blog post about that and submit it. I'd upvote it! This thread isn't a good place for your point, which isn't germane to the article.
- skybrian 12y agoIf you're interested in this, perhaps try Elm? I'm not sure about performance, but it does enforce a pure architecture with all state outside the render tree.
- eric_bullington 12y agoIt's a good point. But don't mistake Flux, GraphQL, cursors, etc. with React. React is just a great, fast way to interact with the DOM, with much less hoops than usual. I think the community is still converging toward the proper way to deal with state. First it was passing callbacks, then the Flux pattern, and now there's talk of how GraphQL and Relay fit in. And speaking of functional approaches, there are those of us who have been inspired by the Clojurescript community (who was in turn inspired by Haskell, as I understand it) and are interested in using cursors (similar to lens) to encapsulate state.
- serve_yay 12y agoIt is always an adventure, to discover what will be on the other side of the phrase "Let's be real".
- warsheep 12y agoCan you (or someone else) explain the need for the language to be functional?
- city41 12y agoI don't think there's a strict need, but functional languages tend to bring the desired traits: immutable data structures, referential transparency, isolating side effects and state mutation as much as possible, etc. It seems like the more one uses React, the more they crave the above, so it makes sense to use an environment where all of the above is natural.
- bpicolo 12y agoSeeing "Mixins are awesome" is bringing back so many code smells. : (