Live data from Hacker News

25 Days of ReasonML

medium.com

31–40 of 44 posts

Re: 25 Days of ReasonML

#31
post #15

I find ReasonML a VERY HARD sell when F# is sitting there waiting. If I could get people onboard with an ML, why wouldn't I use F# with it's massive backing ecosystem and fantastic server side runtime(node has come a long way, but it's no CLR)?

ReasonML is pushing hard on the "it's a better JavaScript" angle, which has a lot to do with it's popularity at the moment. In that regard I think it will be an easier sell than F# as ReasonML grows in maturity.

Part of the problem with adopting an ML is that it feels like a huge departure from mainstream software development. From the syntax, to the build tools, to the concepts one uses on a day-to-day basis, it can be hard to slog through to get to the point of feeling productive.

ReasonML is focusing on four things to help alleviate this friction from adoption:

1. Providing a more familiar syntax

2. Providing simple, high quality tooling built on top of a familiar ecosystem

3. Providing high quality documentation that focuses on onboarding developers who are coming from these other ecosystems

4. Providing a "killer-app" that can show the power of the language and draw peoples interest - in this case, Reason's integration with React through it's ReasonReact library and support for JSX.

I think that these 4 things really make a difference when getting "people onboard with an ML," which is why the ReasonML community is something that I'm betting on for the mid- to long-term future.

Re: 25 Days of ReasonML

#32
post #30

I've been learning ReasonML for React Native these past few weeks. I love the static typing. I can work on my editor for minutes at a time, and when things compile I see it "just work" on my phone. This is important since reloading a native app is not nearly as fast as reloading a web page. The best part is how FAST the compiler is! It blows me away how fast the reason/ocaml compiler is, considering it spits out Java…

How are you handling navigation?

I haven't gotten that far yet, but I'm planning to use their minimal built-in one: https://reasonml.github.io/reason-react/docs/en/router.html

Re: 25 Days of ReasonML

#33
post #15

I find ReasonML a VERY HARD sell when F# is sitting there waiting. If I could get people onboard with an ML, why wouldn't I use F# with it's massive backing ecosystem and fantastic server side runtime(node has come a long way, but it's no CLR)?

I tried getting into F# and for someone not running on Windows without knowledge of the CLR and .NET ecosystem its a hard sell.

I found getting F# dev environment set up on Ubuntu was super easy. That said that I found Merlin in Vim to be better than Jetbrains Rider. With Ocaml/Reason you should be able deploy via native binary. The build times and deployment story are going to be similar to Golang on the backend - if it works. With F# you have to deploy the CLR too.

Re: 25 Days of ReasonML

#34
post #28

Earlier quoted context omitted.

It's nor that hard of a sell I think... does F# compile down to javascript?

It does, there have been a couple options for a while but that had some catches but somewhat recently the Fable project came along and appears to be gaining tons of traction(for F# ecosystem) and killing it.

Thank you. I think I've heard the name Fable in relation to F#, but until this thread today, I had no idea F# compiles down to JS.

Re: 25 Days of ReasonML

#35
post #30

Earlier quoted context omitted.

How are you handling navigation?

I haven't gotten that far yet, but I'm planning to use their minimal built-in one: https://reasonml.github.io/reason-react/docs/en/router.html

ReasonReact currently only handle browser routing (it hooks directly into window.location API. So for ReactNative, it could do it the way you used to do with Javascript.

Re: 25 Days of ReasonML

#36
I don't get it, why does nobody ever mention the bad state of the DOM ecosystem in ReasonML? There is apparently a single way of accessing the DOM with a 3rd party library that is nowhere near finished.

Re: 25 Days of ReasonML

#37
post #15

I find ReasonML a VERY HARD sell when F# is sitting there waiting. If I could get people onboard with an ML, why wouldn't I use F# with it's massive backing ecosystem and fantastic server side runtime(node has come a long way, but it's no CLR)?

I don't have enough experience with ReasonML but the primary reason I am hesitant to adopt F# in my production applications (which currently use typescript) is because of following reasons:

1. Record types are very inflexible. It is, for example, not trivial to do things like get a new record type by adding a few fields to an existing record types.

2. F# supports only explicit interfaces. Making records implement interfaces requires defining getters and setters for every property. And requires explicit casting when you are sending a record to a function that uses an interface.

When you don't control the types (as is often when working with third party libraries) this becomes a major annoyance especially when you are habituated to typescript's structural typing.

While I would like to see opaque types in typescript for some use cases, I really think having structural types, implicit interfaces and erased unions by default makes life a lot easier, especially when it comes to interop with wider js ecosystem.

At the end of the day it quickly becomes very obvious that where as typescript was built from ground up to embrace javascript ecosystem, F# was not. As a result, when targeting javascript, a lot of design decisions which were based on limitations of CLR being a C# focused object oriented platform come across as bizarre and jarring. For instance why do we need both modules and namespaces ? Why are statically resolved type parameters only supported in inline functions ?

I will admit that this can be very much a case of me being more familiar with typescript and not so much with F#.

I do have a deep appreciation for both F# and Fable teams who have been incredibly helpful in stackoverflow and gitter. I strongly prefer F#'s syntax despite being a full time JS/TS developer and F#'s type inference is far better than what typescript offers today and at times it feels almost magical.

I also think that Fable's approach for generating babel compliant AST and taking advantage of babel ecosystem is brilliant and something I'd like to see in more languages targeting javascript.

Nevertheless, the learning is curve with the latter has been significantly steeper and at places the error messages are bizarrely confusing. Thus, I am not yet fully convinced that for a bulk of frontend applications (I mostly work on enterprise applications for data analysis and visualization) the benefits of that learning curve are substantially justified especially if you don't have any existing investment on the .Net side.

Re: 25 Days of ReasonML

#38
post #2

I'm interested in Reason/Buckle, coming myself from the ClojureScript. The seemingly tinier minified compilation size would be a huge plus. But what are the actual sizes emitted for large scale projects (arguably the ones that matter most for static typing)? Anyone could share real-world experiences? For reference: I know of cases where 60K lines of clojurescript (arguably equivalent to 150K lines JS) compile down to…

That's a very interesting question. We could ask some Messenger and Instagram people, since they are heavily using BuckleScript. In general output JS is already fairly spartan, because BuckleScript uses a few tricks here and there, like encoding modules and records as arrays instead of objects; and completely inlining functions whenever it can. BuckleScript also emits ES6 modules, with imports and exports, and it mar…

I have heard about the Messenger where they have 25-50% of the web client codebase in Reason, but I have not heard about the Instagram story. Can you share more info or some links about that?

Re: 25 Days of ReasonML

#39
post #15

I find ReasonML a VERY HARD sell when F# is sitting there waiting. If I could get people onboard with an ML, why wouldn't I use F# with it's massive backing ecosystem and fantastic server side runtime(node has come a long way, but it's no CLR)?

It's nor that hard of a sell I think... does F# compile down to javascript?

It does, though I've not used it myself so I can't comment on it personally.

http://fable.io/

Re: 25 Days of ReasonML

#40

I've been learning ReasonML for React Native these past few weeks. I love the static typing. I can work on my editor for minutes at a time, and when things compile I see it "just work" on my phone. This is important since reloading a native app is not nearly as fast as reloading a web page. The best part is how FAST the compiler is! It blows me away how fast the reason/ocaml compiler is, considering it spits out Java…

Do you use any third party libs?
Post reply on HN