Hacker News new | ask | show | jobs
by RyanCavanaugh 1095 days ago
Runtime type systems: TS has none; C# has extensive RTTI

Function dispatch: TS is purely dynamic; C# has both static and dynamic

OOP: Mandatory in C#, optional in TS

Variance: Implicit in TS, explicit in C#

Numeric types: TS has one (number); C# has the entire signed/unsigned/float x 8/16/32/64-bit matrix

There's really no intentional effort to converge them.

2 comments

TS has two. number and bigint[0], corresponding to Number and BigInt in JS, respecitvely

[0]: https://www.typescriptlang.org/docs/handbook/2/everyday-type...

Your list of differences is correct but not really what I meant. The points you listed are mostly due to JS runtime constraints. The choice of nominative vs structural type system is purely a design choice by the typescript team.