Comment

Comment by waltera

I got interested in Reason last year after reading lorefnon's article [1] comparing Reason with TypeScript.

Recently, after evaluating both for a large project we decided to prefer TypeScript primarily because TypeScript's support for intersection types, mapped types and conditional types is really awesome and make integration with javascript libraries a lot easier. As far as I could find, similar things can't be done in ReasonML at all (although I could be wrong on it).

The tooling integration of TypeScript is also really awesome. Besides the usual refactoring, jump to definition support etc. a lot of effort has gone into small things that makes life easier. For example, if you have ctrl+click on a mapped type's property it will jump to the original type being mapped. In libraries like io-ts if you add doc comments on methods which are used to derive the types, the documentation will be propagated to the derived types [2].

I recently found that the author of the above post has been experimenting [3] with babel-macros [4] to facilitate nice type-safe fluent APIs/abstractions which are compiled away to simple readable javascript with zero/negligible runtime overhead and found it a really neat idea. Looking at some of that code, it appears to be a lot simpler than writing ppx macros [5] for ocaml which I very briefly experimented with.

[1] https://lorefnon.tech/2018/05/13/reasonml-vs-typescript-firs...

[2] https://github.com/gcanti/io-ts/issues/201#issuecomment-4347...

[3] https://github.com/ts-delight

[4] https://github.com/kentcdodds/babel-plugin-macros

[5] http://ocamllabs.io/doc/ppx.html

parent waltera 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton