Language Reference

What v1 Does Not Do

The features Psy deliberately lacks, and what each absence buys.

For v1, Psy explicitly does not have:

  • methods
  • functions
  • loops
  • conditionals
  • generics
  • arbitrary runtime execution
  • circular dependencies
  • user-defined operators
  • dynamic evaluation

Psy is not a general-purpose programming language, and this list is not a roadmap. These are not omissions waiting to be filled in — they are what buys the properties Psy exists for.

Why each one is absent

Non-goalReason
methods, functionsa spec is a value structure, not an object with behaviour
loops, conditionalsevery value must be resolvable by inspection, not by execution
genericsthe type grammar exists only to state abstract contracts; T[] and T? cover it
runtime executiontooling must never have to run your configuration to understand it
circular dependenciescycles make provenance and determinism unstatable
user-defined operators+ and ++ have fixed meanings per value kind; that is what makes them explainable
dynamic evaluationthe same reason as runtime execution

What you get instead

  • Every value can be resolved statically.
  • Every resolved value can explain itself.
  • Compiler output is deterministic and safe to commit.
  • The formatter is a fixed point.
  • A framework can validate and generate without re-parsing anything.

Each of those depends on the whole list above. Add loops and the first one goes. Add cycles and the second one goes. They are not independent.

Things that look like exceptions

Framework declaration keywords extend the vocabulary, never the grammar. skill Foo: is exactly spec Foo extends Skill:; the parser learns nothing new and could not tell you which keywords exist.

psy.config.ts is TypeScript, but it can only choose sources, outputs, frameworks, adapters, formatting and lint settings. It cannot inject symbols, activate keywords or change semantics.

Frameworks are TypeScript, but they consume resolved IR and a diagnostic sink. They cannot alter parsing or resolution, and there is no API through which they could try.

Composition is not arithmetic

Worth repeating because it looks like arithmetic every single time.

+ means composition. + on two numbers is an error (PSY4002), not addition. There is no arithmetic in Psy at all — not addition, not concatenation of numbers, nothing. If you need a computed value, compute it before it reaches your configuration.

On this page