$ cat language.md
The language
Seven keywords carry the language; the rest is ordinary expressions, functions and types.
| keyword | what it is | what the compiler makes of it |
|---|---|---|
model | a stored record type | table, migration, validation |
query | a named question to the store | an optimised query with a typed result |
page | an address with parameters | route, parameter validation, HTML |
view | what the visitor sees | HTML on the server, reactive updates in the browser |
action … on server | something the visitor triggers | an API endpoint plus the call from the browser |
require | a permission rule | a check before the action; without it the action does not compile |
fetch … on error | a call to the outside | timeout, fallback, cache of successes only |
$ cat example.complex
model Artwork {
title: Text
inaugurated: Date~
location: Geo
}
page "/artwork/:id" (id: Id<Artwork>) {
let art = Artwork[id]
view { h1 { art.title } }
action rename(title: Text) on server {
require user.can(edit: art)
art.title = title
}
}$ cat implemented.txt
In version 0.2: model, page, view, components, typed URL parameters, and information flow control. query, action, require and fetch are on the roadmap.