Support for Ocaml syntax

Hi, i recently wrote many haskell code, and got used to it, so

  • can i use ocaml syntax with rescript compiler?
  • what drawback if i can use it?
  • jsx support for rescript-react?

and i still prefer rescript approach than js_of_ocaml with reasonml to generate js.
sorry for my horrible english :smile:

Yes, you can drop in .ml files and just use OCaml syntax.

Constructs that are easy to express in ReScript are oftentimes inconvenient in OCaml syntax. E.g. there’s no JSX, so you need to use plain functions instead to handle your react element (basically write in the desugared way).

Biggest downside is that the docs are not maintained in OCaml syntax, so you’ll have a hard time finding resources online.

2 Likes

Does the project plan to ever remove .ml compilation?

1 Like

Not in our mind, but using the rescript syntax is one of the easiest way to support our work.

2 Likes

Does the OCaml syntax support GenType?

genType is using annotations that are supported in all syntaxes.

1 Like