ecmascript-types icon indicating copy to clipboard operation
ecmascript-types copied to clipboard

Would it make sense to align with TypeScript syntax?

Open trusktr opened this issue 3 years ago • 3 comments

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?

trusktr avatar Dec 27 '21 00:12 trusktr

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"

jimmywarting avatar Dec 29 '21 11:12 jimmywarting

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).

sirisian avatar Jan 01 '22 04:01 sirisian

We should make this proposal more close to typescript in order to do not destroy the whole typescript ecosystem like DefinitelyTypes packages.

CharlyJazz avatar Mar 11 '22 17:03 CharlyJazz