A modern, extensible frontend playground for type inference algorithms available at typ.how. This project serves as a general-purpose frontend that can work with different WebAssembly type inference engines. The default engine is type-inference-zoo-wasm, but you can easily switch to other WASM modules or even private implementations.
- Flexible WASM Integration: Support for multiple type inference engines via WebAssembly
- Configurable Sources: Switch between different WASM modules including private/authenticated sources
- Interactive Playground: Real-time type inference with step-by-step visualization
- Modern UI: Built with React, TypeScript, and Tailwind CSS
- Extensible Architecture: Easy to add new algorithms
Typ.How is designed to work with any compatible WebAssembly type inference engine. By default, it uses type-inference-zoo-wasm, but you can easily configure it to use different engines.
You can add your own WASM engines (clicking the wasm button in the navbar):
- Public WASM Files: Simply provide a URL to your WASM file
- Private/Authenticated Sources: Configure authentication headers or tokens
- Local Development: Upload WASM files directly from your machine, or you can serve your WASM files locally with some HTTP server
Typ.How supports various authentication methods for private WASM sources:
- Bearer Token: Standard OAuth/API token authentication
- Custom Headers: Any custom authentication headers
- Pre-signed URLs: For cloud storage with temporary access
Your WASM engine should implement the following command-line interface:
# Get metadata about available algorithms
wasm-exe --meta
# Run type inference
wasm-exe --typing <algorithm> [--variant <variant>] <expression>
# Run subtyping check
wasm-exe --subtyping <algorithm> [--variant <variant>] <type1> <type2>
The engine should output JSON responses for programmatic consumption.
You can share WASM configurations using subscription URLs. Typ.How supports infer://
URLs (which is just base64-encoded data)
- Node.js 18+
- npm or bun
# Clone the repository
git clone https://github.com/cu1ch3n/typ-how.git
cd typ-how
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview