Semantic Primitives- TypeScript types that understand natural language
Semantic Primitives- TypeScript types that understand natural language
Weekend project exploring what TypeScript looks like when small, fast LLMs are cheap enough to embed at the type level. // Parse natural language await SemanticNumber.from("about a dozen") // 12 await SemanticDate.from("next Monday") // 2025-02-03 await SemanticBoolean.from("yeah I guess so") // true, confidence: 0.7 // Classify and validate with plain English await message.classify(['question', 'complaint', 'feedback', 'request']) await input.validate(["must be valid email", "must not contain profanity"]) // Context-aware operations SemanticNumber.from(150).isReasonable("human age") // { reasonable: false, explanation: "Human age rarely exceeds 120" } // Same error, different audiences error.explain("end-user") // "We couldn't connect. Check your internet." error.explain("developer") // "ECONNREFUSED on port 5432..." 15+ types: boolean, number, string, array, date, error, URL, promise, map, set, etc. Alpha—feedback welcome on what feels useful vs gimmicky. https://github.com/elicollinson/semantic-primitives
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Incorrect prediction on native model
Similar products
Semantic Versioning for Natural Language
A C-style language interpreter implemented by the TypeScript types
Nullable Types in TypeScript
Natural Language Querying
Show HN - Personal Knowledge Store with Natural Language Semantic Search
Brainfuck interpreter using TypeScript types
Wit – Natural language for your app
AI Anime Finder – Natural language semantic search for AniList
The TypeScript Semantic Layer for ClickHouse
TySON – TypeScript as a Configuration Language