-
What if instead of formalizing TS, the proposal is to allow alternate parsers via a combination of
proposal-built-in-modulesandproposal-import-assertions? -
…in reply to @rockerest
For example:
import file from "file.ts" assert { "type": "typescript" } with { "parser": "js:parse:typescript" } -
…in reply to @rockerest
Or built-in modules wouldn't even be necessary. If the import assertion
"type"is formalized as allowing awithtransformer that can provide a parser, the provided parser can be ANY language that follows some allowed API shape. Presumably, it could also provide the "type". -
…in reply to @rockerest
Or conversely, maybe the assertion is
{"type": "text"}and thewithtransformer allows non-standard syntax parsers. -
…in reply to @rockerest
Granted:
withdoesn't exist yet. I think changing which language you are running via import flags and (developer-provided?) special parsers is better than changing ECMAScript for everyone. This also allows total freedom without locking in the current paradigm.