How Cresset compares

Cresset is young and these comparisons are meant to be fair, including where other tools are the better choice. If something here is wrong, please say so.

The idea in one sentence

Most languages let any code run anything. Cresset makes what each function may touch part of its signature, checked before the program runs and again while it runs, and lets you hand each imported package only the permissions it needs.

Permissions in other tools

Where permissions are decidedGranularity
Python, JavaScript (browser aside), Ruby, Go, RustNowhere: any code you run can usually read files, use the network and run programsNone. You trust everything you import
Node.js permission modelOne set of flags for the whole process, such as which folders may be readThe whole process, including every package you load
DenoFlags like --allow-read and --allow-net, optionally limited to certain paths and hostsThe whole process: a dependency you import gets whatever the program was granted
Browser extensions, mobile appsA manifest the user approvesOne app or extension at a time
CressetIn each function's needs list, and on each use line for a packageOne function, one package

The difference that matters is the last column. With a process-wide flag, giving your program --allow-net because your code needs the network also gives it to every library you depend on. In Cresset, a package gets only what you write on its use line, and a package can never pass on more than it received.

Effect systems in other languages

Cresset's idea has a long history, and the languages that explore it go further than Cresset does:

If you want to explore effect systems seriously, those are worth your time. Cresset's bet is narrower: that a small, fixed, enforced permission list is enough to be useful and easy to learn.

What you get that others don't (today)

What you give up (today)

Be honest with yourself about these before choosing Cresset for anything that matters:

When Cresset is a good fit

When it isn't

Next

The honest list of what is missing: FAQ and limits.