In a large application you will need a lot of features, which are provided by default in ReasonML: strict types, runtime validation if you encode/decode JSON, fast compilation time, immutable data.
In TypeScript you will have to add:
- ImmutableJS + its typings.
- Runtime validators like json-schema + its typings. Then you will have to write types in TypeScript, and also defined a schema in json-schemas. They can become out of sync very soon.
- Some crazy hacks to tell the difference if variable is of specific type (like in official docs of TS: https://www.typescriptlang.org/docs/handbook/advanced-types.html, Paragraph "User-Defined Type Guards"). This checks are done using side effects like a.swim !== undefined. In 6 months this 'if' statement will contain more and more checks.
- You are lucky if a package you use has official and maintained type definitions. Or you will end up with custom typings.
- If you develop hybrid app in JS + TS, then TS Compiler cannot create a bundled final d.ts file which you can import in other parts of your project. You will have to write separate d.ts files, which are bundled by tools like dts-bundle. If you have everything in TS, then this issue is not applicable.
- Large apps take a lot of time to be compiled by TypeScript.
With ReasonML:
- Immutable data is in the language.
- Runtime validators are present (bs-json has them by default)
- Pattern matching saves you from these crazy checks.
- You are lucky if npm package you want to use has BuckleScript bindings.
- N/A.
- ReasonML compilation is very fast.