| > Being able to write complex types in a syntax that more closely resembles JavaScript Yikes. This is how you end up in preprocessor hell. Macros are generally not a good thing. (Fyi: TS types are already Turing-complete which is arguably a mistake.) > Being able to debug types, not console output Eh. It's not like Java has a "type debugger." Why is this needed? Why are your types so complex? Weird ask. > More comprehensive documentation on writing advanced types Really beating the same drum here. > A typescript specification What does this mean? We have a pretty clear typescript spec[1]. [1] https://github.com/microsoft/TypeScript/blob/main/doc/spec-A... |
Not suggesting macros, rather an alternative way to define types. A function that accepts and returns types. Seeing as typescript has a JavaScript interpreter I thought it might be feasible but I'm just spitballing it.
> Eh. It's not like Java has a "type debugger." Why is this needed? Why are your types so complex? Weird ask.
I don't buy this argument. Writing any type of complex types with recursion, arrays or ternaries sucks and it will take more than "this is how Java does it" to convince me otherwise. I like to debug with a debugger, not my head.
Take a look at the examples in the article to see some complex types and read some tweets from library authors complaining on twitter. I can find some examples if you're interested.
> We have a pretty clear typescript spec
I hadn't actually seen this and it looks interesting but seems pretty out of date, Typescript 1.8?