You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as more features being introduced in server the communication get's trickier (syncing types / deciding where some specific logic should live / avoid logic duplication). it might be good to think about writing the server in ocaml.
OCaml as in OCaml syntax with ReScript, or OCaml with js_of_ocaml like vscode-ocaml-platform?
To me, it would have been way harder to contribute. I think most people who learned ReScript are also familiar with TypeScript. I would prefer to have the server in ReScript. Sharing types should still be possible.
But I also don't understand how the LSP-part is easier to integrate with other editors when it is not written in JS. If you think about moving as much logic as possible into the analysis binary or even another binary that gets called by a very lean server.ts, that may be valid, though.
My 5c is we should wait with this (and the related issue about rewriting the client in ReScript). My impression is that while migrating it to OCaml is a good long term goal, right now we should be prioritizing building crucial features, and onboarding new contributors. I think that's going to be easier to do in the current setup, at least for the foreseeable future.
Put in another way - it's not super large, but there's a fair bit of code in the server, and porting it + ensuring it all works as intended is probably going to be a significant undertaking. I don't think we can afford that undertaking (including all the risks of a rewrite getting stale etc) right now, before we have a large and sustainable contributor pool.
Activity
cristianoc commentedon Jun 8, 2021
Another major advantage is ease of integration with editors beside vscode.
A good point in time for this could be when the feature set stabilises.
fhammerschmidt commentedon Jun 8, 2021
OCaml as in OCaml syntax with ReScript, or OCaml with js_of_ocaml like vscode-ocaml-platform?
To me, it would have been way harder to contribute. I think most people who learned ReScript are also familiar with TypeScript. I would prefer to have the server in ReScript. Sharing types should still be possible.
But I also don't understand how the LSP-part is easier to integrate with other editors when it is not written in JS. If you think about moving as much logic as possible into the analysis binary or even another binary that gets called by a very lean
server.ts
, that may be valid, though.cristianoc commentedon Jun 8, 2021
We are talking about producing a binary, vs a bunch of .ts plus binary.
amiralies commentedon Jun 7, 2022
Should we do this?
iirc ocaml-lsp provides a lsp spec implemntation, I think we can use that.
zth commentedon Jun 7, 2022
My 5c is we should wait with this (and the related issue about rewriting the client in ReScript). My impression is that while migrating it to OCaml is a good long term goal, right now we should be prioritizing building crucial features, and onboarding new contributors. I think that's going to be easier to do in the current setup, at least for the foreseeable future.
Put in another way - it's not super large, but there's a fair bit of code in the server, and porting it + ensuring it all works as intended is probably going to be a significant undertaking. I don't think we can afford that undertaking (including all the risks of a rewrite getting stale etc) right now, before we have a large and sustainable contributor pool.
aspeddro commentedon Nov 30, 2022
Related to this topic.
The server side contains a lot of ts code. What I think can be moved to
analysis
and reduce transaction cost for the future:If we move all logic to ocaml we can:
server/src/{lookup.ts,buildSchema.ts}
server/src/{server.ts,utils.ts}
nojaf commentedon May 16, 2025
As mentioned in #1094, I toyed with this idea in https://github.com/nojaf/rescript/tree/lsp.
It uses https://github.com/c-cube/linol, which is a nice starting point for the LSP.
But yeah,
tl;dr
it is a lot of work of course.