Applicational Types
Table: scroll horizontally to read all columns.
| Type | What it represents | Current use in L |
|---|---|---|
| App | An application with source, identity and process state. | Construct, build, run, stop and await a separate process; read its Output or Error. |
| Service | A unit of code composed into an App. | Main supplies the entry structure; additional App-constructed Services become libraries. A standalone Service is structural. |
| Class | A group of source modules, Objects and nested Classes. | Organize generated code; no independent process or runtime scope. |
| Object | A source-file unit containing definitions. | Own generated file content; no automatic runtime lifetime. |
| Function | A callable with typed inputs, results and retained captures. | Invoke its descriptive verb with fresh parameters and locals. |
| Attribute | A composed part of an Object. | Internal construction representation; no general source field-construction API. |
| Definition | The implementation attached to a constructed element. | Internal representation used by source and logeme-backed definitions; no general standalone constructor. |
| Property | Field or parameter information. | Internal/native representation; reading a member does not construct a Property. |
| Operation | A structured native operation. | Internal/native representation; source actions are defined as words. |
Only Apps own process lifecycle. Internal categories do not imply source constructors. Lexical Types explains the words that express these structures.
Create and execute an App
Section titled “Create and execute an App”Use IO's Print from `io` as "Print".
"message" is `Hello World!`.Create "Hello" as a New Basic App.The App Prints message.Execute Hello.Show Hello's Output.Complete program. Source: demo/basic/main.l.
Example evidence
Canonical Hello World App with explicit IO.Print import and finalized output. existing-witness-not-run. Evidence guide.
New Basic App constructs a Main Service, Object and entry Function. The App Prints message supplies its child-process body; Execute Hello builds, runs and awaits it. Show displays finalized stdout: Hello World! and one newline.
l build publishes the native program; running that program performs its lifecycle actions. Aliases preserve App identity. Separate declarations remain separate Apps even if they use the same name in different private scopes.
Services
Section titled “Services”Basic supplies the primary Main Service. Additional Services constructed inside an App become native libraries whose nonprivate composed items form their interface. The Service composition example builds Main, Left and Right Services inside an App and explains how the body is passed into them.
A standalone Service declaration creates no package or process. Standalone body effects, native lifecycle operations and implicit Output/Error reject; explicit static members and source-defined actions still use normal lexical lookup. See the Service composition contract.
Classes and Objects
Section titled “Classes and Objects”Classes group modules and source files; Objects own files. Neither introduces a paragraph scope or process lifetime. Nested Classes retain explicit parents and source order. Native imports and visibility belong to their owning file/module; Class metadata does not silently become every child's default.
Compose an Object inside nested Classes
Section titled “Compose an Object inside nested Classes”"Leaf" describes a Generic `leaf` Class with a New Main Object using any Process."Middle" describes a Generic `middle` Class with a New Leaf Class using any Process."Outer" describes a Generic `outer` Class with a New Middle Class using any Process."Grouped" describes a Generic `main` Service with a New Outer Class using any Process."Tree" describes a Generic App with a New Grouped Service using any Process.Create "Recursive" as a New Tree App.Compile-only example. Source: lyger/test/classes/recursive.l.
Example evidence
Complete nested Class and Object construction. TestFrontendRecursiveClassSource checks generated structure and native compilation, not execution. existing-witness-not-run. Evidence guide.
Read descriptors inside out: Leaf supplies the Main Object; Middle and Outer enclose it; Grouped adds the Service; Tree adds the App. Applying Tree produces Recursive → Service main → Class outer → Class middle → Class leaf → Object main, which owns the entry Function. Construction alone performs no lifecycle action.
Attributes and Definitions
Section titled “Attributes and Definitions”A Function composed inside an Object is represented as an Attribute containing a Definition. Adjective descriptors and named definitions express this structure; these categories add no field syntax or interchangeable constructors.
Functions, Properties, and Operations
Section titled “Functions, Properties, and Operations”A Function declaration also defines its invocation verb. Its encapsulated paragraph supplies the body:
Publicly create "Echo|-es|-ed|-ing|-er" as a New Function with Inputs of "Value" as Text and Outputs of Text.Return Value.
Echo `hello` as "Result".Show Result.Four leading spaces begin the private body; a blank line ends it. Public exposes Echo, not Value. The label supplies ordinary verb inflections. A member word can form a sentence such as The User walks to the Store: User selects its Walk definition and Store supplies the Location argument. See word forms.
Invocations check ordered types and have fresh locals. Function signatures include canonical constructor identity; incompatible constructors reject, including boxed values. Copies and aliases retain signatures and captures. Every continuing result-bearing path must Return through its bound member; Exit terminates the program.
The header retains surrounding conditions and coordinated effects. Captures must be assigned when it executes; ordinary values snapshot and explicit Pointers share targets. An invocation assigns its explicit results, without inferring assignment from side effects. A Function may Await an App and its continuation. Dictionary/Class units have no executable initialization phase.
Source declarations and Object construction use the same selected Function/logeme definitions. Rust checks the generated signatures and lifetimes; no user-written Rust lifetime parameters, overloads, variadic signatures or inference across opaque native bodies are implied.
Construct a Function in an Object
Section titled “Construct a Function in an Object”"First" is a New Adjective describing any Object or Function.It describes a Generic `first` Function of any Process with No Inputs and No Outputs.It describes a Generic `first` Object with a New Objective First Function using any Process.Fragment. Source: lyger/test/classes/interleaved.l (lines 1–3).
Example evidence
First descriptor from the complete interleaved-Class compilation witness; excerpt is not independently executable. existing-witness-not-run. Evidence guide.
first has No Inputs and No Outputs; any Process receives its body. Objective First supplies the Object, which the complete fixture composes into a Class and App.
Worker's Output selects an App member after Await; it does not create a Property record. Native Func, Prop and Op metadata have separate logeme contracts. To name a sequence of source actions, define a verb such as Launch; this does not construct an internal Operation.
Sources and witnesses
Section titled “Sources and witnesses”See application structures, type recognition, construction, builtins, workspace projection, recursive-Class tests, and Service coverage.
Canonical source: docs/spec/applicational-types.md.