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

ReasonML is just an alternative syntax for OCaml. Often people use "ReasonML" shorthand for "ReasonML, converted to OCaml, compiled to Javascript with BuckleScript" and "OCaml" for "OCaml compiled natively" but it's perfectly possible (and actually really easy) to use OCaml with BuckleScript and Reason natively.

Also note that despite the "O" in the name, OOP in OCaml is rare (for instance, there isn't any in the code in the article).



> Also note that despite the "O" in the name, OOP in OCaml is rare (for instance, there isn't any in the code in the article).

Which is kinda sad, because it has one of the best OO type systems in the industry, in my opinion. The decoupling of inheritance and subtyping, in particular.


What's the state of using Reason natively? Last time I checked all the documentation and examples where towards the reason/js/react ecosystem. Are there any good native code projects written in Reason to look at for reference?



That looks perfect, thanks!


There are two significant projects for native Reason:

- https://esy.sh/ - a package manager that offers a lockfile, aggressive build caching, and reproducible hermetic builds. So when you come back to a project a few months later, it still builds.

- https://reason-native.com/ - an umbrella for useful Reason-oriented native libraries


Reprocessing is a rewrite of Processing in Reason.

Runs with WebGL and OpenGL.

https://github.com/Schmavery/reprocessing


People don't do it much, but if you're using the most popular build system (dune) you can replace your .ml files with .re ones and it will Just Work. So you can use OCaml projects for reference (I think anyone who's doing Reason should have a vague grasp of OCaml syntax, it's not really that different).


> I think anyone who's doing Reason should have a vague grasp of OCaml syntax, it's not really that different

Especially if you're targeting native, so all your dependencies are written and documented in OCaml syntax.


Aren't the Ocaml and ReasonML syntaxes so similar that you can effectively convert both directions and still end up with clean idiomatic code? That has seemed to be the case when I've played around with the ReasonML, and if it's the case, then which one you choose to write is very much arbitrary. Heck, you could even write one syntax locally and then automatically convert to the repo's preferred syntax when you commit your code.


Yep. This is an especially weird thing for some people to grasp when working with native libraries developed in Reason (like Revery, which most people assume is built on web tech).


You're right! The toolbox is far better too




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

Search: