Slim

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 checksRuntime validationData modellingAPI and external dataComponentsToolingPackage manager
JavaScriptNoManualObjects and classesTrust it or validate manuallyNative APIs or a frameworkDepends on the projectNPM
TypeScriptYesManual or librariesInterfaces and typesTypes are erased at runtimeNative APIs or a frameworkDepends on the projectNPM
SlimYes, where possibleBuilt in for typed values and structsStructs, enums, defaults, inheritance, validatorsValidate at the boundary with a struct or typeComponents and custom elementsCompiler, formatter, test runner, REPL, dev server, and package managerNPM, SPM

Not convincing?

Then take a look at what Slim can offer you in terms of data validation against JavaScript

Used by

Real products already building on Slim.

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.