Why is rescript-vscode written in typescript?

Why is rescript-vscode written in typescript but not rescript?

How could one decide on using rescript or ts?

2 Likes

It’s a quick solution/prototype to enable minimal editor support for rescript and gather feedbacks. maybe the code is initiated from a template or another extension, not sure though. I think it will be written in rescript in long term.

I took the VS Code server and rewrote it in ReScript for coc-rescript this morning to learn how language servers work :smiley:

It’s indeed initiated from a template, and indeed for quicker and better initial iteration =).

The truth is that the bulk of complexity in such project comes from the language-server protocol itself. MS provides the right helpers in TypeScript (naturally). VSCode also has dedicated debugging facilities that help with writing a language server; the vertical integration works. It’s already a lot of mental gymnastic to unwrangle the lang-server spec (plus making sure it’s solid and performant, which it is not by default, due to its nature of being a distributed system architecture), so I didn’t find a point in first yak shaving with ReScript bindings and “reimagining” a different kind of architecture by wrapping the existing one.

Once the plugin’s solid, then we can decide to convert it to ReScript cost-free thanks to our interop and conversion method.

I do believe this question was asked with the nice intent, but let me take this occasion to address a bigger issue!

It doesn’t always make sense to prioritize bootstrapping. Case in point, our compiler isn’t written in ReScript either. It’s a bit self-serving and imo a perspective issue in some more purist/naive corners of our community. Writing something in ReScript doesn’t suddenly guarantee that your code is gonna be all shiny and error-free. Consider that the whole purpose of this effort is to provide a more robust successor to RLS, which is written in old ReScript.

Our desired differentiator for our community vs others is that we start with the perspective “how can I make this product great?” (like some Indie community for macOS and games) and then hopefully see that ReScript can be a good tool in achieving that purpose in many cases. We should never start with “ok, where can I shoehorn ReScript next? Here’s a potential use-case!”. High quality software rarely comes from the latter mentality imo (and any other kind of premature abstraction). Actually, brute forcing ReScript into a situation without proper consideration is how you lose credibility among your teammates when you try to convince them to use ReScript, as I’ve seen happen many times.

Quality product first!

11 Likes