You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-9Lines changed: 35 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,20 +29,43 @@ Operating System
29
29
30
30
## Quick Start
31
31
32
+
The canonical project-mode structure is demonstrated in `examples/hello-app/`:
33
+
34
+
**examples/hello-app/spore.toml:**
35
+
```toml
36
+
[package]
37
+
name = "hello-app"
38
+
type = "application"
39
+
40
+
[project]
41
+
platform = "cli"
42
+
default-entry = "app"
43
+
44
+
[entries.app]
45
+
path = "main.sp"
46
+
47
+
[capabilities]
48
+
allow = ["Compute"]
49
+
```
50
+
51
+
**examples/hello-app/src/main.sp:**
32
52
```spore
33
-
/// A simple "Hello World" using the basic-cli platform.
34
-
fn main() -> () uses [Console] {
35
-
println("Hello from Spore basic-cli!")
53
+
pub fn main() -> () uses [Console] {
54
+
println("Hello from a project-mode Spore application!")
55
+
return
36
56
}
37
57
```
38
58
59
+
**Run the project:**
39
60
```bash
40
-
spore check examples/hello.sp
41
-
spore build examples/hello.sp
42
-
spore run examples/hello.sp
61
+
cdexamples/hello-app
62
+
spore check src/main.sp
63
+
spore run src/main.sp
43
64
```
44
65
45
-
This repository currently keeps `examples/` limited to files that PR CI validates today.
66
+
This example currently uses the built-in `cli` platform. When custom platform packages are fully supported in the compiler, `basic-cli` will become a loadable platform dependency that applications can declare in `spore.toml` and import modules from (e.g., `import basic_cli.stdout`). Until then, the example demonstrates the project structure and validates that format/check/run work correctly.
67
+
68
+
For quick experiments, you can also run standalone `.sp` files (see `examples/hello.sp`), but production applications should use the project-mode structure above.
46
69
47
70
## Project Structure
48
71
@@ -81,7 +104,8 @@ Applications targeting `basic-cli` must implement the same startup function name
81
104
82
105
## Tutorial Contract
83
106
84
-
-`examples/` is for truthful, CI-validated examples only.
107
+
-`examples/hello-app/` is the **canonical project-mode example** — its structure and format are validated in CI.
108
+
-`examples/hello.sp` is a minimal standalone file for quick experiments (also validated in CI).
85
109
-`src/basic_cli/` is the API surface for the platform modules themselves.
86
110
-`src/platform_contract.sp` is the package-owned startup contract surface.
87
111
- Only add `tests/` when the repo has real Spore-side regression coverage worth running with `spore test`.
@@ -105,7 +129,9 @@ Following Spore's [SEP-0003 (Effect Capability System)](https://github.com/spore
105
129
106
130
🚧 **Early development** — API is unstable and subject to change.
107
131
108
-
At the moment, the validated example is `examples/hello.sp`. More ambitious host-backed demos such as environment/file workflows should stay out of `examples/` until the current platform import/runtime architecture supports them honestly.
132
+
The canonical example is the **project-mode**`examples/hello-app/` application, which demonstrates the standard project structure. It currently uses the built-in `cli` platform and validates successfully with `spore check` and `spore run`. Once custom platform packages are fully supported, applications will be able to declare `basic-cli` as a platform dependency and import its modules directly.
133
+
134
+
The standalone file example (`examples/hello.sp`) demonstrates basic-cli usage for quick experiments. The platform API modules in `src/basic_cli/` define the capability-gated interface that will be available when package imports are enabled.
0 commit comments