Live data from Hacker News

ReasonML – React as first intended

imaginarycloud.com

21–30 of 190 posts

Re: ReasonML – React as first intended

#21

As a bit of a meta point, I find it really distracting when authors make random sentences bold. What you believe to be important is not necessarily what I'll find important, and the added emphasis breaks my flow.

I'm assuming it's more to help with skim reading.

Re: ReasonML – React as first intended

#22

As a bit of a meta point, I find it really distracting when authors make random sentences bold. What you believe to be important is not necessarily what I'll find important, and the added emphasis breaks my flow.

Placing emphasis on things is commonplace. Sometimes it's in the form of a literary device such as hyperbole and sometimes it's done typographically. You shouldn't read it as being "random" but accept it as part of the works. The author clearly intended to draw attention to those sentences and given it is his or her article, it should be accepted as part of the article and the overall message attempting to be conveyed.

Re: ReasonML – React as first intended

#23
post #18
post #17

Honest question: why would someone use this instead of React? From my point of view, React solved a real problem. JS before React (at least old-skool, with jQuery & co.) was simply unmaintainable. It was often easier to thow old projects away and start anew than to maintain what inevitably became a tangled mess of callbacks and global variables. Not because of incompetency of developers (at least I hope so ;) but bec…

For the same/similar reasons, more or less. You get a great type system, merlin(a great analysis tool), faster compilation, all kinds of great compile time checks, and you can still use react.

Those are all good things, but they aren't really the same reason. Parent describes JQuery to React as spaghetti code -> reasonable code, whereas React to ReasonML sounds like reasonable code -> reasonable code (with better tooling).

Re: ReasonML – React as first intended

#24
post #17

Honest question: why would someone use this instead of React? From my point of view, React solved a real problem. JS before React (at least old-skool, with jQuery & co.) was simply unmaintainable. It was often easier to thow old projects away and start anew than to maintain what inevitably became a tangled mess of callbacks and global variables. Not because of incompetency of developers (at least I hope so ;) but bec…

Some developers believe (and prefer) in that good type systems help for large software projects.

Re: ReasonML – React as first intended

#25

I'm always confused by statements like "You don't need Redux, you have reducer components". Reducer components don't solve the problem of a centralized/shared/common state and interactions between components.

Exactly my thought. It seems to me that it's just internal component state.. not application state

Re: ReasonML – React as first intended

#26
post #17

Honest question: why would someone use this instead of React? From my point of view, React solved a real problem. JS before React (at least old-skool, with jQuery & co.) was simply unmaintainable. It was often easier to thow old projects away and start anew than to maintain what inevitably became a tangled mess of callbacks and global variables. Not because of incompetency of developers (at least I hope so ;) but bec…

ReasonML is a language that transpiles to JS, not a view library so it's not gonna replace React. The more appropriate question is why someone use this for developing React app rather than using plain JS? The answer is IMO because React paradigm lent itself better with functional way of handling state like immutability and persistent data structures that's why ReasonML is more like a perfect match.

Re: ReasonML – React as first intended

#28
post #9

I'm reminded of the Hacker News post that introduced me to React from David Nolen back in 2013, where he first introduced ClojureScript's take on React, Om: http://swannodette.github.io/2013/12/17/the-future-of-javasc... Interested to take this for a spin.

Om isn't so much a take on React as it is a take on the state management layer and it uses React under the covers. I believe it's been largely superseded by re-frame [1], which follows the Redux / TEA model. There is an Om Next and that's basically a take on Falcor / Relay using the Datomic pull syntax but I haven't heard that much about it outside the talks where he was announcing it.

[1] https://github.com/Day8/re-frame/

Re: ReasonML – React as first intended

#29
post #8
post #7

Earlier quoted context omitted.

It's not any less convenient than React appears to be. Disclaimer: I've only used it for small Todo project, I'm not a front end guy. Disdisclaimer: I've not used React at all. However, if you need really strong JS interop, consider something like F#'s Fable. F# is gaining a lot of momentum and now that SAFE stack is apparently Microsoft-blessed, I expect it to continue growing even more.

1k upvotes. I check in on Fable and F# semi frequently but SAFE has somehow slipped under my radar. I wonder if the ionide project will get some extra support.. Suave though... Nothing against Suave, but it's not the Phoenix competitor the ecosystem is in dire need of. I was under the impression some newer frameworks like Giraffe were going to fill that void..

It's in an early stage but the Saturn [1] project is aiming to compete with Phoenix more directly. The owner is a fairly prolific F# open source contributor and presented it at NYC F# last month but that's about all I know about it.

[1] https://github.com/SaturnFramework/Saturn

Re: ReasonML – React as first intended

#30
post #23
post #18

Earlier quoted context omitted.

For the same/similar reasons, more or less. You get a great type system, merlin(a great analysis tool), faster compilation, all kinds of great compile time checks, and you can still use react.

Those are all good things, but they aren't really the same reason. Parent describes JQuery to React as spaghetti code -> reasonable code, whereas React to ReasonML sounds like reasonable code -> reasonable code (with better tooling).

Yeah, I agree but would say reasonable code -> slightly more maintainable, reasonable code. Sure, the low hanging fruit is gone, but it's a similar reason. What I'm getting at is that you can write spaghetti React pretty easily, and people do. One of the core promises of using an ML to do react is that its harder to mess with state all over the app and wind up with a big bowl of spaghetti.
Post reply on HN