ReasonML vs TypeScript

前端 未结 6 1840
挽巷
挽巷 2021-01-30 06:44

What are the tradeoffs between ReasonML (https://reasonml.github.io/) and TypeScript (https://www.typescriptlang.org/)?

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 07:22

    (just a note)

    Putting all practical aspects aside;

    The ML family of languages are based on a type theory called System-F, which is also used by Purescript and Haskell, for instance.

    Typescript lacks such a well established foundation and instead uses a new experimental type system with many special bits (I am not even sure if it's "formalised").

    So on the surface, TS's approach might seem "practical", but it introduces more complexity that necessary. System F has a small number of rules that make up the system and it is very general, yet easier to reason about that TS's "theory". Less is more.

    Also, effort put into learning System-F is rather timeless and translates to other, more powerful languages, such as Purescript.

提交回复
热议问题