ecmascript-types
ecmascript-types copied to clipboard
Would it make sense to align with TypeScript syntax?
Static types officially in JS would be awesome. It would allow things like AssemblyScript (TypeScript to WebAssembly) to be even more possible in a standard way, and for alternatives to exist and push boundaries forward.
I see some differences in the proposal compared to TS syntax, which is why I was curious. AssemblyScript already rides on TypeScript syntax.
Or are there benefits that this proposal's syntax has that make it a better choice than TypeScript syntax?
TypeScript in itself is not a "Standard" language it's just syntactic suger on top of a standard JavaScript syntax to add types.
i don't see any "compile-to-js" languages as a "standard"
Based on feedback I incorporated unions - which might still have issues with parsing ambiguities. I also added the interface sections because they're important. If TS handles things better for features I'm all for changing things. Feel free to open issues for things TS does better.
(I don't use TS, and it's been a while since I've looked into the differences or made 1:1 comparisons. Working from small code examples would probably be ideal).
We should make this proposal more close to typescript in order to do not destroy the whole typescript ecosystem like DefinitelyTypes packages.