# kern vs Node.js

> An honest comparison of kern and TypeScript/Node.js. TypeScript has the largest ecosystem. kern catches null escapes and GDPR violations at compile time.

Source: https://kern-lang.eu/compare/node

TypeScript is the current best practice for Node backends. It is a genuine improvement on JavaScript. But null still escapes its type system, GDPR is entirely your problem, and every byte runs through V8.

## Where each platform wins

TypeScript and Node.js have real strengths. kern addresses the gaps they cannot fill.

### TypeScript and Node.js

The largest ecosystem in the world

- Largest package ecosystem: npm has millions of packages
- JavaScript familiarity: frontend and backend in one language
- Real-time applications: WebSocket and event-driven excellence
- Zero-friction deployment on Vercel and Netlify
- TypeScript’s gradual typing is a genuine improvement over JS
- Massive hiring pool: more JS developers than any other language

### kern

True safety, native performance, sovereignty

- Null safety that actually works: no escape hatches in the type system
- GDPR enforcement at compile time: not a TODO in the backlog
- Native compilation: no V8 overhead, no JIT warmup, no GC pauses
- Single binary deployment: no node\_modules, no package.json
- AI native standard library with European providers by default
- European governance: npm is American, the Node.js Foundation is American

## Null still escapes TypeScript

TypeScript improved JavaScript enormously. But null can still slip through the type system and crash at runtime.

#### Null still escapes TypeScript

TypeScript

```
// TypeScript: null still escapes the type system
const user: User | null = getUser()
user.name  // TypeScript allows this: runtime crash if null

// TypeScript: GDPR is entirely your problem
const email = user.email    // just a string: no PersonalData tracking
sendToAnalytics(email)       // compiles fine: GDPR violation
await openai.chat(email)     // compiles fine: GDPR violation + AI data leak
```

kern

```
# kern: null structurally impossible
user: User = get_user()
print(user.name)   # cannot be null: type guarantees it

# kern: GDPR enforced at compile time
check_consent("process", consent)
send(user.email_plain, "Welcome to kern!")  # OK: consent verified
```

#### What happens when you try to leak PII

TypeScript

```
// TypeScript: PII sent to AI model. No error.
const email = user.email  // just a string

// All of these compile and run:
sendToAnalytics(email)          // GDPR violation
await openai.chat(email)        // GDPR violation + AI leak
console.log(`User: ${email}`)  // PII in logs
// Ship to production. Get fined.
```

kern

```
email: PersonalData<str> = user.email

await llm.mistral().complete(prompt: email.value)
# ERROR E0302: PersonalData<str> reaching an AI sink
# without consent
# This is a compile error: it never reaches production
```

## TypeScript/Node vs kern at a glance

__TypeScript/Node vs kern at a glance__
| Feature            | TypeScript / Node.js          | kern                      |
| ------------------ | ----------------------------- | ------------------------- |
| Type safety        | Gradual: escape hatches exist | Enforced                  |
| Null safety        | Null escapes type system      | Structurally impossible   |
| GDPR built in      | No                            | Yes: compile time         |
| Native compilation | No: V8 JIT                    | Yes: native binary        |
| Single binary      | No: node\_modules             | Yes                       |
| Native async       | Yes                           | Yes                       |
| AI native stdlib   | No (npm install)              | Yes                       |
| Container native   | No                            | Yes                       |
| Package registry   | npm (USA / Microsoft)         | pkg.kern-lang.eu (Europe) |
| Governance         | OpenJS Foundation (USA)       | Dutch foundation          |
| Learning curve     | Medium                        | Low                       |
| Error handling     | Exceptions + try/catch        | Values (? operator)       |

## Where does your supply chain live?

Node.js depends on American infrastructure at every level. kern’s entire supply chain is European.

### Node.js

- npm (USA)Package registry owned by Microsoft/GitHub
- OpenJS Foundation (USA)Governed by an American foundation
- GitHub (USA)Source code hosted by Microsoft

### kern

- pkg.kern-lang.euPackage registry on OVH/Scaleway (France)
- Dutch foundationOpen governance under EU foundation
- Codeberg (Germany)Source code on European forge

## Fair question: “European sovereignty is a political argument”

Tell that to the European companies that lost access to their GitHub repositories under bad-faith DMCA claims. Tell it to the teams whose npm dependencies were yanked without notice. Tell it to the public sector organisations whose legal teams have told them to reduce US cloud dependency but cannot because every language’s toolchain runs on American infrastructure. Infrastructure governance is a technical and business risk. It has a cost. kern removes that cost.

## Ready to try kern?

If you want TypeScript’s developer experience without the null escapes, the GDPR blind spots, and the American infrastructure dependency: kern is worth exploring.

[Get started](https://kern-lang.eu/get-started) [Open the playground](https://kern-lang.eu/playground)
