3 ms·
I'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 ru
by Schampu 9y ago
I'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/ https://maierfelix.github.io/Iroh/examples/type-checking/
JavaScript -> Flow conversion:
https://maierfelix.github.io/Iroh/examples/auto-flow-types/ 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/ https://maierfelix.github.io/src2game/
- dgolds 9y agoWow, That's some pretty interesting stuff you have there.
- jw- 9y agoReally interesting stuff! I tried out some higher-order examples: INPUT >>> function add(f, b) { return f(b); }; let a = add(function(x) {return x + 1}, 3); OUTPUT >>> function add(f: function, b: number): number { return f(b); }; let a: number = add(function(x: number): number {return x + 1}, 3); and I noticed that the flow type annotations are added to the call site, rather than on the argument f in the definition of add. Are all the types that you generate first order?