Runtime type information for JavaScript
medium.com
Runtime type information for JavaScript
1–10 of 16 posts
Re: Runtime type information for JavaScript
#2Or a linter could give optimization recommendations: "Warning: Function deoptimized at runtime because in 2% of calls to this function parameter x is an object."
Re: Runtime type information for JavaScript
#3Cool! I've been wanting something like this for a long time for IDE-suggested type annotations. "From test execution it looks like parameters x and y are always numbers. Add type annotations automatically?" Or a linter could give optimization recommendations: "Warning: Function deoptimized at runtime because in 2% of calls to this function parameter x is an object."
Re: Runtime type information for JavaScript
#4Runtime type checking: https://maierfelix.github.io/Iroh/examples/type-checking/
JavaScript -> Flow conversion: https://maierfelix.github.io/Iroh/examples/auto-flow-types/
It's also possible to turn the runtime control-flow of running JavaScript into a playable game: https://maierfelix.github.io/src2game/
Re: Runtime type information for JavaScript
#5Re: Runtime type information for JavaScript
#6Cool! I've been wanting something like this for a long time for IDE-suggested type annotations. "From test execution it looks like parameters x and y are always numbers. Add type annotations automatically?" Or a linter could give optimization recommendations: "Warning: Function deoptimized at runtime because in 2% of calls to this function parameter x is an object."
Re: Runtime type information for JavaScript
#7It is less powerful than inferring types, and won't help I think from an IDE perspective, except in the edge case of refining types that are too broad; but it will be based on one execution path.
Re: Runtime type information for JavaScript
#8Cool! I've been wanting something like this for a long time for IDE-suggested type annotations. "From test execution it looks like parameters x and y are always numbers. Add type annotations automatically?" Or a linter could give optimization recommendations: "Warning: Function deoptimized at runtime because in 2% of calls to this function parameter x is an object."
Re: Runtime type information for JavaScript
#9I've recently worked on something similar, which uses dynamic analysis to be able to collect type informations and many other data which is only available at runtime. Runtime type checking: https://maierfelix.github.io/Iroh/examples/type-checking/ JavaScript -> Flow conversion: https://maierfelix.github.io/Iroh/examples/auto-flow-types/ It's also possible to turn the runtime control-flow of running JavaScript into a…
Re: Runtime type information for JavaScript
#10Being able to auto generate Typescript definitions is exciting