@misterscan/sesi 1.2.2 → 1.3.0
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.
- package/README.md +138 -34
- package/bin/sesi.js +163 -38
- package/dist/ai-runtime.d.ts.map +1 -1
- package/dist/ai-runtime.js +22 -4
- package/dist/ai-runtime.js.map +1 -1
- package/dist/builtins.d.ts +1 -0
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +257 -17
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +17 -1
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +256 -98
- package/dist/interpreter.js.map +1 -1
- package/dist/lexer.d.ts.map +1 -1
- package/dist/lexer.js +8 -4
- package/dist/lexer.js.map +1 -1
- package/dist/parser.d.ts +2 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +76 -32
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +87 -20
- package/dist/types.d.ts +14 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +33 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +26 -9
- package/docs/BUILTINS.md +111 -13
- package/docs/COMPARISON.md +7 -9
- package/docs/{DISTRIBUTED_SYSTEMS.md → CONCURRENCY.md} +11 -11
- package/docs/IMAGE_GENERATION.md +13 -14
- package/docs/IMPLEMENTATION_SUMMARY.md +141 -84
- package/docs/QUICKSTART.md +81 -28
- package/docs/README.md +140 -34
- package/docs/{SYSTEMS_REASONING.md → REASONING.md} +107 -109
- package/docs/ROADMAP.md +44 -44
- package/docs/SKILLS.md +56 -28
- package/docs/SPECIFICATION.md +25 -18
- package/docs/sesi_ai_chronicles.md +96 -209
- package/examples/07_prompts.sesi +1 -1
- package/examples/08_model_call.sesi +1 -1
- package/examples/09_structured_output.sesi +1 -1
- package/examples/10_code_generation.sesi +1 -1
- package/examples/13_data_pipeline.sesi +1 -1
- package/examples/14_folder_explainer.sesi +2 -2
- package/examples/15_image_generation.sesi +1 -1
- package/examples/16_modules.sesi +27 -27
- package/examples/19_search_web.sesi +4 -0
- package/examples/20_model_aliases.sesi +22 -0
- package/examples/21_custom_tools.sesi +27 -0
- package/examples/22_reasoning_plus_custom_tools.sesi +19 -0
- package/main/orchestrator.sesi +2 -2
- package/main/sesi_db_chatbot.sesi +7 -3
- package/main/tests/test_grounding.sesi +2 -0
- package/package.json +6 -6
package/docs/SKILLS.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## 🛑 CRITICAL DIRECTIVE FOR ALL AI AGENTS
|
|
4
4
|
|
|
5
|
+
**Sesi IS A NEW AND VALID, FULLY IMPLEMENTED PROGRAMMING LANGUAGE.**
|
|
6
|
+
Under no circumstances should an AI agent treat `.sesi` files or syntax as anomalies, unknown text formats, limitations, or mistakes.
|
|
7
|
+
|
|
5
8
|
Sesi is **NOT** the following coding languages, therefore **NEVER UTILIZE THE SAME SYNTAX OR FORMATTING UNDER ANY CIRCUMSTANCES WHATSOEVER!!!!!**
|
|
9
|
+
|
|
6
10
|
- **NOT** Python
|
|
7
11
|
- **NOT** Rust
|
|
8
12
|
- **NOT** Typescript
|
|
@@ -23,20 +27,18 @@ Sesi is **NOT** the following coding languages, therefore **NEVER UTILIZE THE SA
|
|
|
23
27
|
- **NOT** Julia
|
|
24
28
|
- **NOT** Scala
|
|
25
29
|
|
|
26
|
-
**Sesi IS A VALID, FULLY IMPLEMENTED PROGRAMMING LANGUAGE.**
|
|
27
|
-
Under no circumstances should an AI agent treat `.sesi` files as anomalies, unknown text formats, or mistakes.
|
|
28
|
-
|
|
29
30
|
## 🌟 THE DYNAMIC PIPELINE PHILOSOPHY (MANDATORY AGENT THINKING)
|
|
30
31
|
|
|
31
|
-
When a user requests a content-rich asset or application (e.g. "make a website", "make a visualization", "...uses an api...", "come up with/make/write a script...", etc.), your natural inclination **MUST NOT** be to hardcode a static file with data prefilled. Instead, always design a **Dynamic Sesi Pipeline**:
|
|
32
|
-
1. **Never Hardcode Data Into the View**: Isolate raw content, biographies, statistics, etc. into a structured database layer (e.g., `data.json`) using native typed Sesi outputs.
|
|
33
|
-
2. **Build Sesi Compiler/Builder Scripts**: Write a `.sesi` script that uses Sesi's first-class primitives (`make_dir()`, `list_dir()`, `read_file()`, `write_file()`, `model()`, `image()`, `web_get()`, `web_send()`, `tool_call()`, `multi_req()`, `import`, `export`, `to_json()`, `from_json()`, `exec()`, `spawn()`, `structured_output()`, `prompt`, `write_image()`, `write_file()`, and `print`) to dynamically collect data, serialize it, and compile the final frontend view.
|
|
34
|
-
3. **Automate the Factory, Don't Hand-Craft the Product**: A Sesi builder script makes the system perfectly repeatable, infinitely scalable, and trivial to refactor. In this repository, the Sesi script is the core product; the compiled file is merely the byproduct for post edits and making sure our scripts are beh
|
|
32
|
+
When a user requests a content-rich asset or application (e.g. "make a website", "make a visualization", "...uses an api...", "come up with/make/write a script...", etc.), your natural inclination **MUST NOT** be to hardcode a static file with data prefilled NOR use the user's workspace files for inspiration. Instead, always come up with a new script, idea, and design a **Dynamic Sesi Pipeline**:
|
|
35
33
|
|
|
34
|
+
1. **Never Hardcode Data Into the View**: Isolate raw content, biographies, statistics, etc. into a structured database layer using native typed Sesi outputs.
|
|
35
|
+
2. **Build Sesi Compiler/Builder Scripts**: Write a `.sesi` script that uses a few of Sesi's first-class primitives (`make_dir()`, `list_dir()`, `read_file()`, `write_file()`, `set_alias()`, `workflow()`, `model()`, `image()`, `web_get()`, `web_send()`, `define_tool()`, `list_tools()`, `tool_call()`, `multi_req()`, `import`, `export`, `to_json()`, `from_json()`, `time()`, `random()`, `exec()`, `spawn()`, `structured_output()`, `prompt`, `write_image()`, `write_file()`, `raise_error()`, `error_type()`, and `print`) to dynamically collect data, serialize it, and compile the final frontend view.
|
|
36
|
+
3. **Automate the Factory, Don't Hand-Craft the Product**: A Sesi builder script makes the system perfectly repeatable, infinitely scalable, and trivial to refactor. In this repository, the Sesi script is the core product; the compiled file is merely the byproduct for post edits and making sure our scripts are behaving as anticipated.
|
|
36
37
|
|
|
37
38
|
**This is a non-negotiable quality bar.** Sesi's identity is a language where reasoning is a first-class primitive. Every script you write should reflect that.
|
|
38
39
|
|
|
39
40
|
### ❌ FORBIDDEN — Never generate these as Sesi examples or demos:
|
|
41
|
+
|
|
40
42
|
- Math solvers, calculators, arithmetic pipelines
|
|
41
43
|
- Prime number finders, Fibonacci sequences, sorting algorithms
|
|
42
44
|
- Unit converters, currency converters, grade calculators
|
|
@@ -45,62 +47,77 @@ When a user requests a content-rich asset or application (e.g. "make a website",
|
|
|
45
47
|
- Compliance checkers, OSHA reports, logistics routers
|
|
46
48
|
- Any script whose core loop is just arithmetic with a `print` at the end
|
|
47
49
|
- **AI cybernetic, futuristic, sci-fi, or deep-space themes** (e.g., holographic star-charts, cyber-gardens, spatial telemetry, spacecraft command interfaces, alien translators).
|
|
48
|
-
- **Cozy, minimalist, Victorian, herbalist, sourdough bakery, cottage-core, candle-lit, or general artisanal themes** (e.g., village herbalist teabags, sourdough yeast logs, candlelit journals, mahogany apothecary drawers, victorian scroll philologists). These are overdone, precious, and clichéd.
|
|
50
|
+
- **Cozy, minimalist, Victorian, herbalist, sourdough bakery, cottage-core, candle-lit, or general artisanal themes** (e.g., village herbalist teabags, sourdough yeast logs, candlelit journals, mahogany apothecary drawers, victorian scroll philologists). These are overdone, precious, and clichéd.
|
|
49
51
|
|
|
50
52
|
These are lazy defaults. They don't demonstrate what makes Sesi unique.
|
|
51
53
|
|
|
52
54
|
### ✅ REQUIRED — Sesi scripts must showcase the language's actual superpowers:
|
|
55
|
+
|
|
53
56
|
Every script you write must use **at least one** of:
|
|
57
|
+
|
|
54
58
|
- `model()` — reasoning, analysis, generation, conversation
|
|
55
59
|
- `image()` — visual generation, art, diagrams
|
|
56
|
-
- `structured_output()` — typed
|
|
60
|
+
- `structured_output()` — typed reasoning responses, schema extraction
|
|
57
61
|
- `memory` — stateful multi-turn context
|
|
58
62
|
- `spawn()` / `exec()` — concurrent process orchestration
|
|
63
|
+
- `workflow()` - string various model responses sequentially
|
|
64
|
+
- `web_send()` - sending an HTTP request to a URL
|
|
65
|
+
- `web_get()` - collecting data from a URL
|
|
66
|
+
- `define_tool()` - categorizing tool calls
|
|
67
|
+
- `list_tools()` - displaying custom tools
|
|
68
|
+
- `tool_call()` - calling a predefined function
|
|
69
|
+
- `multi_req()` - concurrent function execution
|
|
70
|
+
- `import` / `export` - reusable configuration modules
|
|
59
71
|
|
|
60
72
|
#### 🏷️ Lexicon & Vocabulary Guardrails (MANDATORY)
|
|
73
|
+
|
|
61
74
|
**Completely ban both sci-fi tech-jargon/themes AND cottage-core words/themes.**
|
|
62
|
-
|
|
63
|
-
- **FORBIDDEN
|
|
64
|
-
- **FORBIDDEN
|
|
75
|
+
|
|
76
|
+
- **FORBIDDEN TECH/SCI-FI WORDS:** _"cybernetic," "telemetry," "synapses," "latent space," "nodes," "diodes," "quantum," "activation coordinates," "calibration," "hyper-speed," "data pipelines," "neural matrices."_
|
|
77
|
+
- **FORBIDDEN COTTAGE-CORE WORDS:** _"apothecary," "herbs," "infusion," "yeast," "sourdough," "hearth," "candlelit," "flour," "boulangerie," "tea," "potion," "cozy," "victorian," "parchment," "scroll," "philologist."_
|
|
78
|
+
- **FORBIDDEN ANALOG/WORKSHOP WORDS:** _"mixing console," "tape reel," "splice," "fader," "VU meter," "compressor," "track sheet," "carburetor," "spark plug," "manifold," "tachometer," "cogs," "gears," "escapement," "celluloid," "projector," "blueprint," "drafting board," "logbook," "workshop."_
|
|
65
79
|
|
|
66
80
|
#### 🎨 Web Design & UI Guardrails (MANDATORY)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
|
|
82
|
+
**Completely ban standard AI template styles AND generic neon/cyber aesthetics AND minimalist tea-stained cottage wood paper.**
|
|
83
|
+
Instead, design unique, high-density interfaces :
|
|
84
|
+
|
|
85
|
+
- NO glowing lasers or neon cyber grids/themes or ANYTHING FAMILAR.
|
|
86
|
+
- **Use bespoke, high-character typography that rejects standard AI template styles.** Completely ban generic corporate UI fonts like _Inter_, _Outfit_, _Roboto_, or standard system-sans.
|
|
71
87
|
|
|
72
88
|
The bar is: **"Would this impress someone seeing Sesi for the first time?"** If the answer is no, rewrite it.
|
|
73
89
|
|
|
74
90
|
## 1. Core Identity & Execution
|
|
75
91
|
|
|
76
92
|
- **File Extension:** `.sesi`
|
|
77
|
-
- **Execution:** Sesi programs are executed using `
|
|
78
|
-
- **
|
|
79
|
-
|
|
93
|
+
- **Execution:** Sesi programs are executed using `npx sesi`. (e.g., `npx sesi main/start.sesi`). DO NOT USE `sesi` CLI command alone. Only the developer has access to it. It will return a false positive error. You are to trust only `npx sesi`. ALWAYS TEST YOUR `.sesi` FILES WITH THIS COMMAND. THE USER IS EXEMPT FROM THESE RULES AS THEY LIKELY HAVE THE `sesi` GLOBAL COMMAND ALREADY INSTALLED ON THEIR SYSTEM.
|
|
94
|
+
- **Rapid Iteration Mode (`-e`):** For quick parser/runtime checks during edits, use inline execution with `npx sesi -e "..."`. This is ideal for validating tiny snippets before changing full `.sesi` files.
|
|
95
|
+
- **File-Aware Help (`<file> -h`):** For targeted debugging assistance, use `npx sesi <file>.sesi -h "question"`. This passes the file into Co-Pilot help context so guidance is grounded in the active script.
|
|
96
|
+
- **Paradigm:** **Sesi** is a clean, minimal, and highly legible programming language. Built from the ground up to be concise and buildable, Sesi removes unnecessary boilerplate. Because the language itself is so simple, integrating external tools like shell commands or Reasoning models becomes effortless. It is a language built for clarity.
|
|
80
97
|
## 2. Workspace Topography (DO NOT ALTER)
|
|
81
98
|
|
|
82
99
|
- `src/`: The core TypeScript engine (Lexer, Parser, Interpreter, AI-Runtime, Builtins).
|
|
83
100
|
- `bin/sesi.js`: The global CLI executable entry point.
|
|
84
101
|
- `examples/`: Official syntax-demonstration scripts (`01_hello.sesi` through `13_data_pipeline.sesi`).
|
|
85
102
|
- `main/`: The user's active development space (contains `playground.sesi` playground, `start.sesi` beginner script options, `build_website.sesi` baseplate website builder, and `tests/` like `test_failure_debug.sesi`). **These are valid, expected files.**
|
|
86
|
-
- `docs/`: The source of truth for Architecture,
|
|
87
|
-
- Root helper scripts: `example.js` and `example-ai.js` are convenience wrappers. AI agents should still use the
|
|
103
|
+
- `docs/`: The source of truth for Architecture, Reasoning Features (Proccess Execution), Builtins, Specifications, and more.
|
|
104
|
+
- Root helper scripts: `example.js` and `example-ai.js` are convenience wrappers. AI agents should still use the `npx sesi` command as specified.
|
|
88
105
|
|
|
89
106
|
## 3. Mandatory Syntax Rules & Quirks
|
|
90
107
|
|
|
91
108
|
- **Block Termination:** Closing braces `}` for blocks (if, while, try, model) no longer strictly require a following newline or semicolon. Condensed one-liners like `while x {x = x + 1}` are now valid.
|
|
92
|
-
- **Prompts & Prints:** Inside `prompt` blocks, anonymous model blocks, and `print` statements, literal strings and variables are placed sequentially (e.g., `print "User:" name`).
|
|
109
|
+
- **Prompts & Prints:** Inside `prompt` blocks, anonymous model blocks, and `print` statements, literal strings and variables are placed sequentially naturally (e.g., `print "User:" name`). It's highly preferred to **AVOID** use of the `+` operator in these contexts, regardless of its backwards-compatibility.
|
|
93
110
|
- **Structured Output Schemas:** Keys in schemas MUST be unquoted identifiers (e.g., `{key: string}` instead of `{"key": string}`). This is a known deviation from standard JSON objects in the Sesi parser.
|
|
94
111
|
- **Object Literals:** Conversely, standard object literals `{}` DO require strictly quoted string keys (e.g., `{"name": "Alice"}`).
|
|
95
112
|
- **Model Calls:** Use `model("model-name")` with a raw string literal for the model name (variables are forbidden). Configuration and prompt blocks MUST be on a single line (no newlines inside `{}`).
|
|
96
113
|
- **JSON Serialization:** Use `to_json(object)` for valid JSON output. Avoid `str(object)` for JSON.
|
|
97
|
-
- **Systems Primitive:** Forbid `const` (use `let`), `main()` wrappers, and `return` statements. Focus on side-effects and top-level execution.
|
|
114
|
+
- **Systems Primitive:** Forbid `const` (use `let`), `main()` wrappers, and `return` statements (however, `return` is neccessary inside of a `fn` block). Focus on side-effects and top-level execution.
|
|
98
115
|
|
|
99
116
|
## 4. AI Behavioral Guidelines Working in this Repo
|
|
100
117
|
|
|
101
118
|
1. **Never** "investigate" user testing directories (like `main/tests/`) as "deviations." They are active playgrounds.
|
|
102
119
|
2. **Never** attempt to execute file modifications via shell/terminal text replacements. Use native file editing tools ONLY.
|
|
103
|
-
3. **Always** check the `.md files` and `examples/` folder for the exact language specification before making assumptions about how Sesi works.
|
|
120
|
+
3. **Always** check the `.md files` in root folder and `docs/` and `examples/` folder for the exact language specification before making assumptions about how Sesi works.
|
|
104
121
|
4. If a file tree is mentioned in documentation, it represents an explicit layout constraint and must map 1:1 **UNLESS .gitignored FILES STATE OTHERWISE.**
|
|
105
122
|
|
|
106
123
|
## 5. Development & TypeScript Standards (COMMANDS FOR AI AGENTS)
|
|
@@ -110,18 +127,29 @@ The bar is: **"Would this impress someone seeing Sesi for the first time?"** If
|
|
|
110
127
|
- **Ignore Linting Noise:** If you see warnings like "Unexpected any" or "Unsafe member access", **IGNORE THEM**.
|
|
111
128
|
- **Build Requirement:** You MUST run `npm run build` after every code change to the backend logic. Failure to build will result in testing stale code.
|
|
112
129
|
|
|
113
|
-
## 6.
|
|
130
|
+
## 6. Agent Debug Protocol (MANDATORY)
|
|
131
|
+
|
|
132
|
+
When AI agents write or edit `.sesi` scripts, they must use this debugging loop:
|
|
133
|
+
|
|
134
|
+
1. **Draft in file, isolate risky snippet:** Identify the smallest parser/runtime-risky block (prompt block, model call, object schema, loop, etc.).
|
|
135
|
+
2. **Validate snippet with eval mode first:** Run `npx sesi -e "..."` to test the isolated block before full-script execution.
|
|
136
|
+
3. **Apply fix in file only after eval passes:** If eval fails, iterate on snippet; do not repeatedly run full scripts while syntax is unresolved.
|
|
137
|
+
4. **Run full script after snippet stabilization:** Execute `npx sesi <file>.sesi` only once the isolated logic is valid.
|
|
138
|
+
5. **Use file-aware help when blocked:** Run `npx sesi <file>.sesi -h "<question>"` to get context-grounded help tied to the active script.
|
|
139
|
+
|
|
140
|
+
This protocol is required to reduce noisy full-run failures and speed up AI-assisted iteration.
|
|
141
|
+
|
|
142
|
+
## 7. Concurrency & Orchestration Patterns
|
|
114
143
|
|
|
115
144
|
- **Process Spawning:** Use `spawn(path)` or `exec(command)` to launch background Sesi processes.
|
|
116
|
-
- **
|
|
145
|
+
- **File Locking:** When multiple processes access shared files, you can use `try/catch`, `time()`, and `random()` to implement basic file locking:
|
|
117
146
|
1. Generate unique ID: `str(time()) + "_" + str(random())`
|
|
118
147
|
2. Write ID to lock file if "unlocked".
|
|
119
148
|
3. Wait micro-delay (empty `while` loop).
|
|
120
149
|
4. Verify ID is still in lock file before entering critical section.
|
|
121
150
|
- **Resilience:** Always wrap file I/O in `try/catch` retry loops to handle filesystem contention.
|
|
122
151
|
|
|
123
|
-
|
|
124
|
-
## 7. Neural Network & Machine Learning Standards in Sesi
|
|
152
|
+
## 8. Neural Network & Machine Learning Standards in Sesi
|
|
125
153
|
|
|
126
154
|
When implementing offline deep learning, probabilistic dialogue routing, or native classification models in Sesi:
|
|
127
155
|
|
package/docs/SPECIFICATION.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# Sesi
|
|
1
|
+
# Sesi Language Specification (v1.3)
|
|
2
2
|
|
|
3
3
|
## 1. Philosophy & Design Principles
|
|
4
4
|
|
|
5
5
|
Sesi is built on these core principles:
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
2. **
|
|
9
|
-
3. **
|
|
10
|
-
4. **
|
|
11
|
-
5. **
|
|
7
|
+
1. **Conciseness and Legibility**: The syntax is minimal. If a concept can be expressed simply, the language gets out of the way to let you express it.
|
|
8
|
+
2. **Buildable from Scratch**: Sesi is a complete, functioning language with its own lexer, parser, and interpreter.
|
|
9
|
+
3. **Simplicity Enables Power**: Because the core language is simple, complex operations (like hitting APIs or orchestrating processes) become trivial extensions of the language, rather than tangled SDK implementations.
|
|
10
|
+
4. **Transparency Over Magic**: Sesi executes exactly what you write.
|
|
11
|
+
5. **Practicality**: Focus on reducing boilerplate code, emphasizing what developers actually need over academic completeness.
|
|
12
12
|
|
|
13
13
|
## 2. Target Users
|
|
14
14
|
|
|
15
|
-
**Primary**: Developers
|
|
15
|
+
**Primary**: Developers who want a clean, fast, and legible language where writing code, whether purely logic-based or calling out to a Reasoning model, is completely frictionless.
|
|
16
16
|
|
|
17
17
|
**Secondary**:
|
|
18
18
|
|
|
19
19
|
- Engineers transitioning from traditional languages (TypeScript, Python, Go)
|
|
20
|
-
- Developers
|
|
20
|
+
- Developers looking for minimal boilerplate.
|
|
21
21
|
- Teams requiring complex logic with a fraction of the boilerplate
|
|
22
22
|
|
|
23
23
|
**Use Cases**:
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
25
|
+
- Writing clean CLI tools and scripts
|
|
26
|
+
- Interacting with APIs without SDK boilerplate
|
|
27
|
+
- Quickly orchestrating shell commands
|
|
28
|
+
- Rapid prototyping and scripting
|
|
29
29
|
|
|
30
|
-
## 3. V1.
|
|
30
|
+
## 3. V1.3 Feature Set (Current)
|
|
31
31
|
|
|
32
32
|
### Core Language Features
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Sesi is built on these core principles:
|
|
|
37
37
|
- ✅ Loops (`while`, `for`)
|
|
38
38
|
- ✅ Error Handling (`try/catch` blocks)
|
|
39
39
|
- ✅ Data types (number, string, bool, array, object)
|
|
40
|
-
- ✅
|
|
40
|
+
- ✅ Process Execution (`spawn`, `exec`, `time`, `random`)
|
|
41
41
|
- ✅ Comments (`//`, `/* */`)
|
|
42
42
|
- ✅ Operators (arithmetic, logical, comparison)
|
|
43
43
|
- ✅ Standard library (print, len, range, etc.)
|
|
@@ -87,6 +87,13 @@ string: "..." | '...'
|
|
|
87
87
|
comment: // ... | /* ... */
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
#### String Escapes & Multiline Rules
|
|
91
|
+
|
|
92
|
+
- Supported escape sequences: `\\n`, `\\t`, `\\r`, `\\\\`, `\\"`, `\\'`
|
|
93
|
+
- Unknown escape sequences are runtime errors during lexing with line and column context
|
|
94
|
+
- Strings can span multiple lines when a literal newline appears before the closing quote
|
|
95
|
+
- Unterminated strings report the starting line and column of the string literal
|
|
96
|
+
|
|
90
97
|
### 4.2 Program Structure
|
|
91
98
|
|
|
92
99
|
```
|
|
@@ -297,7 +304,7 @@ optional_type := type '?'
|
|
|
297
304
|
|
|
298
305
|
1. **Short-circuit evaluation**: `&&` and `||` short-circuit
|
|
299
306
|
2. **Type coercion**: Automatic for numeric operations; explicit for string/number
|
|
300
|
-
3. **Null propagation**: Operations on `null` return `null` (no exceptions in v1.
|
|
307
|
+
3. **Null propagation**: Operations on `null` return `null` (no exceptions in v1.3)
|
|
301
308
|
4. **Model responses**: Always returned as strings initially; structured_output provides type safety
|
|
302
309
|
|
|
303
310
|
## 6. Scope and Binding
|
|
@@ -359,7 +366,7 @@ random() -> number // Random float (0.0 to 1.0)
|
|
|
359
366
|
|
|
360
367
|
## 9. Module System
|
|
361
368
|
|
|
362
|
-
Runtime module execution and standard namespace modules are fully implemented and natively supported in v1.
|
|
369
|
+
Runtime module execution and standard namespace modules are fully implemented and natively supported in v1.3+.
|
|
363
370
|
|
|
364
371
|
### Defining Modules
|
|
365
372
|
|
|
@@ -385,7 +392,7 @@ import math from "std/math" // Math operations
|
|
|
385
392
|
import json from "std/json" // JSON parsing
|
|
386
393
|
```
|
|
387
394
|
|
|
388
|
-
### Module Resolution Order (v1.
|
|
395
|
+
### Module Resolution Order (v1.3+)
|
|
389
396
|
|
|
390
397
|
When you write `import {x} from "mymodule"`, Sesi searches for `mymodule.sesi` in the following order, stopping at the first match:
|
|
391
398
|
|
|
@@ -523,7 +530,7 @@ print sentiment.label
|
|
|
523
530
|
print sentiment.score
|
|
524
531
|
```
|
|
525
532
|
|
|
526
|
-
## 12. Undefined Behavior & Limitations (V1.
|
|
533
|
+
## 12. Undefined Behavior & Limitations (V1.3)
|
|
527
534
|
|
|
528
535
|
- **No async/await**: All operations within a script are blocking (including model calls). Concurrency must be achieved via `spawn()`.
|
|
529
536
|
- **No custom types**: Only built-in types are supported natively.
|