4 ms·
Relit: Typed Literal Macros for Reason
- crimsonalucard 8y agoAnybody got a gauge on reason? Does it have the potential to change the current paradigm on client side browser development?
- galfarragem 8y agoAnswer to the same question in a recent thread: https://news.ycombinator.com/item?id=17933179 https://news.ycombinator.com/item?id=17933179
- nouveaux 8y agoComment I wrote in a previous thread with some minor edits: "We chose ReasonML after a previous project of working with JS, React and Flow. We started using Reason back in May. The plan was to use typescript, but after some great experiences with Rust on personal projects, I really wanted a language closer to Rust. Our team loves using Reason and for me, it's been such a breath of fresh air. Working on front end code is a lot more fun because many of the frustrating things with JavaScript/React has been removed. The compiler is VERY fast and the language is well designed. With that said, the learning curve is a bit much due to the lack of beginner friendly documentation. If you do not have experience with an ML like language (Rust, Swift, Scala, Ocaml, F#) AND React, I think it will be painful. Despite that, it is totally worth learning. The good news is that the core team realizes this and things are changing fast. React was originally designed for an ML based language and you can it's easy to see all the awkwardness of ReactJs removed in ReasonReact. ReasonReact really is an eye opening experience of how good front end dev can be."
- kbd 8y agoI didn't realize Reason was so geared towards React. Would it be foolish to use an alternative like Vue with it? What about server-side with Node?
- nouveaux 8y agoReason itself is not geared towards React and it is a general purpose language. I emphasize React mostly because the original creator of ReactJS is involved in creating Reason and you can see that React was designed for a language like Reason. I do not think it would be foolish to use it with Vue and Reason is actively used with Node. For instance: https://github.com/reasonml-community/bs-express https://github.com/reasonml-community/bs-express There is a lot of work going into the backend for Reason and I'm pretty excited about this.
- fspeech 8y agoReason itself is an alternative syntax for OCaml. The developers have built great support for React but in principle you can do whatever you can do with JS.
- kbd 8y agoSo what's the deal with BuckleScript? The docs are really unclear on their relation and just call it a "partner project". But it's the actual compiler? Then what is Reason?
- fspeech 8y agoReason = syntax for OCaml. Bucklescript is a transpiler to js. You can use other transpilers if you want but Bucklescript is great and has tightly integrated support. The best way to experience it is to just follow the "npm install" instructions. It may be a little confusing since you install Bucklescript, instead of Reason, as Reason is a syntax that Bucklescript supports. The online playground works great as well if you just want to get a feeling about the language.
- crimsonalucard 8y agoCan bucklescript compile OCaml into js?
- 8y ago
- pjmlp 8y agoThe only place where I see any references to it is on HN and conferences like StrangeLoop. For the kind of customers I work for, if it wasn't for Angular adopting TypeScript, we would all still be using plain old JavaScript on our Web apps.
- azangru 8y agoWeird. There were quite a number of conferences where Reason was mentioned: - ReactiveConf (I think Sean Grove talked about it) - React Rally, or wherever Ken Wheeler talked recently – he gave several talks about how Reason is the shit - I think there was a conference dedicated entirely to Reason — ReasonConf 2018 And Twitter of course. I see it referenced quite frequently.
- pjmlp 8y agoReact related conferences, fair enough. I don't follow React development.
- kbd 8y agoCould anyone please compare Reason and Elm? I tried Elm for a while but felt really constrained, and strongly disliked feeling trapped in its bubble.
- riwsky 8y agofor better or for worse, there is much less of a Reason bubble to be trapped in. The foreign function interface of the bucklescript compiler (Reason/Ocaml->js) makes for a much more gradual boundary between javascript and Reason code than that between js and Elm, a difference that flows naturally out of the different language designs: OCaml is multi-paradigmatic, sporting mutability and an object system, whereas Elm tries to help the user (e.g. via better isolation/prevention of errors) by sticking to one paradigm. Even within the functional paradigm, OCaml offers all the tools Elm does (leading to re-implementations of elm structures like https://github.com/OvermindDL1/bucklescript-tea https://github.com/OvermindDL1/bucklescript-tea ), and more — the module system is the biggest one to come to mind, but library authors have even found client-side uses for esoterica like phantom types (ensuring certain safe usage patterns without runtime costs). Bubbles can be nice, though! For example, some people are confused by the fact that there is a "beta" standard library in addition to the one that Reason ships with - and that at least one popular (arguably the most popular) book on OCaml — "Real World OCaml" uses a third standard library which is neither of those. One can debate how much of a problem or how widespread of a problem this is in practice, but it stands that this is not a problem at all for Elm.
- cies 8y agoYou may like PureScript. More like Elm in sense of purity, without the "artificial" constraints (Elm's creator believes the lang should not/nevah/evah serve general purpose).