Hacker News new | ask | show | jobs
by azangru 1362 days ago
> "Align with current and future ECMAScript proposals."

But they admitted namespaces, enums, and interfaces into the language (the latter becoming more and more confusing as type aliases got more expressive),

> "Avoid adding expression-level syntax."

Is "as", "is", or "satisfies" expression-level?

> "Use a consistent, fully erasable, structural type system."

But the enums!

1 comments

> But they admitted namespaces, enums

And decorators. But this was very early on and they won’t ever do it again unless there’s a drastic change on principle and probably a reorg of global proportion. They categorically reject anything with runtime implications now, and to the point of decorators are actively working to align them with the standard as it’s approaching stability.

> and interfaces into the language (the latter becoming more and more confusing as type aliases got more expressive) […] Is "as", "is", or "satisfies" expression-level?

No. All of this is completely separate from the runtime and on a standards course to be treated effectively as comments.

> But the enums!

I’m one of the minority who actually likes TS enums, but I strongly suspect they’ll be deprecated, alongside namespaces, as soon as there’s general consensus around types as comments. The TypeScript team considers these mistakes and would very much like to be able to drop them. I’d welcome that too even though I quite like enums.

The fact is TS has considerable backwards compatibility expectations, and aligning their mistakes with their goals is great on principle but something which would require thousands upon thousands of hours of labor for people to accommodate.

You can snipe all you want, but if you think it’s that easy to resolve maybe I can direct you to https://github.com/microsoft/TypeScript/pulls

I’m not affiliated with the team in any way but I’m almost totally certain they’d welcome a contribution that gets them closer to their stated principles where historical designs are entrenched, without breaking workflows for thousands of people and interrupting releases for millions.