plainscript-lang 1.0.3-beta → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +97 -120
  2. package/compiler/bundler.js +83 -12
  3. package/compiler/cli.js +62 -11
  4. package/compiler/dependency-detector.js +11 -0
  5. package/compiler/generator.js +280 -15
  6. package/compiler/lexer.js +2 -0
  7. package/compiler/parser.js +410 -28
  8. package/compiler/sourcemap.js +142 -0
  9. package/compiler/version.js +1 -1
  10. package/docs/CAPABILITY_GAP_AUDIT.md +17 -15
  11. package/docs/PLAINSCRIPT-SPEC.md +41 -39
  12. package/docs/index.html +60 -33
  13. package/docs/website/script.js +168 -19
  14. package/docs/website/style.css +187 -41
  15. package/examples/ai-providers.pln +1 -1
  16. package/examples/arrays.pln +1 -1
  17. package/examples/async-errors.pln +1 -1
  18. package/examples/auth-api.pln +1 -1
  19. package/examples/auth-sessions.pln +1 -1
  20. package/examples/basics.pln +1 -1
  21. package/examples/bots.pln +1 -1
  22. package/examples/cache-and-jobs.pln +1 -1
  23. package/examples/cache-schedule.pln +1 -1
  24. package/examples/collections.pln +1 -1
  25. package/examples/concurrency.pln +1 -1
  26. package/examples/conditions.pln +1 -1
  27. package/examples/database.pln +1 -1
  28. package/examples/day2.pln +1 -1
  29. package/examples/day3.pln +1 -1
  30. package/examples/deployment.pln +1 -1
  31. package/examples/email-send.pln +1 -1
  32. package/examples/error-handling.pln +1 -1
  33. package/examples/expressions.pln +1 -1
  34. package/examples/file-uploads.pln +1 -1
  35. package/examples/files-and-config.pln +1 -1
  36. package/examples/files.pln +1 -1
  37. package/examples/football-backend/app.pln +1 -1
  38. package/examples/functions.pln +1 -1
  39. package/examples/hello.pln +1 -1
  40. package/examples/http-client.pln +1 -1
  41. package/examples/http.pln +1 -1
  42. package/examples/id-verification/app.pln +1 -1
  43. package/examples/json.pln +1 -1
  44. package/examples/loops.pln +1 -1
  45. package/examples/modules/app.pln +1 -1
  46. package/examples/modules/main.pln +1 -1
  47. package/examples/modules/math.pln +1 -1
  48. package/examples/mongo.pln +33 -0
  49. package/examples/objects.pln +1 -1
  50. package/examples/ocr.pln +1 -1
  51. package/examples/packages.pln +1 -1
  52. package/examples/record-kinds.pln +1 -1
  53. package/examples/records.pln +1 -1
  54. package/examples/rest-api-fetch.pln +1 -1
  55. package/examples/rest-api.pln +1 -1
  56. package/examples/scheduled-tasks.pln +1 -1
  57. package/examples/search-and-filter.pln +1 -1
  58. package/examples/server.pln +1 -1
  59. package/examples/sessions-and-cookies.pln +1 -1
  60. package/examples/sqlite.pln +1 -1
  61. package/examples/start.pln +1 -1
  62. package/examples/stdlib.pln +1 -1
  63. package/examples/string-verbs.pln +16 -0
  64. package/examples/telegram-ai-bot.pln +1 -1
  65. package/examples/telegram-bot.pln +1 -1
  66. package/examples/testing.pln +1 -1
  67. package/examples/web-api.pln +1 -1
  68. package/examples/web-app.pln +1 -1
  69. package/examples/websocket-server.pln +1 -1
  70. package/examples/websocket.pln +1 -1
  71. package/examples/whatsapp-bot/pairing.pln +1 -1
  72. package/examples/whatsapp-bot/qr.pln +1 -1
  73. package/package.json +3 -2
@@ -0,0 +1,142 @@
1
+ // SourceMap: V3 Source Map generator for PlainScript compiler.
2
+ // Zero external dependencies — implements VLQ Base64 encoding.
3
+
4
+ const BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
5
+
6
+ function encodeVlq(value) {
7
+ let vlq = value < 0 ? ((-value) << 1) | 1 : (value << 1);
8
+ let encoded = '';
9
+ do {
10
+ let digit = vlq & 31;
11
+ vlq >>>= 5;
12
+ if (vlq > 0) {
13
+ digit |= 32;
14
+ }
15
+ encoded += BASE64_CHARS[digit];
16
+ } while (vlq > 0);
17
+ return encoded;
18
+ }
19
+
20
+ function decodeVlq(str, state = { index: 0 }) {
21
+ let result = 0;
22
+ let shift = 0;
23
+ let continuation = true;
24
+ while (continuation && state.index < str.length) {
25
+ const char = str[state.index++];
26
+ const digit = BASE64_CHARS.indexOf(char);
27
+ if (digit === -1) throw new Error(`Invalid Base64 character: ${char}`);
28
+ continuation = (digit & 32) !== 0;
29
+ result += (digit & 31) << shift;
30
+ shift += 5;
31
+ }
32
+ const isNegative = (result & 1) === 1;
33
+ const value = result >> 1;
34
+ return isNegative ? -value : value;
35
+ }
36
+
37
+ class SourceMapGenerator {
38
+ constructor(options = {}) {
39
+ this.file = options.file || '';
40
+ this.sourceRoot = options.sourceRoot || '';
41
+ this.sources = [];
42
+ this.sourcesContent = [];
43
+ this.mappings = [];
44
+ }
45
+
46
+ addSource(sourcePath, content = null) {
47
+ let idx = this.sources.indexOf(sourcePath);
48
+ if (idx === -1) {
49
+ idx = this.sources.length;
50
+ this.sources.push(sourcePath);
51
+ this.sourcesContent.push(content);
52
+ } else if (content !== null && this.sourcesContent[idx] === null) {
53
+ this.sourcesContent[idx] = content;
54
+ }
55
+ return idx;
56
+ }
57
+
58
+ addMapping({ generated, original, source }) {
59
+ if (!generated || generated.line == null || generated.column == null) return;
60
+ if (!original || original.line == null || original.column == null) return;
61
+
62
+ const sourceIdx = source ? this.addSource(source) : 0;
63
+ this.mappings.push({
64
+ generatedLine: generated.line,
65
+ generatedColumn: generated.column,
66
+ originalLine: original.line,
67
+ originalColumn: original.column,
68
+ sourceIdx,
69
+ });
70
+ }
71
+
72
+ toJSON() {
73
+ // Sort mappings by generated line, then generated column
74
+ const sorted = [...this.mappings].sort((a, b) => {
75
+ if (a.generatedLine !== b.generatedLine) return a.generatedLine - b.generatedLine;
76
+ return a.generatedColumn - b.generatedColumn;
77
+ });
78
+
79
+ let mappingsStr = '';
80
+ let prevGenLine = 1;
81
+ let prevGenCol = 0;
82
+ let prevOrigLine = 0;
83
+ let prevOrigCol = 0;
84
+ let prevSourceIdx = 0;
85
+
86
+ for (const m of sorted) {
87
+ while (prevGenLine < m.generatedLine) {
88
+ mappingsStr += ';';
89
+ prevGenLine++;
90
+ prevGenCol = 0;
91
+ }
92
+
93
+ if (mappingsStr.length > 0 && !mappingsStr.endsWith(';')) {
94
+ mappingsStr += ',';
95
+ }
96
+
97
+ const genColDiff = m.generatedColumn - prevGenCol;
98
+ const sourceIdxDiff = m.sourceIdx - prevSourceIdx;
99
+ const origLineDiff = (m.originalLine - 1) - prevOrigLine;
100
+ const origColDiff = (m.originalColumn - 1) - prevOrigCol;
101
+
102
+ mappingsStr += encodeVlq(genColDiff);
103
+ mappingsStr += encodeVlq(sourceIdxDiff);
104
+ mappingsStr += encodeVlq(origLineDiff);
105
+ mappingsStr += encodeVlq(origColDiff);
106
+
107
+ prevGenCol = m.generatedColumn;
108
+ prevSourceIdx = m.sourceIdx;
109
+ prevOrigLine = m.originalLine - 1;
110
+ prevOrigCol = m.originalColumn - 1;
111
+ }
112
+
113
+ const mapObj = {
114
+ version: 3,
115
+ file: this.file,
116
+ sources: this.sources,
117
+ mappings: mappingsStr,
118
+ };
119
+
120
+ if (this.sourcesContent.some(c => c !== null)) {
121
+ mapObj.sourcesContent = this.sourcesContent;
122
+ }
123
+
124
+ return mapObj;
125
+ }
126
+
127
+ toString() {
128
+ return JSON.stringify(this.toJSON());
129
+ }
130
+
131
+ toInlineDataUrl() {
132
+ const json = this.toString();
133
+ const base64 = Buffer.from(json, 'utf8').toString('base64');
134
+ return `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64}`;
135
+ }
136
+ }
137
+
138
+ module.exports = {
139
+ SourceMapGenerator,
140
+ encodeVlq,
141
+ decodeVlq,
142
+ };
@@ -1,6 +1,6 @@
1
1
  // Single source of truth for the compiler version.
2
2
  // Consumed by cli.js help/version output.
3
3
 
4
- const VERSION = '1.0.3-beta';
4
+ const VERSION = '1.0.3';
5
5
 
6
6
  module.exports = { VERSION };
@@ -1,10 +1,9 @@
1
- # PlainScript 1.0.3-beta capability audit
1
+ # PlainScript 1.0.3 Capability Audit
2
2
 
3
- This audit is intentionally grounded in the implementation, not in old
4
- examples. The parser and generator are the authority. A capability is listed
5
- here only when a source program can be validated by `plainscript check`.
3
+ This audit is based on what the compiler actually supports right now.
4
+ If `plainscript check` validates it, it's listed here.
6
5
 
7
- ## Core language
6
+ ## Core Language
8
7
 
9
8
  | Capability | Status | Current source form |
10
9
  | --- | --- | --- |
@@ -21,7 +20,7 @@ here only when a source program can be validated by `plainscript check`.
21
20
  | Loop control | Implemented | `break`, `continue` |
22
21
  | Classes and `new` | Implemented | JavaScript-compatible class forms |
23
22
 
24
- ## Modules and runtime
23
+ ## Modules and Runtime
25
24
 
26
25
  | Capability | Status | Notes |
27
26
  | --- | --- | --- |
@@ -36,7 +35,7 @@ here only when a source program can be validated by `plainscript check`.
36
35
  | Errors and retries | Implemented | `try`, `recover`, `finally`, `retry` |
37
36
  | Native tests | Implemented | `test` and `check` assertions |
38
37
 
39
- ## Web and services
38
+ ## Web and Services
40
39
 
41
40
  | Capability | Status | Current source form |
42
41
  | --- | --- | --- |
@@ -61,9 +60,9 @@ here only when a source program can be validated by `plainscript check`.
61
60
  | WhatsApp bots | Implemented | `whatsapp bot` |
62
61
  | OCR | Implemented | `ocr path of file as text` |
63
62
 
64
- ## Canonical examples
63
+ ## Canonical Examples
65
64
 
66
- The maintained examples are the executable capability matrix:
65
+ Here are the example files that exercise each capability:
67
66
 
68
67
  ```text
69
68
  examples/basics.pln
@@ -92,11 +91,14 @@ examples/id-verification/
92
91
  examples/whatsapp-bot/
93
92
  ```
94
93
 
95
- Run `find examples -name '*.pln' -exec node compiler/cli.js check {} \;`
96
- before changing the language reference.
94
+ Run this to make sure everything still compiles:
97
95
 
98
- ## Version boundary
96
+ ```bash
97
+ find examples -name '*.pln' -exec node compiler/cli.js check {} \;
98
+ ```
99
+
100
+ ## Version Info
99
101
 
100
- The repository release label is `1.0.3-beta`. This label identifies the
101
- compiler, package metadata, website, and editor tooling. It does not change
102
- third-party dependency versions.
102
+ The release label for this repo is `1.0.3`. It covers the compiler,
103
+ package metadata, website, and editor tooling. Third-party dependency
104
+ versions are not tied to this label.
@@ -1,17 +1,17 @@
1
- # PlainScript 1.0.3-beta language specification
1
+ # PlainScript 1.0.3 language specification
2
2
 
3
- This reference describes the syntax implemented by `compiler/lexer.js` and
4
- `compiler/parser.js`. The generated runtime is implemented in
5
- `compiler/generator.js`. Examples in this document are checked from the
3
+ This reference covers the syntax implemented by `compiler/lexer.js` and
4
+ `compiler/parser.js`. The runtime it generates lives in
5
+ `compiler/generator.js`. Every example here is checked against the
6
6
  repository's maintained example set.
7
7
 
8
8
  ## Design
9
9
 
10
- PlainScript is a line-oriented, intent-oriented language for Node.js. Source
11
- files use `.pln`. Blocks close with `done` unless the syntax explicitly uses
12
- `together`. Whitespace is not semantic.
10
+ PlainScript is a line-oriented, intent-oriented language made for Node.js.
11
+ Source files use `.pln`. Blocks end with `done` unless the syntax says
12
+ `together`. Whitespace does not matter.
13
13
 
14
- The canonical declaration forms are:
14
+ The basic declaration forms are:
15
15
 
16
16
  ```plainscript
17
17
  remember name as "Ada"
@@ -21,13 +21,13 @@ show name
21
21
  ```
22
22
 
23
23
  Comments begin with `//`. Double-quoted strings support escapes. Backtick
24
- strings preserve content and support `${expression}` interpolation.
24
+ strings keep their content as-is and support `${expression}` interpolation.
25
25
 
26
26
  ## Values and expressions
27
27
 
28
- Values include strings, template strings, numbers, booleans, `null`,
29
- `undefined`, BigInt, arrays, objects, identifiers, calls, member access,
30
- optional member access, and indexed access.
28
+ PlainScript has strings, template strings, numbers, booleans, `null`,
29
+ `undefined`, BigInt, arrays, objects, identifiers, function calls, member
30
+ access, optional member access, and indexed access.
31
31
 
32
32
  ```plainscript
33
33
  remember names as ["Ada", "Grace"]
@@ -36,7 +36,7 @@ show names[0]
36
36
  show user?.name
37
37
  ```
38
38
 
39
- English collection expressions:
39
+ English-style collection expressions:
40
40
 
41
41
  ```plainscript
42
42
  remember items as list with "one", "two", "three"
@@ -47,10 +47,10 @@ show item one from items
47
47
  show items at position 1
48
48
  ```
49
49
 
50
- Arithmetic supports `+`, `-`, `*`, `/`, `%`, and `**`, with normal
51
- precedence. Word forms `plus`, `minus`, `times`, and `divided by` are also
52
- recognized. `??` and unary `-`, `wait for`, `typeof`, `void`, and `delete`
53
- are implemented.
50
+ Arithmetic uses `+`, `-`, `*`, `/`, `%`, and `**`, with normal
51
+ precedence. Word forms `plus`, `minus`, `times`, and `divided by` also work.
52
+ `??` plus unary `-`, `wait for`, `typeof`, `void`, and `delete` are
53
+ supported.
54
54
 
55
55
  ## Conditions
56
56
 
@@ -82,6 +82,8 @@ Use `and`, `or`, and `not` to combine conditions. Inline conditionals use
82
82
 
83
83
  ## Functions
84
84
 
85
+ Write a function with `make` and return a value with `give`:
86
+
85
87
  ```plainscript
86
88
  make add(a, b)
87
89
  give a + b
@@ -98,8 +100,8 @@ make greet(name as "friend")
98
100
  done
99
101
  ```
100
102
 
101
- Aliases `define`, `function`, `return`, and `give back` are implemented. The
102
- readable declaration form is:
103
+ Aliases like `define`, `function`, `return`, and `give back` also work. Use
104
+ `make` and `give` for the readable form:
103
105
 
104
106
  ```plainscript
105
107
  make add(a, b)
@@ -107,8 +109,8 @@ make add(a, b)
107
109
  done
108
110
  ```
109
111
 
110
- `yield` creates a generator function. Functions may use `wait for` and other
111
- async operations.
112
+ `yield` turns a function into a generator. Functions can use `wait for` and
113
+ other async operations.
112
114
 
113
115
  ## Control flow
114
116
 
@@ -127,8 +129,8 @@ done
127
129
  ```
128
130
 
129
131
  Use `break` and `continue` inside loops. `match value against` uses `->`
130
- case arrows and `otherwise`. `switch value against` is an equivalent
131
- discriminant form.
132
+ case arrows and `otherwise`. `switch value against` works the same way and
133
+ is just another way to write it.
132
134
 
133
135
  ## Record kinds
134
136
 
@@ -141,8 +143,9 @@ done
141
143
  remember player as create a Player with name "Ada" and goals 4
142
144
  ```
143
145
 
144
- `define a kind called` creates a record kind. Fields use default expressions.
145
- `create a Kind with field value and field value` constructs an instance.
146
+ `define a kind called` makes a new record kind. Fields use default
147
+ expressions. `create a Kind with field value and field value` builds an
148
+ instance.
146
149
 
147
150
  ## Modules and packages
148
151
 
@@ -153,7 +156,7 @@ export circleArea
153
156
  use express
154
157
  ```
155
158
 
156
- Imports are bundled in dependency order. `use` declares an npm package.
159
+ Imports get bundled in dependency order. `use` declares an npm package.
157
160
 
158
161
  ## Web server syntax
159
162
 
@@ -179,7 +182,7 @@ Methods are `get`, `post`, `put`, `patch`, and `delete`. Request values use
179
182
  `body of request`, `param("id")`, `query("name")`, `header("x-token")`,
180
183
  `upload("file")`, and `uploads("file")`.
181
184
 
182
- Server capabilities include:
185
+ The server also supports:
183
186
 
184
187
  ```plainscript
185
188
  enable sessions "secret"
@@ -208,8 +211,8 @@ done
208
211
  ```
209
212
 
210
213
  SQL blocks are closed by `done`. `{variable}` placeholders are bound safely.
211
- `transaction ... done` groups writes. `postgres connection` selects
212
- PostgreSQL generation.
214
+ `transaction ... done` groups writes. `postgres connection` generates
215
+ PostgreSQL code instead.
213
216
 
214
217
  HTTP client expressions:
215
218
 
@@ -234,14 +237,14 @@ done
234
237
  ```
235
238
 
236
239
  Concurrency helpers are `allOf`, `anyOf`, `settledOf`, and `withTimeout`.
237
- Recurring blocks are `every 5 minutes ... done` and
240
+ Recurring blocks use `every 5 minutes ... done` and
238
241
  `schedule "0 * * * *" ... done`.
239
242
 
240
243
  ## AI providers
241
244
 
242
- `chat(model, messages, options)` and `embedText(model, text, options)` use an
243
- OpenAI-compatible API. Provider presets select safe defaults for the endpoint
244
- and environment variable:
245
+ `chat(model, messages, options)` and `embedText(model, text, options)` talk
246
+ to an OpenAI-compatible API. Provider presets pick safe defaults for the
247
+ endpoint and the environment variable:
245
248
 
246
249
  | Provider | API key | Default base |
247
250
  | --- | --- | --- |
@@ -264,10 +267,9 @@ show answer
264
267
  ```
265
268
 
266
269
  `base`, `key`, `headers`, `temperature`, `maxTokens`, and `responseFormat`
267
- are optional call options. Custom providers can use a provider name plus
268
- `base` and `key`; the runtime uses `PROVIDER_API_KEY` and
269
- `PROVIDER_BASE_URL` as defaults. These calls work in ordinary programs,
270
- routes, jobs, and messaging handlers.
270
+ are optional. Custom providers can supply a provider name plus `base` and
271
+ `key`; the runtime falls back to `PROVIDER_API_KEY` and `PROVIDER_BASE_URL`.
272
+ These calls work in ordinary programs, routes, jobs, and messaging handlers.
271
273
 
272
274
  ## WebSockets, cache, bots, and OCR
273
275
 
@@ -297,9 +299,9 @@ start telegram bot
297
299
  ```
298
300
 
299
301
  Inside a Telegram handler, `message`, `text`, `args`, `matches`, `chat`,
300
- `chatId`, and callback `data` are update context values. Fixed replies use
302
+ `chatId`, and callback `data` hold the update context. Fixed replies use
301
303
  `reply "text"`; provider-backed replies can use `chatWith` before `reply`.
302
- `telegramCall(method, params)` invokes any Telegram Bot API method.
304
+ `telegramCall(method, params)` calls any Telegram Bot API method.
303
305
 
304
306
  WhatsApp uses `whatsapp bot ... done`, with `auth`, `login qr`, `login
305
307
  pairing`, and `on message` clauses. OCR uses:
package/docs/index.html CHANGED
@@ -3,17 +3,38 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta name="description" content="PlainScript 1.0.3-beta language reference and examples">
7
- <title>PlainScript 1.0.3-beta</title>
6
+ <meta name="description" content="PlainScript 1.0.3 language reference and examples">
7
+ <meta name="theme-color" content="#070c16">
8
+ <title>PlainScript 1.0.3</title>
9
+ <script>
10
+ // Force desktop rendering on small screens: lay out at a desktop width and
11
+ // let the browser scale it down, so mobile users see the full site right
12
+ // away instead of having to pinch-zoom out.
13
+ (function () {
14
+ var isMobile = /Android|iPhone|iPod|iPad|Mobile|Windows Phone/i.test(navigator.userAgent);
15
+ if (isMobile) {
16
+ var vp = document.querySelector('meta[name="viewport"]');
17
+ if (vp) {
18
+ var layoutWidth = 1400;
19
+ var deviceWidth = window.screen.width || document.documentElement.clientWidth;
20
+ var scale = Math.min(deviceWidth / layoutWidth, 1).toFixed(5);
21
+ vp.setAttribute('content', 'width=' + layoutWidth + ', initial-scale=' + scale + ', maximum-scale=5');
22
+ }
23
+ }
24
+ })();
25
+ </script>
8
26
  <link rel="stylesheet" href="website/style.css">
9
27
  </head>
10
28
  <body>
11
- <header class="site-nav">
29
+ <div class="bg-scrim" aria-hidden="true"></div>
30
+ <canvas id="bg-canvas" aria-hidden="true"></canvas>
31
+
32
+ <header class="site-nav" id="site-nav">
12
33
  <div class="container nav-inner">
13
34
  <a class="nav-logo" href="#">
14
- <img src="logo.jpg" alt="" class="nav-logo-image">
35
+ <span class="nav-logo-mark" aria-hidden="true">&gt;_</span>
15
36
  <span>PlainScript</span>
16
- <span class="logo-ver">1.0.3-beta</span>
37
+ <span class="logo-ver">1.0.3</span>
17
38
  </a>
18
39
  <nav class="nav-links" aria-label="Primary navigation">
19
40
  <a href="#quickstart">Quick start</a>
@@ -27,9 +48,9 @@
27
48
  <main>
28
49
  <section class="hero">
29
50
  <div class="container hero-content">
30
- <p class="hero-badge">1.0.3-beta: intent-oriented Node.js programming</p>
51
+ <p class="hero-badge" data-reveal>1.0.3: Node.js programming for everyone</p>
31
52
  <h1 class="hero-title">Code that reads like plain English.</h1>
32
- <p class="hero-lead">Describe what you want. PlainScript compiles it to readable JavaScript while keeping the language small, direct, and checkable.</p>
53
+ <p class="hero-lead">Write what you want in plain words. PlainScript turns it into JavaScript — simple, readable, and easy to check.</p>
33
54
  <div class="hero-actions">
34
55
  <a class="button button-primary" href="#quickstart">Start building</a>
35
56
  <a class="button button-secondary" href="#library">Browse examples</a>
@@ -43,14 +64,14 @@ done</code></pre>
43
64
 
44
65
  <section id="quickstart" class="section">
45
66
  <div class="container">
46
- <p class="section-tag">Quick start</p>
47
- <h2 class="section-title">Check first, then build.</h2>
67
+ <p class="section-tag" data-reveal>Quick start</p>
68
+ <h2 class="section-title" data-reveal>A simple three-step workflow.</h2>
48
69
  <div class="three-column">
49
- <article class="info-card"><span class="card-number">01</span><h3>Write</h3><p>Create a <code>.pln</code> file with readable declarations and blocks.</p></article>
50
- <article class="info-card"><span class="card-number">02</span><h3>Check</h3><p>Run <code>plainscript check file.pln</code> to validate imports and generated JavaScript.</p></article>
51
- <article class="info-card"><span class="card-number">03</span><h3>Build</h3><p>Run <code>plainscript build</code> to emit standalone files in <code>dist/</code>.</p></article>
70
+ <article class="info-card" data-reveal><span class="card-number">01</span><h3>Write</h3><p>Create a <code>.pln</code> file with readable code blocks.</p></article>
71
+ <article class="info-card" data-reveal><span class="card-number">02</span><h3>Check</h3><p>Run <code>plainscript check file.pln</code> to catch mistakes.</p></article>
72
+ <article class="info-card" data-reveal><span class="card-number">03</span><h3>Build</h3><p>Run <code>plainscript build</code> to get your files in <code>dist/</code>.</p></article>
52
73
  </div>
53
- <pre class="code-window"><code>npx plainscript new hello
74
+ <pre class="code-window" data-reveal><code>npx plainscript new hello
54
75
  cd hello
55
76
  npx plainscript check
56
77
  npx plainscript build
@@ -60,36 +81,38 @@ npm start</code></pre>
60
81
 
61
82
  <section id="language" class="section section--alt">
62
83
  <div class="container">
63
- <p class="section-tag">Language</p>
64
- <h2 class="section-title">A focused grammar for real programs.</h2>
84
+ <p class="section-tag" data-reveal>Language</p>
85
+ <h2 class="section-title" data-reveal>A small set of words you already know.</h2>
65
86
  <div class="feature-grid">
66
- <article class="feature-card"><h3>Variables</h3><p><code>remember name as "Ada"</code> and readable assignment with <code>becomes</code>.</p></article>
67
- <article class="feature-card"><h3>Conditions</h3><p>Use <code>is at least</code>, <code>contains</code>, <code>between</code>, and logical operators.</p></article>
68
- <article class="feature-card"><h3>Functions</h3><p>Define functions with <code>make</code>, return with <code>give</code>, and close with <code>done</code>.</p></article>
69
- <article class="feature-card"><h3>Records</h3><p>Model data with record kinds and readable constructors.</p></article>
70
- <article class="feature-card"><h3>Web apps</h3><p>Declare routes, JSON responses, sessions, cookies, uploads, and auth.</p></article>
71
- <article class="feature-card"><h3>Data and async</h3><p>Use SQLite, HTTP, files, schedules, concurrency, and WebSockets.</p></article>
72
- <article class="feature-card"><h3>AI providers</h3><p>Call Groq and other OpenAI-compatible providers with environment-backed keys.</p></article>
87
+ <article class="feature-card" data-reveal><h3>Variables</h3><p>Store values with <code>remember name as "Ada"</code> and change them with <code>becomes</code>.</p></article>
88
+ <article class="feature-card" data-reveal><h3>Conditions</h3><p>Compare things with <code>is at least</code>, <code>contains</code>, <code>between</code>, and more.</p></article>
89
+ <article class="feature-card" data-reveal><h3>Functions</h3><p>Create functions with <code>make</code>, return with <code>give</code>, and close with <code>done</code>.</p></article>
90
+ <article class="feature-card" data-reveal><h3>Records</h3><p>Model your data with record kinds and easy constructors.</p></article>
91
+ <article class="feature-card" data-reveal><h3>Modules</h3><p>Import code with <code>bring ... from</code>, <code>@/</code> aliases, and re-exports.</p></article>
92
+ <article class="feature-card" data-reveal><h3>Compound Types</h3><p>Use dictionaries, sets, and tuples with unpacking.</p></article>
93
+ <article class="feature-card" data-reveal><h3>Web apps</h3><p>Set up routes, JSON responses, sessions, cookies, uploads, and auth.</p></article>
94
+ <article class="feature-card" data-reveal><h3>Data and async</h3><p>Work with SQLite, HTTP, files, schedules, concurrency, and WebSockets.</p></article>
95
+ <article class="feature-card" data-reveal><h3>AI providers</h3><p>Call Groq and other OpenAI-compatible providers using your own keys.</p></article>
73
96
  </div>
74
97
  </div>
75
98
  </section>
76
99
 
77
100
  <section id="capabilities" class="section">
78
101
  <div class="container">
79
- <p class="section-tag">Capabilities</p>
80
- <h2 class="section-title">The compiler covers the full path.</h2>
81
- <div class="capability-list">
82
- <span>JSON</span><span>SQLite and SQL</span><span>HTTP client</span><span>Auth and sessions</span><span>Files</span><span>Packages</span><span>Async</span><span>Errors</span><span>Concurrency</span><span>WebSockets</span><span>Cache</span><span>Bots</span><span>OCR</span><span>Tests</span><span>Modules</span>
102
+ <p class="section-tag" data-reveal>Capabilities</p>
103
+ <h2 class="section-title" data-reveal>Everything you need is built in.</h2>
104
+ <div class="capability-list" data-reveal>
105
+ <span>JSON</span><span>SQLite and SQL</span><span>HTTP client</span><span>Auth and sessions</span><span>Files</span><span>Packages</span><span>Async</span><span>Errors</span><span>Concurrency</span><span>WebSockets</span><span>Cache</span><span>Bots</span><span>OCR</span><span>Tests</span><span>Modules</span><span>Source Maps</span><span>Compound Types</span>
83
106
  </div>
84
107
  </div>
85
108
  </section>
86
109
 
87
110
  <section id="library" class="section section--alt">
88
111
  <div class="container">
89
- <p class="section-tag">Feature library</p>
90
- <h2 class="section-title">Current, checked examples.</h2>
91
- <p class="section-lead">These snippets use the grammar accepted by PlainScript 1.0.3-beta.</p>
92
- <div class="library-toolbar">
112
+ <p class="section-tag" data-reveal>Feature library</p>
113
+ <h2 class="section-title" data-reveal>Examples you can try today.</h2>
114
+ <p class="section-lead">These snippets use the PlainScript 1.0.3 grammar.</p>
115
+ <div class="library-toolbar" data-reveal>
93
116
  <label class="sr-only" for="lib-search">Search examples</label>
94
117
  <input id="lib-search" class="lib-search-input" type="search" placeholder="Search examples">
95
118
  <div id="lib-filters" class="lib-filters" aria-label="Filter examples"></div>
@@ -101,15 +124,19 @@ npm start</code></pre>
101
124
 
102
125
  <section class="section">
103
126
  <div class="container split">
104
- <div><p class="section-tag">Reference</p><h2 class="section-title">Use the compiler as the authority.</h2></div>
105
- <div><p>Read the <a href="PLAINSCRIPT-SPEC.md">language specification</a> and the <a href="../knowledge.md">AI coding specification</a>. The repository's <code>examples/</code> directory is the executable reference set.</p><p>Validate a file with <code>node compiler/cli.js check path/to/file.pln</code>.</p></div>
127
+ <div data-reveal><p class="section-tag">Reference</p><h2 class="section-title">The compiler is the source of truth.</h2></div>
128
+ <div data-reveal><p>Read the <a href="PLAINSCRIPT-SPEC.md">language specification</a> and the <a href="../knowledge.md">AI coding specification</a>. The repository's <code>examples/</code> directory has runnable examples.</p><p>Validate a file with <code>node compiler/cli.js check path/to/file.pln</code>.</p></div>
106
129
  </div>
107
130
  </section>
108
131
  </main>
109
132
 
110
133
  <footer class="site-footer">
111
- <div class="container footer-bottom"><span>PlainScript</span><span>1.0.3-beta</span></div>
134
+ <div class="container footer-bottom"><span>PlainScript</span><span>1.0.3</span></div>
112
135
  </footer>
136
+
137
+ <script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
138
+ <script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
139
+ <script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/ScrollTrigger.min.js"></script>
113
140
  <script src="website/script.js"></script>
114
141
  </body>
115
142
  </html>