Skip to content

Design Meeting Notes, 11/9/2022 #51809

Closed
Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Post-Modules Follow-up

Semantic Lints

#51456

  • The last semantic rules we have are few.
  • Getting rid of all semantic rules would speed our lint time up a lot.
  • No unnecessary assertions takes up a decent amount of time - but it seems arguably good to have.
    • Getting rid of assertions over time helps improve quality of the code.
    • Switching to rely on narrowing is better because assertions left alone can get stale. Then future changes to a type may be masked by the stale assertion.
  • Maybe we should have "no unnecessary assertions" in the compiler itself?
  • What does it mean to be "unnecessary"?
    • Lint rule says "textually identical".
    • User could be thinking "up-casts".
    • We could make it better with our view of structurally identical.
      • Could see this as a --strict rule; however, as we start to think about "what is slow to run", it is hard to imagine more modes where we say "do more checking for the 99% of cases where this will succeed".
      • Though identity is usually pretty fast.
  • Why is this so important?
    • Linting in the editor is slow with semantic rules.
  • Conclusion?
    • Revisit.

Remove ts.Map and ts.Set

#51439

  • Objections?
    • None.

Bundle Splitting our Executables

#51440

  • tsc.js and tsserver.js are not usefully importable - can switch those into ESM if we want!
  • Why?
    • esbuild (our new bundler) makes it easy to do bundle splitting if your output target is ESM.
  • If we ship tsc.js and tsserver.js as CJS wrappers that invoke import("tsc.mjs") and import("tsserver.mjs"), both tsc.mjs and tsserver.mjs can share lots of the same guts.
  • Shaves off 7MB from our package size.
  • Feels like it may be difficult to work with over time, has caveats.
  • Have to drop Node 10 support.
  • Feels like an "uncomfortable yes"

Diagnosing Expensive Types

  • People often ask how to "debug" types - especially types that are expensive.
  • There's types that "pull" on a thread that goes deep in its own self-instantiation, and then there's types that are kind of "executable", that cause a lot of work to be done.
  • Today we have instantiation limiters
    • Depth limiters - how deep instantiation is going (kind of like a call stack)
    • Type creation limiters - how many instantiations of any type has occurred during instantiations.
  • These are hard limits - "blunt force instruments" - that cause an error; but we don't tell tell you about types that get close to those limits.
  • What if we had --typeDiagnostics that could provide a table of the most expensive types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions