West Asia - Communist - international politics - anti-imperialism - software development - Math, science, chemistry, history, sociology, and a lot more.

  • 11 Posts
  • 44 Comments
Joined 3 years ago
cake
Cake day: December 27th, 2021

help-circle






  • I won’t remember everything, but one very important things comes to mind:

    in Typescript, it is very difficult to assert on a type (let me know if you’re not familiar with what I mean by this and I can explain further). In OCaml, this is trivial using pattern matching.

    Why would you need that? The idea of a type system is it doesn’t let you apply a function on a structure without the structure being of the right type. But the lack of type assertion in TS makes people follow hacky workarounds, which defeat the purpose of type system.

    There are a couple of other things, like immutable types by default, automatic tail call optimization, functors enabling higher kinded types, etc.

    Also in ocaml, you don’t have to annotate any types on any variable or parameter, and you’ll still get full type protection.