Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anyone have any experience with both PureScript and ReasonML that can compare the 2?



During the 2016-2017 New Year I did an intense look into Purescript. I bought the LeanPub book and did all kinds of stuff with it. More recently I did a look into ReasonML. I bought the Pragprog book and worked through that. For me, it came down to Haskell vs OCaml. I'll admit, I have a serious love for OCaml/F#, so I immediately was excited about ReasonML. Many concepts just transferred very easily. Purescript felt very academic once I got into trying to build real things. Watching Phil Freeman's talks/Google Hangouts on building cool new projects really was eye-opening. That guy thinks on an entirely new level... who knows, maybe most Haskellers do? I have a sincere appreciation for Haskell, but I have yet to bend my mind around it, so Purescript left me in the same place - I felt like I wasn't really grokking it. I should stress that this is ME, so you may have an entirely different experience. I'm not saying that Purescript was bad at all.... it just wasn't clicking very well.


I had this exact same question and couldn't find much out there.

Based on what I have seen ReasonML is being pushed more within the React community and has more of a JS syntax so there is less of an abrupt change in terms of language.

PureScript follows the Haskell syntax that I personally like more and find cleaner and more useful for FP programming.

The ReasonML code I've seen doesn't have as much computer science rigor or abstractions like monads. This means the ReasonML community generally works at a lower level of abstraction compared to the PureScript crowd.

The interop with JS looks a cleaner in PS.

The tooling looks better around ReasonML especially around fast compilation and automatic reloading.

PureScript has a richer type system.

Personally, I would rather use PS but I've studied Haskell a bit already. For people without the Haskell background ReasonML provides an easier transition so it is an easier sell for a team.


Yeah I've used both quite a lot.

Both languages are pretty similar. ReasonML isn't actually a language but more like a new syntax for Ocaml (Bucklescript on the frontend), kind of like what Coffeescript is to JS.

- Both have row polymorphism and higher kinded types. - Purescript has ad hoc polymoprhism, Ocaml doesn't but it's planned in a future release. Purescript achieves it via typeclasses, future Ocaml will achieve it via modular implicits which is more sound from a type system perspective. - Purescript has higher kinded polymorphisn, Ocaml only has a lightweight version of it via it's module system. - Purescript has better support for type-level programming although awkward, but Ocaml has good interop with Coq -it's written by the same people - Purescript is purely functional, Ocaml isn't although it emphasizes a purely functional approach - Purescript places category theory abstractions first like Haskell does as a core aspect of the language. Ocaml doesn't, although it's standard library has all of the same kinds of functions and there are category theory libraries and everything - Ocaml not just -to-JS, it's also a compiled language, and has had real industrial use as a systems language in the finance industry (Jane Street) - Ocaml's compiler is _insanely_ fast compared to any other compiler I've ever used. I absolutely appreciate it - Future Ocaml will be multicore and have a builtin algebraic effects system, basically like Haskell's extensible effects but without the performance hit or having to muck about with monads - Ocaml has GADTs, polymorphic variants, and a way to extend the language via PPX. Polymorphic variants are awesome - Ocaml's module system is really powerful and amazing

Overall both languages are great, but for almost every use case I'd go with Bucklescript/Ocaml any day. It's type system is pretty simple and easy to learn. Purescript has the same issue as Haskell which is the learning curve: higher kinded polymorphism, typeclasses, enforced purity via "the IO monad", and category theory concepts all add up and take quite a while for people to get used to. And the compiler is really fast. And you can write low level imperative code if you need to for performance. And the type system is really expressive, moreso in my opinion than Purescript's because of the poly variants. And you get like 90% of the benefit of using a language like Haskell and Purescript because of the `option` type and enforced safety via exhaustive pattern matching

I can't wait until Ocaml gets modular implicits and algebraic effects into the core language.


PureScript is heavily influenced by Haskell with a focus on purity, monads and lots of abstraction, while Reason is literally OCaml (which has a more pragmatic take on mutability) only they switched the ML syntax for a JS-like syntax.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: