Apps and Services
Apps own executable processes. Services compose code within Apps; Classes group modules and Objects represent files.
Begin with a Basic App
Section titled “Begin with a Basic App”New Basic App supplies a Main Service and its entry composition. The App Prints ... adds child-process work. Run/Await and output handling belong to the enclosing program or its continuation; native lifecycle operations in App bodies are unsupported.
Run an App
Section titled “Run an App”Use IO's Print from `io` as "Print".Create "Worker" as a New Basic App.The App Prints `work completed`.Run Worker.Await Worker.Show Worker's Output.Complete program. Source: cmd/l/test/runnable_service/canonical-io.l.
Example evidence
Basic App with canonical IO.Print and explicit Run/Await/Output. existing-witness-not-run. Evidence guide.
Run launches Worker, Await joins its finalized capture, and Show reads Output. Expected stdout is work completed\n; CLI and native witnesses retain that assertion.
Service composition
Section titled “Service composition”The workspace fixture constructs additional Services through descriptors. This excerpt requires its preceding IO.Print import:
"Left" is a New Adjective describing any Service, Object, or Function.It describes a Generic `left` Function of any Process with No Inputs and No Outputs.It describes a Generic `left` Object with a New Objective Left Function using any Process.It describes a Generic `left` Service with a New Left Object using any Process."Right" is a New Adjective describing any Service, Object, or Function.It describes a Generic `right` Function of any Process with No Inputs and No Outputs.It describes a Generic `right` Object with a New Objective Right Function using any Process.It describes a Generic `right` Service with a New Right Object using any Process."Grouped" describes a Generic App with a New Main Service, New Left Service, and New Right Service using any Process.Create "First" as a New Grouped App.The App Prints `first-service-body`.Fragment. Source: lyger/test/workspace/services.l (lines 2–12).
Example evidence
Left/Right Service descriptors and a Grouped App construction from the maintained workspace fixture; requires the preceding IO.Print import and omits the second App. existing-witness-not-run. Evidence guide.
Left and Right each construct a Function inside an Object inside a Service. Grouped constructs an App containing Main, Left and Right Services; Create applies it to First. Main supplies the executable entry; Left and Right become separate libraries. using any Process passes the App's body composition into those constructions.
The workspace test compiles the two Apps in the complete fixture, four additional libraries and a native library caller. Nonprivate composed items form the libraries' native interface.
A standalone New Main Service remains structural: it creates no package or process. Its body effects, native Build/Run/Stop/Await and implicit Output/Error reject; it has no App continuation. Explicit members and source-defined actions retain lexical meaning. This does not provide arbitrary linking of standalone Services or an in-process Service lifecycle.
Organize code without inventing lifetimes
Section titled “Organize code without inventing lifetimes”Classes and Objects have no running lifetime. Source topology separates App executable crates from constructed Service libraries; published App generations retain version-1 manifests.
See Service coverage, then lifecycle and output.
Canonical source: docs/guide/apps-and-services.md.