Reference

Grammar summary

Normative EBNF-style summary of semantic Point source.

Summary

This page summarizes public semantic syntax. Full normative detail lives in the repository docs/language-spec.md. Internal core syntax (fn, let, type) is not author-facing.

Version: aligned with @hatchingpoint/point@0.2.7.

Program structure

program      ::= moduleDecl? topLevel*
moduleDecl   ::= "module" name
topLevel     ::= record | variant | calculation | rule | label | external | action
               | policy | guard | workflow | pipeline | session | prompt
               | view | page | layout | navigation | route | middleware
               | streamRoute | schedule | command | useDecl
useDecl      ::= "use" modulePath ("from" string)?

Every public file needs at least one substantive top-level declaration.

Types

TypeNotes
Text, Int, Float, Bool, VoidPrimitives
List<T>One type argument
Maybe<T>Optional; none literal
A or BUnion / result
Record nameUser-defined
variantTagged union with on Case dispatch in labels

Block keywords (quick reference)

KeywordRole
recordData shape
variantTagged union
calculationPure function
ruleAccumulation / scoring
labelClassification
externalJS/npm interop
actionAsync effectful op
policyPure guard
guardPipeline file-scope guard
workflowMulti-step async
pipelineAgent multi-step flow
sessionConversational state
promptVersioned template
viewUI component
pageFull page shell
layoutApp shell slots
navigationClient route registry
routeHTTP handler
middlewareHTTP request gate
stream routeWebSocket handler
schedulePeriodic job
commandCLI entry

Naming in emit

Spaced names lower to camelCase. Rule outputs avoid duplicated suffixes (cart total + totalcartTotal).

Agent refs

point://semantic/<Module>/<kind>.<name>
point://semantic/<Module>/record.<Name>/field.<label>

See also