rockerest’s avatarrockerest’s Twitter Archive—№ 19,158

    1. What if instead of formalizing TS, the proposal is to allow alternate parsers via a combination of proposal-built-in-modules and proposal-import-assertions?
  1. …in reply to @rockerest
    For example: import file from "file.ts" assert { "type": "typescript" } with { "parser": "js:parse:typescript" }
    1. …in reply to @rockerest
      Or built-in modules wouldn't even be necessary. If the import assertion "type" is formalized as allowing a with transformer 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".
      1. …in reply to @rockerest
        Or conversely, maybe the assertion is {"type": "text"} and the with transformer allows non-standard syntax parsers.
        1. …in reply to @rockerest
          Granted: with doesn'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.