Open mununki opened 2 years ago
Seems like you'd need to write rescript bindings for both vscode
and vscode-languageclient/node
?
@somebody1234 yes, it does. The vscode extension for OCaml does binding with jsoo. https://github.com/ocamllabs/vscode-ocaml-platform/tree/master/src-bindings
I wonder if it's possible to convert them to ReScript bindings automatically, because that is a lot.
Converting the client to ReScript would make contributions much more time-consuming if the bindings are not complete. So IMO this is only feasible if you have somewhat complete bindings and even then it is probably not worth it, except maybe for marketing purposes.
I wrote a bit about my thoughts on this here: https://github.com/rescript-lang/rescript-vscode/issues/269
In short, I don't think there's enough potential gain from this. If we were to do anything I'd imagine it'd be rewriting to OCaml. If we do end up doing that, whatever's left of the extension in TS is going to be minimal.
You would write the client in OCaml? Is it because you would steal some code from https://github.com/ocamllabs/vscode-ocaml-platform? Otherwise I think if the server ever was rewritten in OCaml we could share some types with a ReScript client as well.
No, I wasn't very clear 😄 I mean if the server is rewritten in OCaml. The client is so little code (and will be even less as we move more things to the server) that it won't matter what it's written in imo. It'll essentially just set up the language client.
@fhammerschmidt @zth I guess the binding is not that huge amount of job maybe. I think that ReScript's interop system is quite productive and flexible. I just came up the thought to rewrite the extension after I looked the OCaml's extension. And I expect that ReScript developers are going to contribute more easily if the source codes are written in ReScript. Furthermore, this extension project could be one of the best opportunity to gather and learn from each other ReScript users, plus improve the DX by ourselves.
@fhammerschmidt @zth I guess the binding is not that huge amount of job maybe. I think that ReScript's interop system is quite productive and flexible. I just came up the thought to rewrite the extension after I looked the OCaml's extension. And I expect that ReScript developers are going to contribute more easily if the source codes are written in ReScript. Furthermore, this extension project could be one of the best opportunity to gather and learn from each other ReScript users, plus improve the DX by ourselves.
Totally agree!
The reason to rewrite the client in ReScript seems pretty obvious to me. It will help us to get a more concrete and more manageable client application. Any plan for this?
I've read issue #269, and the server seems a different story. There will be some trade-off between producing a binary and .ts plus binary. But, I think there are more benefits in rewriting the client in ReScript.