2 ms·
Bucklescript extends OCaml syntax. OCaml has good support for language extensions. You need adaptations to interface to js.
by fspeech 6y ago
Bucklescript extends OCaml syntax. OCaml has good support for language extensions. You need adaptations to interface to js.
- e12e 6y agoOK. So ReasonML and bucklescript both extend ocaml syntax? And the bucklescript syntax and compiler is becoming ReScript - distinct from ReasonML. But the ReScript compiler supports three syntaxi going forward: ReScript(bucklescript), ReasonML and ocaml? And the ocaml (native) compiler supports ocaml and reasonml - but not ReScript?
- fspeech 6y agoReasonml is an alternative syntax for OCaml. From the user's perspective, there is just one language OCaml, with two alternative syntax OCaml or Reason. If you want to interface to Js you need additional annotation for FFI, no matter which syntax you choose. The Reason syntax includes this FFI https://reasonml.github.io/docs/en/external https://reasonml.github.io/docs/en/external adapted from Bucklescript, while Bucklescript itself is just OCaml plus the annotation and maybe other compiler directives. The Reason syntax also includes support for React which is not part of OCaml. I don't know what goes under the ReScript umbrella.
- e12e 6y agoThank you, that makes things a little more clear for me at least.
- sweeneyrod 6y agoMore specifically, the Reason syntax has JSX: you can use React without JSX in OCaml/BuckleScript and you can use JSX for non-React things in Reason (either BuckleScript or native).