FAQ and limits
Is Cresset ready for real work?
Not yet. It is version 0.2: a working language with a large test suite, built to prove an idea. It is a real foundation, but it is an interpreter (so slower than compiled languages), it has no shared public registry or community of packages yet, and it is missing things you would expect. Use it to learn, to experiment, and to see whether the idea of effect-checked code appeals to you.
Why another language?
Because of one question: how do you safely run code you didn't write? Code from the internet, from a teammate, or from an AI assistant can usually do anything on your computer. Cresset makes what code is allowed to touch a visible, enforced part of the language, so you can see it and limit it.
What is built
- Effect checking, both before the run and during it
- A package registry you can run yourself (
cresset publish,install,search), with hashes and permissions shown before install - Real network access with
fetchandpost(behind thenetworkpermission, recorded and replayed like every effect) - Permissions you grant per run and per package
- Record and replay
- Gradual static types with optional annotations
- Records, enums and exhaustive
match, shareable between packages - Errors as values,
?, and contracts - A formatter (
cresset fmt) and a VS Code extension (highlighting, errors as you type, snippets) - A local redaction tool
- A website with a browser playground
What is not built yet
- A shared public registry, accounts, and automatic version solving (you can run your own registry folder; packages can depend on packages at pinned versions)
- Network access beyond simple GET and POST (headers, other methods, streaming), and network access inside the browser playground
- Inheritance, interfaces and traits (records have methods, but no shared behavior between record types)
- Structured concurrency
- Compiling to a fast, single native program
- Editors other than VS Code. (VS Code gets errors as you type, completion, hover, go to definition, an outline, formatting, highlighting and snippets.)
- Types for functions, and generics
Sharp edges you should know about
These are honest rough spots in 0.2:
- A function can't change top-level variables. It can read them, but assigning inside a function makes a new local, and
+=on an outside variable is an error. This is on purpose, but it differs from some languages. - Annotations are not enforced while the program runs. They are checked before it runs. See Types.
- Numbers are floating point.
0.1 + 0.2is not exactly0.3, as in many languages. - Multi-line text can't contain its own closing quotes (
"""or'''), and single-quoted'...'text stays on one line. - Very deep recursion stops at 800 calls with an error.
- It is a simple interpreter. On the development machine,
fib(24)runs in about 20 ms and a loop of a million steps in about 0.06 s (runnode tools/bench.jsto measure your own). That is fine for scripts and tools, but heavy number crunching will be slow, and it is not a replacement for a compiled language. - Effects of a function passed in as a parameter aren't tracked inside the receiving function. The rule that mentioning an effectful function requires declaring it covers your own code, and packages have a runtime cap. See Effects.
Does the redaction tool make AI private?
No. It reduces what you expose by swapping secrets for placeholders before you share text. It cannot control what a service does with what it receives. Read the limits before you rely on it, and follow your workplace's rules.
How do I report a problem or suggest something?
This is an early project. For now, keep a note of what you ran and the exact error, and bring it to whoever maintains your copy of Cresset.
Where is it going?
Roughly in this order: namespaced package types, a package registry with versions and checksums, real network access, a faster implementation, and an editor experience. A dialect aimed at game logic is also planned.