3 ms·
Typechecking JavaScript is feasible. But will be really hard in practice. We have worked for years on the Opa technology, cf. http://opalang.org http://opalang
by hbbio 13y ago
Typechecking JavaScript is feasible. But will be really hard in practice.
We have worked for years on the Opa technology, cf. http://opalang.org http://opalang.org. Opa is a typechecked language with a JS syntax that compiles to JavaScript. Unlike JS though, the semantics of the language borrows to functional programming languages, to ensure the type system is sound and type checking feasible with almost full type inference.
Opa does more than type-checking to JS, but even if you just want to typecheck JS, basically you should look to design and implement a new programming language, with a syntax as close as possible to JS but with proper semantics and then that compiles to JS after type-checking. You could add a set of tools to help port actual JS code to this new language.