▲ | nine_k 5 days ago | |
I wish somebody with this amount of experience would compare the benefits / shortcomings of using the ReasonML syntax. (The article mentions it once, in passing.) | ||
▲ | globuous 5 days ago | parent | next [-] | |
What I missed most were let bindings (https://ocaml.org/manual/5.3/bindingops.html) ReasonML has custom operators that allows for manipulating monads somewhat sanely (>>= operators and whatnot). rescript (reasonml’s “fork”) did not last time I checked. But it does have an async/await syntax which helps a lot with async code. reasonml did not last time I checked, so you had to use raw promises. I believe Melange (which the article briefly talks about) supports let bindings with the reason syntax. And this kinda changes everything if you React. Because you can now have sane JSX with let bindings. Which you could not until melange. Indeed, you can PPX your way out of it in ocaml syntax, but I’m not sure the syntax highlight works well in code editors. It did not on mine anyway last time I checked. So for frontend coding, Melange’s reason ml is great as you have both, and let bindings can approximate quite well async syntax on top of writing readable monadic code. For backend code, as a pythonista, I hate curlies. and I do like parenthesis-less function calls and definitions a lot. But I still have a lot of trouble, as a beginner ocamler, with non-variable function argument as I need to do “weird” parenthesis stuff. Hope this “helps”! | ||
▲ | nukifw 5 days ago | parent | prev | next [-] | |
Sorry, I never used ReasonML so I don't see any advantage of using ReasonML except it had the time to die twice in 4 years :) | ||
▲ | hardwaregeek 5 days ago | parent | prev | next [-] | |
I like Reason syntax and I wish it was more common, but I think if you want to engage in the OCaml community it’s probably better to just bite the bullet and use the standard syntax. It’s what almost everybody uses so you’ll need to understand it to read any code or documentation in the ecosystem | ||
▲ | myaccountonhn 5 days ago | parent | prev [-] | |
I don't have extensive experience but the little I did was issues with LSP not working as well. |