Skip to content

Commit 37c9d24

Browse files
committed
Refine onboarding tutorial and prioritize it in README
1 parent 6875663 commit 37c9d24

2 files changed

Lines changed: 42 additions & 23 deletions

File tree

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,26 @@ FScript currently includes:
3232
- interpolation, pipeline operator, `typeof` type tokens, and `nameof` identifier tokens for host workflows.
3333
- unified brace literals for records/maps (`{ Field = value }`, `{ [key] = value }`, `{}` for empty map), with map keys typed as `string` or `int`.
3434

35-
## Quick Start
35+
## Getting Started Tutorial
36+
37+
If you are new to FScript, start with the progressive tutorial:
38+
39+
- [`docs/getting-started-tutorial.md`](docs/getting-started-tutorial.md)
40+
41+
It covers installation, syntax basics, flow control, collections, pattern matching, stdlib usage, includes, and host/export concepts.
42+
43+
## Installation
44+
45+
### CLI via Homebrew
46+
```bash
47+
brew install magnusopera/tap/fscript
48+
```
49+
50+
### Embeddable language via NuGet
51+
- `MagnusOpera.FScript.Language`
52+
- `MagnusOpera.FScript.Runtime`
53+
54+
## Repository Development
3655

3756
### Build
3857
```bash
@@ -61,17 +80,6 @@ Useful samples:
6180
- [`samples/mutual-recursion.fss`](samples/mutual-recursion.fss)
6281
- [`samples/includes-and-exports.fss`](samples/includes-and-exports.fss)
6382

64-
## Installation
65-
66-
### CLI via Homebrew
67-
```bash
68-
brew install magnusopera/tap/fscript
69-
```
70-
71-
### Embeddable language via NuGet
72-
- `MagnusOpera.FScript.Language`
73-
- `MagnusOpera.FScript.Runtime`
74-
7583
## Interpreter Architecture
7684

7785
The core engine lives in `src/FScript.Language` and runs in four stages:
@@ -110,7 +118,6 @@ See [`docs/sandbox-and-security.md`](docs/sandbox-and-security.md) for the full
110118

111119
## Documentation
112120

113-
- [`docs/getting-started-tutorial.md`](docs/getting-started-tutorial.md)
114121
- [`docs/syntax-and-indentation.md`](docs/syntax-and-indentation.md)
115122
- [`docs/supported-types.md`](docs/supported-types.md)
116123
- [`docs/function-annotations.md`](docs/function-annotations.md)

docs/getting-started-tutorial.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ let describe items =
204204
| _ -> "empty"
205205
```
206206

207+
### Tuple
208+
```fsharp
209+
let describePair pair =
210+
match pair with
211+
| ("ok", code) -> $"success:{code}"
212+
| (kind, code) -> $"{kind}:{code}"
213+
```
214+
207215
### Record
208216
```fsharp
209217
let cityLabel address =
@@ -339,8 +347,11 @@ Notes:
339347
- include cycles are fatal,
340348
- modules are supported in included files.
341349

342-
## 11. Export functions for host integration
343-
Mark top-level bindings with `[<export>]` when a host must discover them.
350+
## 11. Hosting, exports, and sandboxing (advanced)
351+
FScript is designed to be embedded.
352+
At host boundary, scripts can expose explicit entry points while the host controls capabilities and security.
353+
354+
Mark top-level bindings with `[<export>]` when a host must discover them:
344355

345356
```fsharp
346357
[<export>] let dispatch (context: { Command: string }) =
@@ -352,19 +363,20 @@ Mark top-level bindings with `[<export>]` when a host must discover them.
352363
}
353364
```
354365

355-
## 12. Security mindset and Hosting
356-
FScript core evaluation is pure in-memory computation.
357-
Side effects depend on host-exposed functions.
366+
Security/hosting teaser:
367+
- core FScript evaluation is pure in-memory computation,
368+
- side effects exist only through host-exposed externs,
369+
- sandboxing is enforced by host decisions (filesystem root, allowed functions, execution controls).
358370

359-
When embedding:
371+
When embedding, keep this mindset:
360372
- expose only needed externs,
361373
- keep filesystem/network boundaries explicit,
362374
- use host-level timeout/cancellation/resource limits.
363-
- see [`docs/embedding-fscript-language.md`](./embedding-fscript-language.md) for host integration API,
364-
- see [`docs/external-functions.md`](./external-functions.md) for extern design and registration.
365-
- see [`docs/sandbox-and-security.md`](./sandbox-and-security.md) for security model and host responsibilities.
375+
- see [`docs/embedding-fscript-language.md`](./embedding-fscript-language.md) for the embedding API,
376+
- see [`docs/external-functions.md`](./external-functions.md) for extern design/registration,
377+
- see [`docs/sandbox-and-security.md`](./sandbox-and-security.md) for the full security model.
366378

367-
## 13. Next steps
379+
## 12. Next steps
368380
- Sample scripts:
369381
- [`samples/types-showcase.fss`](../samples/types-showcase.fss)
370382
- [`samples/patterns-and-collections.fss`](../samples/patterns-and-collections.fss)

0 commit comments

Comments
 (0)