Expressive static types and invariant checks for JavaScript.
Browse cluster: Cluster 71 →Forall.js is a JavaScript library that provides expressive static type checking and invariant verification by using probabilistic correctness rather than classical logical type-checking. It enables developers to specify precise types (such as hex-encoded strings with an even number of characters) and program invariants (such as ensuring a purchase function never produces negative balances), then checks these constraints at compile time by inspecting random samples of the code's behavior. Built on top of vanilla JavaScript and Node.js with no additional compilation step required, Forall.js aims to combine the expressivity of languages like Idris with the ease of use of TypeScript, effectively merging a type system with automated testing.