"Understanding TypeScript's Structural Type System" by Drew Colthorp

Поділитися
Вставка
  • Опубліковано 15 жов 2018
  • I was wrong. I thought TypeScript was something like a Java-ey type system layered atop JavaScript, bringing a dose of brittleness and losing the flexibility I appreciated about the warty-yet-ubiquitous multi-paradigm language.
    But that's not it at all! TypeScript radically improves the JavaScript development experience by providing a flexible, light-weight type system for modern EcmaScript. It does so while maintaining a delicate balance: adding a way to enforce assumptions and invariants without removing the flexibility prized by dynamic language developers. This works because TypeScript's type system is structural and not nominal - that is, based on shapes of data instead of identities of types.
    Come see what's cool and exciting about TypeScript's defining feature. We'll show what differentiates a structural type system from a nominal one; how key features of TypeScript provide a powerful language to express invariants about your system; and how TypeScript leverages its knowledge of what code implies about the shapes of data to avoid most of the type system nuisances that put some developers off of statically typed languages.
    Drew Colthorp
  • Наука та технологія

КОМЕНТАРІ • 10

  • @justinkim7202
    @justinkim7202 5 років тому +16

    This is the exactly what I was looking for for months! I couldn't figure out all these fancy cryptic typings in the TypeScript definitions of some npm modules and I finally get it now. Thank you so much for this talk!

  • @impankratov
    @impankratov 5 років тому +6

    Very good explanation of some basic typescript capabilities!

  • @dawid_dahl
    @dawid_dahl 5 місяців тому

    Btw, loved the talk. Thanks a lot! 🙏🏻

  • @nikosc
    @nikosc 4 роки тому +2

    This was unexpectedly great

  • @aviflax
    @aviflax 5 років тому +1

    I loved this talk!

  • @JosephCaburnay
    @JosephCaburnay 4 роки тому

    This is so awesome that liking it is not enough.

  • @uris77
    @uris77 5 років тому +1

    fp-ts is a good library that offers things like Maybe, Task, etc.

  • @krzysztofgrzybek6695
    @krzysztofgrzybek6695 5 років тому

    Solid!

  • @rrr00bb1
    @rrr00bb1 2 роки тому

    This is similar to Go. You just need promises to the compiler, so that it doesn't de-reference things that don't exist.