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
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ basic-cli = { path = "../.." }
55
55
import basic_cli.stdout as stdout
56
56
57
57
fn main() -> () uses [Console] {
58
-
println("Hello from a project-mode Spore application!")
58
+
println("Hello from a project-mode Spore application!");
59
59
return
60
60
}
61
61
```
@@ -67,9 +67,9 @@ spore check src/main.sp
67
67
spore run src/main.sp
68
68
```
69
69
70
-
This is a real package-backed application. The in-repo example points `basic-cli` at `../..`; projects generated by `spore new` vendor the package and use `vendor/basic-cli` instead. The formatter currently normalizes the import to `import basic_cli.stdout as stdout`, while `println` still resolves directly in scope.
70
+
This is a real package-backed application. The in-repo example points `basic-cli` at `../..`; projects generated by `spore new` vendor the package and use `vendor/basic-cli` instead. The formatter currently normalizes the import to `import basic_cli.stdout as stdout`, while `println` still resolves directly in scope as an imported platform API call.
71
71
72
-
For quick experiments, you can also run standalone `.sp` files (see `examples/hello.sp`), but production applications should use the project-mode structure above.
72
+
For quick experiments, you can also run pure standalone `.sp` files (see `examples/hello.sp`), but production applications that call platform APIs such as `println` should use the project-mode structure above.
73
73
74
74
## Project Structure
75
75
@@ -90,7 +90,7 @@ basic-cli/
90
90
│ ├── Cargo.toml
91
91
│ └── src/
92
92
│ └── lib.rs # Foreign function implementations
93
-
└── examples/ # Canonical examples that format/check/build in CI
93
+
└── examples/ # Canonical examples that format/check/run in CI
94
94
```
95
95
96
96
## Contract Surface (MVP)
@@ -108,18 +108,35 @@ Applications targeting `basic-cli` must implement the same startup function name
108
108
109
109
## Tutorial Contract
110
110
111
-
-`examples/hello-app/` is the **canonical project-mode example** — it is formatted, checked, built, and run in CI.
112
-
-`examples/hello.sp` is a minimal standalone file for quick experiments.
111
+
-`examples/hello-app/` is the **canonical project-mode example** — it is formatted, checked, and run in CI.
112
+
-`examples/hello.sp` is a minimal pure standalone file for quick experiments — it is formatted, checked, and run in CI.
113
113
-`src/basic_cli/` is the API surface for the platform modules themselves.
114
114
-`src/platform_contract.sp` is the package-owned startup contract surface.
115
115
- Only add `tests/` when the repo has real Spore-side regression coverage worth running with `spore test`.
116
116
117
117
If you want to add a new tutorial/example, treat this as the bar:
118
118
119
119
1. keep it self-contained;
120
-
2. make sure it passes `spore format --check`, `spore check`, and `spore build`;
120
+
2. make sure it passes `spore format --check`, `spore check`, and `spore run`;
121
121
3. only then promote it into `examples/` and mention it in this README.
122
122
123
+
Native `spore build` is still useful for platform API modules and pure standalone files, but it is not required for package-backed platform projects that rely on `foreign fn` declarations until the backend supports foreign/platform lowering.
In this style, the `uses [Console]` clause records the capability required by the direct `println` platform API call. The lower-level `perform Effect.op(...)` form belongs to effect-handler syntax; use it only when documenting or implementing explicit handlers, not for the normal `basic-cli` project-mode tutorial path.
139
+
123
140
## Design Philosophy
124
141
125
142
Following Spore's [SEP-0003 (Effect System)](https://github.com/spore-lang/spore-evolution/blob/main/seps/SEP-0003-effect-system.md):
@@ -135,7 +152,7 @@ Following Spore's [SEP-0003 (Effect System)](https://github.com/spore-lang/spore
135
152
136
153
The canonical example is the **package-backed project-mode**`examples/hello-app/` application. It already validates and runs with `[project].platform = "basic-cli"`, an in-repo path dependency, and `import basic_cli.stdout`.
137
154
138
-
The standalone file example (`examples/hello.sp`) stays around for quick experiments. The main remaining platform gaps are generic handled-effects enforcement, startup `spec` stacking, and lifting the runtime from its current explicit `basic-cli` host profile to a more general package-backed mechanism.
155
+
The pure standalone file example (`examples/hello.sp`) stays around for quick experiments. The main remaining platform gaps are generic handled-effects enforcement, startup `spec` stacking, native lowering for `foreign fn` platform projects, and lifting the runtime from its current explicit `basic-cli` host profile to a more general package-backed mechanism.
0 commit comments