DEV Community

loading...

Discussion on: TypeScript is slow. What can we do about it?

Collapse
juancarlospaco profile image
Juan Carlos

"TypeScript way more powerful than Java or Scala." Citation Needed!.

Collapse
alekseiberezkin profile image
Aleksei Berezkin Author

TypeScript type system is πŸ˜€ That's not a citation, that's my own impression

Collapse
juancarlospaco profile image
Juan Carlos

Types on TypeScript are kind of limited compared to other programming languages, to name a few things missing:

  • Subrange types
  • JSON types
  • Regex types
  • int8/16/32/64 types
  • Char types
  • Option types
  • Dependent types
  • Custom Operator Overloading by Type on any Type
  • Types with Side Effects Tracking
  • Types with enforced run-time bounds checking
  • Probably more I dont remember...
Thread Thread
alekseiberezkin profile image
Aleksei Berezkin Author

I'm not sure it's correct to expect from TS some β€œcustom” primitives or anything in runtime πŸ˜€ TS doesn't have a runtime, and cannot add anything to JS primitives. These are parts of the TS type system which, combined together, form the TS uniqueness: unions and intersections, ambient types, augmented types, mapped types, conditional types (T extends U ? X : Y), inference by request (T extends Array<infer E> ? E : never), types assertions, types widening and narrowing. Now they added yet more: template literal types.

Thread Thread
juancarlospaco profile image
Juan Carlos

Other languages just have it builtin since long time ago for frontend too.
I said run-time not runtime.