Could someone having experience with Rum or other Clojurescript React bindings, but a better understanding of React coming from more JS like languages chime in with their experience?
Could someone having experience with Rum or other Clojurescript React bindings, but a better understanding of React coming from more JS like languages chime in with their experience?
In my view, React team actually -- discovered a paradigm that's really good and workable.
In comparasing Android SDK UI work -- feels like it was 'invented' rather than discovered.
Too much difficult to follow indirections and wrong abstraction.
When I program direct Android, I find myself introducing React concepts. Most of my Presenters and Views now have CMyState class and its one instance.
I have setState_XYZ, and clear_State associated with that state. I cary in that state backend pagination hints, etc (as an example).
And I use RxJava (in Android) to emulate eventing model of Clicks/Mounts/Dismounts (eg when android screen rotates).
All in all, again, it does seem that React developers (not sure who the credit should go to, Peter Hunt, many others ?) -- discovered an a abstraction that was always there, but was not easily crystalized through other frameworks.
And now it is. I would be happy if others would just emulate it and make it working across UI programming platforms. It supersedes in my mind anything else that I had seen in last 25 years, in this space.
Another big payoff with clojurescript IMHO is the use of async channels and go blocks in lieu of promises to handle asynchronous operations- It's nice to have what is essentially a form of cooperative multithreading right inside your client javascript code, without the need for web workers.
And react for js, ("react") is those patterns + patterns for js to make everything (sort of) work without as solid a language to steer one away from various cliffs.
Which is one reason why I don't quite understand why there are class based components at all.
At any rate - my current goal is to try some reasonml+react - and I think it'll feel better. And I'm not surprised cs+react feels more sane than js+react.
There's a really good history at https://stackshare.io/posts/the-react-story .
I didn't realize they didn't start with ocaml, but sml.
And Pete Hunt is:
I should've remembered the bit about sml - it's mentioned here after all! :
https://reasonml.github.io/docs/en/what-and-why.html
I do wonder if it'd be easier to port sml syntax to ocaml rather than make reasonml - I guess not. But it might give similar benefits: a pleasant syntax dialect for ocaml, a mature compiler for js and native, and bringing in th js and ocaml library ecosystems. [ed: but not, perhaps, 90% overlap with js syntax.]
As I mentioned - I haven't really played with reasonml/reason-react - I think maybe some of the impressions alluded to in my first comment came in part from this:
https://medium.com/@Imaginary_Cloud/reasonml-react-as-first-...
In particular sentiments like:
"When using ReasonML, we don’t need Redux anymore. ReactReason stateless components already come with the concept of a build in reducer, which is meant to take care of the problems Redux used to address."
Discussed here: https://news.ycombinator.com/item?id=17143494
As well as the introduction here:
https://github.com/reasonml-community/reductive/blob/master/...
"Reductive
A reimplementation of redux in Reason.
Word of Caution
You might not need this library, especially so in a language which provides good enough construction blocks out of the box. ReasonReact already comes with reducers!"
Also somewhat related (re: state) :
https://reasonml.github.io/reason-react/docs/en/state-action...
Classes in js are just syntax sugar, so even if you're writing classes you're still actually writing function prototypes. As such there's little reason not to support them, and they're very welcome when you have a team of developers that are adapting to modern js development almost exclusively from traditional OO languages.
Clojure's simplicity tends to package things up nicer than most other languages, especially a readme, but it's not particularly different from what people are already doing.