Thoughts

mental health break ,./'"**^^$_---
This is amazing, re-Typescript parsing
> ...MS wanted to submit a proposal for type annotation syntax in core JS. The actual proposal differed from TS syntax in several key ways because TS's actual syntax is a) horrifying, b) incompatible with JavaScript's, and c) to this day fully understood by not one single human being. Thankfully the TC39 committee shot it down. > The worst part is that “to this day fully understood by not one single human being” is not an exaggeration. I've been over to the TS Discord to talk with actual Microsoft peeps about some of the syntax corner cases. Their response is that I should read the parser source code to see what it does. It's all procedural to them; no one over there is thinking about the grammar in abstract formal terms. And when they tried to do so for the TC39 proposal they gave up and submitted a modified version because the real one is basically intractable. As far as I can tell, there is exactly one thing in all the universe that knows how to parse TypeScript, and that is the official TypeScript parser. Everything else that needs to deal with TS syntax just uses the full MS parser if it can. The closest thing there is to a robust third-party implementation is the Sublime TypeScript package. (VSCode's TS syntax highlighting relies on LSP to work, which just uses MS's TS parser.) -Thom1729 on Discord.
Link 2:47 p.m. Sep 08, 2023 UTC-4