Source on Codeberg (opens in a new tab)

Playground

Ctrl+Enter
user_service.kern

Tab indents. Press Escape, then Tab, to leave the editor. Ctrl+Enter runs the example.

OutputSimulated · kern v1.2.0
Compiling user_service.kern...
error[E0302]: PersonalData<str> cannot reach a sink that does not declare PersonalData
--> user_service.kern:13:21
|
13 | analytics.track(user.email.value)
| ^^^^^^^^^^^^^^^^ direct access to PersonalData is forbidden
|
= help: use check_consent() to validate a lawful basis before processing
= note: GDPR Article 6 requires a valid legal basis for processing personal data
error[E0302]: PersonalData<str> cannot reach a sink that does not declare PersonalData
--> user_service.kern:14:32
|
14 | log.info("Tracked user: {user.name.value}")
| ^^^^^^^^^^^^^^^ PersonalData cannot be interpolated into logs
|
= help: personal data must never be written to logs (GDPR Art. 25, data minimisation)
error: aborting due to 2 previous errors

Want to run kern for real?

Install kern, or browse the source on Codeberg.

curl -fsSL https://kern-lang.eu/install.sh | sh