Skip to content

AOT with type hints generated from typescript compiler #812

Closed Answered by bnoordhuis
laishere asked this question in Q&A
Discussion options

You must be logged in to vote

How would quickjs see those type hints? It operates on JS, not TS.

If you mean magic comments, that's basically what this stage 1 type annotations proposal proposes, but they're useless to a JS engine because at runtime they're descriptive, not prescriptive. A function that says it adds two numbers must still be able to handle strings as inputs.

(Also, I don't think that proposal is going anywhere. It's been sitting at stage 1 for years.)

The stage 2 structs proposal is more likely to go places and yield real improvements.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@laishere
Comment options

@bnoordhuis
Comment options

@laishere
Comment options

Answer selected by laishere
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants