We built Hyperswitch, a free open-source payments "switch" that allows you to connect to additional payment processors through a single API.

[AskJS] We ditched TypeScript for Rescript for building an open-source Payments Switch : javascript

submited by
Style Pass
2023-01-27 05:30:08

We built Hyperswitch, a free open-source payments "switch" that allows you to connect to additional payment processors through a single API.

As we built Hyperswitch, we had to think a lot about basic questions, like TypeScript vs. ReScript. Unlike TypeScript, which aims to cover the entire JavaScript feature set, we liked ReScript's focus on a curated subset of JavaScript's strengths. ReScript's type system felt so easy to use. Additionally, it's faster and doesn't require type annotations. The process of migrating to ReScript is also more incremental and controlled, resulting in a higher level of safety and clean code.

Never heard of it before, but you're going to have to lay out exactly how the rescript type system is more robust than TS. Mentioning rescript being statically typed as a reason for using it is kind of disingenuous as that's also exactly what TS provides. And you can write plain JS and TS in a functional style. I'm not sure what the actual benefit is here other than shilling rescript.

Came here to say this. Well authored library code in TS makes the consumer of that able to write both valid JS and TS that looks the exact same, with no type annotations as well, yet still fully type safe.

Leave a Comment