Use ReScript JS and Belt with OCaml syntax?

I have a project that I am integrating ReScript into and I would prefer to use the ml syntax, if possible. It works fine for the most part, but I am getting unbound module errors for anything ReScript related (JS, Belt, etc.) The project builds fine - it’s only the LSP throwing errors.
Looks like ReScript no longer generates merlin files - is there a way to fix this issue easily or am I just stuck using the ReScript syntax now?

Why do you want to use ml syntax? If you want to stick to the OCaml ecosystem it’s better to take a look at Melange.

2 Likes

At this point if there was an alternative way to do conditional compilation, I would be all for removing OCaml syntax support. Discouraging it in the forum and simply not documenting it is not enough, apparently.

I think it is also odd to want to use the old OCaml 4.06 syntax that is supported by ReScript, when you can use the newest one in Melange (except of course if you don’t know about Melange).

Please use ReScript’s own syntax if you use ReScript. Everything in the ReScript space is tailored to it and your life will be easier.

4 Likes

Yeah, if you want the reason OCaml syntax Melange is the way to go.

If you really want to share significant parts of code and libs with OCaml, mélange is indeed the way to go here but I’d still say that being able to consume OCaml code in rescript is quite nice because there are quite valid use cases where you want to share simple types between your rescript front and ocaml back for example, or to use ocaml/rescript libs like ATD.

1 Like