Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    D

    Dan Vanderkam

    effectivetypescript.com · Personal blog · on HN since 2020

    Dan Vanderkam, author of the book Effective TypeScript, writes about TypeScript's type system, its features, and its tooling.

    Visit blogHN submissions
    Languages & CompilersWeb DevelopmentProgramming
    What HN says

    HN commenters recommend his Effective TypeScript book as a good, framework-agnostic starting point and cite his post arguing unsoundness rarely matters in practice.

    Stats for nerds
    22HN people shared it
    16linked in comments
    518story points
    May 2026last shared
    2020people per year2026

    Top posts on HN

    1. 1
      What's TypeScript compiling? Use a treemap to find out
      1 person · 406 points · first shared 2022 · 140 comments on HN
    2. 2
      What can TypeScript learn from Zig? What can Zig learn from TypeScript?
      1 person · 87 points · first shared 2024 · 24 comments on HN
    3. 3
      All I Want for Christmas Is These Seven TypeScript Improvements
      1 person · 4 points · first shared 2022 · Discussion on HN
    4. 4
      TypeScript 5.5: A Blockbuster Release
      1 person · 3 points · first shared 2024 · Discussion on HN
    5. 5
      The Making of a TypeScript Feature: Inferring Type Predicates
      1 person · 3 points · first shared 2024 · Discussion on HN
    6. 6
      TypeScript splits the atom A first look at TS 4.1's new template literal types
      1 person · 3 points · first shared 2020 · Discussion on HN
    7. 7
      The Seven Sources of Unsoundness in TypeScript
      7 people · 2 points · first shared 2022 · Discussion on HN
    8. 8
      A TypeScript Perspective on Go
      1 person · 2 points · first shared 2022 · Discussion on HN
    9. 9
      What's the Type of JSON.parse(JSON.stringify(x)) in TypeScript?
      1 person · 2 points · first shared 2020 · Discussion on HN
    10. 10
      The Saga of the Closure Compiler, and Why TypeScript Won
      3 people · 1 points · first shared 2023 · Discussion on HN

    What HN people wrote when they linked it

    • nextaccounticMay 2026

      > TypeScript's decision to embrace existing npm ecosystem and layering .d.ts on top was a very practical decision that made it so successful.

      I don't think this is the problem.

      I mean, ok, the first part of the problem is that typescript can't or won't represent at the type level some real world Javascript constructs. But that's understandable since Javascript can get arbitrarily complicated. (you could do a survey on npm and make a type system strong enough for all existing libraries, but this would probably be too complicated to use)

      So this is not by itself too bad if, for each instance of non-representable APIs, you wrote a wrapper library that called the bad library but gave you a perfectly good API to work with. Similar to how in Rust you are supposed to wrap unsafe libraries with a safer, higher level API on top. (except it' s not about memory safety, but type safety. but the same reasoning applies, it's just lower stakes since UB is not involved)

      So the other, more fundamental problem is that for some godforsaken reason, Typescript decided it was okay to lie with types. Some operations return the wrong type rather than a more honest type. This is not caused by the fact that Typescript has to work with libraries in npm, it's entirely self inflicted. Elsewhere in the thread someone gave an example: stringArray[0] has type string when it should be string | undefined.

      This (and all other instances of deliberately lying with types) is why Typescript is unsound.…

    • chubotAug 2023

      I think if you're writing code from scratch, this doesn't really apply -- I'm talking about writing a toy language that doesn't use any libraries at all.

      (I'm aware of all the terrible experiences people have with TypeScript in the NPM ecosystem. But it's a big, mature tool and you can use it in more than 1 way.)

      I just noticed the 'deno check' command I'm using turns strict mode on by default, so that's good.

      https://deno.land/manual@v1.4.1/getting_started/typescript

      All gradual type systems in production use are unsound because they have to interoperate with untyped code, and the dynamic checks to make it sound are too expensive.

      But code written from scratch doesn't have that issue. I'd be interested in a counterexample -- is there a code snippet that passes the strict mode of the compiler, and doesn't interoperate with untyped code, but produces an unexpected runtime error?

      I guess by "unexpected" I mean at runtime, and operation is performed on a value which is not allowed, and the program fails

      I googled and found this -- https://effectivetypescript.com/2021/05/06/unsoundness/ -- not sure I agree with some points, e.g. array out of bounds isn't unsoundness! The OPERATION is legal, but the data isn't, which isn't something that any type system will tell you.

      Similar to divide by zero -- a runtime error does not imply unsoundness.

    • colinmcdMay 2022

      TypeScript's type system is unsound in a mathematical sense: https://effectivetypescript.com/2021/05/06/unsoundness/ Though this has little bearing on practicality which is probably why the original comment is at the bottom of the pile.

      He's also using a stricter mathematical definition of "type safety" whereas tRPC means it in the colloquial way it's used in the TypeScript ecosystem (that is, a fully typed interface between client and server, ideally that's non-duplicative and inferred directly from your code instead of being manually defined).

    • amgregMay 2025

      Yeah nowadays I think non-ClojureScript people use it mostly for legacy reasons or the aggressive minification. Back in the day, aside from the pre-ES5 conveniences I mentioned surrounding inheritance and module bundling, it was also a way for developers to do some basic type enforcement (via JSDoc annotations that the Compiler would check). TypeScript essentially rendered that obsolete.

      See: https://effectivetypescript.com/2023/09/27/closure-compiler/

    • spiralxJul 2021

      Try "Effective TypeScript" from O'Reilly, every chapter I've read so far has been informative - even when I thought I knew the topic inside-out - and it's well-written for the subject depth. You can read some of the items on the author's site e.g.

      https://effectivetypescript.com/2020/03/09/evolving-any/

      https://effectivetypescript.com/2020/03/24/null-values-to-perimeter/

    • bichiliadJun 2022

      If you're going down the rabbit hole of writing complex types, check out Dan Vanderkam's "The Display of Types" post[0]. It goes into how types show up in editors and error messages and such, and has a bunch of tricks for improving type readability. I really wish I read it sooner!

      [0]: https://effectivetypescript.com/2022/02/25/gentips-4-display/

    Related

    TypeScript Blogdevblogs.microsoft.com/typescript162 people

    A 10x Faster TypeScript

    TypeScript Blog
    Company · last shared 2026
    Marius Schulzblog.mariusschulz.com16 people

    Why Using .* in Regular Expressions Is Almost Never What You Actually Want

    Marius Schulz
    Personal · last shared 2019
    Will Crichtonwillcrichton.net50 people

    Portable EPUBs

    Will Crichton
    Personal · last shared 2025
    2ality2ality.com267 people

    Temporal: Getting started with JavaScript's new date time API

    2ality
    Personal · last shared 2026
    Daniel Hooperdanielchasehooper.com29 people

    Making a 3D modeler in C in a week

    Daniel Hooper
    Personal · last shared 2026
    Loris Crokristoff.it105 people

    Why Go and Not Rust?

    Loris Cro
    Personal · last shared 2026
    Overreactedoverreacted.io186 people

    Goodbye, Clean Code

    Overreacted
    Personal · last shared 2026
    Stefan Baumgartnerfettblog.eu25 people

    Rust: Enums to Wrap Multiple Errors

    Stefan Baumgartner
    Personal · last shared 2024