Hello world
A Lithe file is a contract. It declares its persistent state as one storage record and exposes external functions.
hello-world.lithe
(* A file is a contract. Its persistent state is one record. *)
storage is record {
greeting : string;
}
external function setGreeting(const greeting : string) is {
storage.greeting := greeting;
}
external view function greeting() : string is
storage.greeting
external pure function hello() : string is
"Hello, world!"storage.greetingis the only way to reach the stored field. Storage access is always qualified.external viewfunctions read state, andexternal purefunctions read nothing but their arguments. The compiler checks both.- A function body can be a single expression, as in
greetingandhello, or a block{ ... }.

