A better JavaScript
Slim extends JavaScript with runtime types, structs, operators, and components, compiling to plain
Why should I use Slim?
Slim is for projects where data validation needs to stay in the running program. It compiles to JavaScript && works directly with npm packages && the JavaScript ecosystem.
Language Comparison: JavaScript, TypeScript and Slim
| Static checks | Runtime validation | Data modelling | API and external data | Components | Tooling | Package manager | |
|---|---|---|---|---|---|---|---|
| JavaScript | No | Manual | Objects and classes | Trust it or validate manually | Native APIs or a framework | Depends on the project | NPM |
| TypeScript | Yes | Manual or libraries | Interfaces and types | Types are erased at runtime | Native APIs or a framework | Depends on the project | NPM |
| Slim | Yes, where possible | Built in for typed values and structs | Structs, enums, defaults, inheritance, validators | Validate at the boundary with a struct or type | Components and custom elements | Compiler, formatter, test runner, REPL, dev server, and package manager | NPM, SPM |
Not convincing?
Then take a look at what Slim can offer you in terms of data validation against JavaScript
FAQ
Short answers to the questions people ask before they try Slim.
Is Slim production-ready?
Slim is young, so treat it as early-stage. It compiles to plain, readable JavaScript you can inspect, ship, or walk away from at any point — trying it on a real project stays low-risk while the language matures.
How is it different from TypeScript?
TypeScript checks types while you edit, then erases them when it compiles — nothing guards your data once the program runs. Slim keeps types in the running program: typed values, structs, enums, validators are enforced at runtime, not only in the editor.
Can I keep using my npm packages?
Yes. Slim compiles to standard JavaScript, so the npm ecosystem works unchanged. You can bring Slim into a project you already have, one file at a time.
Do I have to replace my tooling?
No. Slim ships its own compiler, formatter, test runner, REPL, dev server, package manager — yet the output is ordinary JS, so your bundler, runtime, or CI keeps working exactly as before.
What does Slim add on top of JavaScript?
Runtime types, structs with validators, enums, custom operators, components with custom elements — the pieces you normally bolt on with libraries, built into the language instead.
Where do I start?
Head to the source repository to grab Slim, browse real code, follow the setup notes. A guided install walkthrough is on the way.