rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

Rewrite the client in ReScript

Open mununki opened this issue 2 years ago • 9 comments

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.

mununki avatar May 05 '22 15:05 mununki

Seems like you'd need to write rescript bindings for both vscode and vscode-languageclient/node?

somebody1234 avatar May 06 '22 01:05 somebody1234

@somebody1234 yes, it does. The vscode extension for OCaml does binding with jsoo. https://github.com/ocamllabs/vscode-ocaml-platform/tree/master/src-bindings

mununki avatar May 06 '22 01:05 mununki

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.

fhammerschmidt avatar May 06 '22 09:05 fhammerschmidt

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.

zth avatar Jun 07 '22 12:06 zth

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.

fhammerschmidt avatar Jun 07 '22 14:06 fhammerschmidt

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.

zth avatar Jun 07 '22 14:06 zth

@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.

mununki avatar Jun 08 '22 00:06 mununki

@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!

Mng12345 avatar Jul 28 '22 07:07 Mng12345

https://github.com/rescript-lang/rescript-vscode/issues/269#issuecomment-1148573636

mununki avatar Aug 03 '22 04:08 mununki