Live data from Hacker News

Learn how to unleash the full potential of the type system of TypeScript

type-level-typescript.com

11–20 of 256 posts

Re: Learn how to unleash the full potential of the type system of TypeScript

#14
post #2

I'm always impressed at how much the type system in TS is capable of. The provided examples remind me of what I'd expect in something like Rust; it brings me joy that we can do this sort of stuff in our frontend code and tooling these days. We have come far.

I'm currently working on a project that uses both Typescript and Scala. The overlap in concepts is rather useful when switching contexts.

Re: Learn how to unleash the full potential of the type system of TypeScript

#17
Nice course, and nice site.

Although, as a Haskell developer, I am curious what type system TS is using (System F? Intuitionist? etc) and what limitations one can expect. Aside from the syntax of TS being what it is, what are the trade-offs and limitations?

I was under the impression, and this was years ago -- things are probably different now?, that TS's type system wasn't sound (in the mathematical logic sense).

Re: Learn how to unleash the full potential of the type system of TypeScript

#18
post #16

I wish this issue would get addressed: https://github.com/microsoft/vscode/issues/94679 Showing fully resolved types in Intellisense would be the single largest usability enhancement they could make for me right now..

The Id type defined in the first comment seems like a pretty good, albeit ideally unnecessary, workaround.

Re: Learn how to unleash the full potential of the type system of TypeScript

#20

Nice course, and nice site. Although, as a Haskell developer, I am curious what type system TS is using (System F? Intuitionist? etc) and what limitations one can expect. Aside from the syntax of TS being what it is, what are the trade-offs and limitations? I was under the impression, and this was years ago -- things are probably different now?, that TS's type system wasn't sound (in the mathematical logic sense).

I don't believe it is using any type system described outside of the TypeScript compiler. The goal of the system is to accurately describe real-world JavaScript programs and semantics, not to introduce a formalization that existed elsewhere and impose it on JS.

As a consequence, it has aspects of structural types, dependent types, type narrowing, and myriad other features that exist solely to model real-world JavaScript.

As far as soundness: it's not a goal of the type system. https://www.typescriptlang.org/docs/handbook/type-compatibil...

Post reply on HN