Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 12/16/2022 #51966

Closed
DanielRosenwasser opened this issue Dec 19, 2022 · 0 comments
Closed

Design Meeting Notes, 12/16/2022 #51966

DanielRosenwasser opened this issue Dec 19, 2022 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

satisfies in JSDoc

#51753

  • Provides a contextual type in JavaScript without casting or calling a helper function - really nice.
  • It's unfortunate that @type was used as the original name for JSDoc type assertions. @type would have been a better syntax for what satisfies does.
    • Or @cast and @satisfies, and @type just stays on declarations.
  • But if you know you want to use satisfies
  • How should this work?
    • Expression positions the same way @type works seems fine.
    • What about declaration forms? Lots of examples of @type or @param.
      • We would like @satisfies to also work in declaration positions - enforce the assignability check on, and also contextually type, the initializer expression(s?).

Optimizations

  • Nice wins from monomorphizing our object types.
  • What's next?
    • Can still do this for Signature, Type, more.
  • Experimenting with removing the notion of object allocators (our factory for node classes).
  • Slight aside - some difficulties with polymorphism analysis tooling due to esbuild renaming.
  • Fixed shapes for FlowNodes?
    • [experiment] Try using consistent shapes for FlowNodes #51585
    • Should retry once the deopt tooling is available.
    • Also, harder to analyze because they're just object literals.
      • Analysis works better when the allocation site consistently comes from a constructor. (e.g. new Blah(), etc.)
    • We sort of do this with FlowNode
      • But we still set properties after the fact.
  • We ran a deopt analysis on the compiler during the meeting. We saw some interesting things.
    • writeFile is 16% of the time??? (MS Defender????)
    • 600ms on ts namespace - but it has almost no code???
      • const enum preservation?
        • That's nuts.
        • Tradeoff for debuggability.
      • Suspicious.
    • emitFlags is never set, so an |= can't be immediately optimized.
      • We could just set it to 0?
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Dec 19, 2022
@DanielRosenwasser DanielRosenwasser changed the title Design Meeting Notes, 12/19/2022 Design Meeting Notes, 12/16/2022 Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

2 participants