4 ms·
In my experience with these typed alternatives to JS, as long as you stay within that language things are good and smooth. But as soon as you need to interface
by jatins 5y ago
In my experience with these typed alternatives to JS, as long as you stay within that language things are good and smooth. But as soon as you need to interface with 3rd part lib, that's when things start to get messy.
Providing type declarations for every third party lib you might want to use, especially in an ecosystem like Javascript's which relies heavily on them, gets tiring pretty fast.
Typescript manages to get past that because it has reached a level of adoption now that most popular libraries will have a @types/<lib> package also but it took a long while to reach that stage.
Curious if anyone has used ReScript at a larger scale (and does not have the resources of, say, Facebook) and what's their experience been like.
- idontwantthis 5y agoTypescript is great because without it, you still need to determine a library’s types. It’s just that the type checking is only done in your head. If you need to add types to a JS library that still doesn’t have them for some reason, you’re actually doing less work than if you didn’t add them. Add the types as needed and you’re good.
- greyblake 5y agoI agree, ReScript has no big adoption (hopefully yet), and that's the biggest disadvantage in comparison with TypeScript. But somebody has to do the first steps...
- cies 5y agoThere's some project to get TS type annotations to work for ReScript. It'd be great if ReScript could lift on the work done by the TS community to produce types for many common JS libs.
- jatins 5y agoI wonder how would that work. Typescript has pretty advanced types like Template Literal Types[0]. Wouldn't ReScript need to support all those types? Or maybe it just resorts to `any` equivalent if I can't map a TS type to ReScript type. [0] https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html https://www.typescriptlang.org/docs/handbook/2/template-lite...
- thegreatpeter 5y agoWe use ReScript at Draftbit (https://draftbit.com https://draftbit.com). We're a small company with about 13 people. Former coworkers have messaged me saying that they miss writing ReScript and wish they could convince their team. We have about 1200 ReScript files on both front-end/back-end. It's great. It feels much safer to refactor and write new code. We use TypeScript in some places, like TypeORM and we're able to consume those types on the Rescript side. Rescript generates and consumes typescript types via gentype. I'd strongly recommend you try it!
- brundolf 5y agoOne solution is for the language to batteries-include all the most important stuff. This is pretty much what Elm does, and it seems like ReScript does at least some of that with the React integration