openalgo-script 0.1.0-alpha.0 → 0.1.0-alpha.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ What changed in each release, written for somebody deciding whether to upgrade.
4
+
5
+ This file is checked at release: a version with no entry, or an entry that says
6
+ nothing, fails the build before it can become permanent.
7
+
8
+ ---
9
+
10
+ ## 0.1.0-alpha.1
11
+
12
+ The first release published by the automation rather than by hand.
13
+
14
+ Fixes a version skew that would have bitten anybody running the tests on a
15
+ different runtime than the author. Test discovery passed a glob to the runtime's
16
+ test runner, which expands it on a recent version and treats it as a literal path
17
+ on an older one, so the suite silently found no files and reported success.
18
+ Discovery now walks the filesystem in code, and finding zero test files is a
19
+ failure rather than a pass.
20
+
21
+ The supported runtime floor moves to Node 22. Node 20 reached end of life earlier
22
+ this year, and supporting a runtime nobody should be running was forcing a worse
23
+ test setup.
24
+
25
+ The build now reports two version numbers of its own: the package version, so a
26
+ bug report can establish which build produced a number, and the compiled program
27
+ format version, so an engine written by somebody else can refuse a program it does
28
+ not implement. Both are generated from the files that already state them rather
29
+ than typed into source.
30
+
31
+ ## 0.1.0-alpha.0
32
+
33
+ First publication. **This version parses and does not compute anything.**
34
+
35
+ A lexer, a parser, a syntax tree, and diagnostics carrying a code, a line, a
36
+ column and a fix. It will tell you whether a script is well formed. It will not
37
+ calculate a moving average, draw anything, or place an order.
38
+
39
+ It exists to reserve the name and to prove the release path while the stakes are a
40
+ placeholder, on the principle that automation which has never run is not
41
+ automation.
42
+
43
+ What is behind it: the language specification, a 143 entry error catalogue in
44
+ prose and machine readable form, the compiled program format, the host interface a
45
+ platform implements, a conformance suite design, twelve worked example scripts and
46
+ 72 pages of documentation. All twelve examples parse with no diagnostics, which
47
+ was the gate for this phase.
48
+
49
+ Published with no long lived credential. The checker and the engine are next.
package/README.md CHANGED
@@ -1,255 +1,267 @@
1
- <div align="center">
2
-
3
- # OpenScript
4
-
5
- **An open trading language. Write a study or a strategy once, plot it, backtest it, trade it.**
6
-
7
- Compiles in the browser in milliseconds with no build step and no `eval`, runs
8
- the same compiled program on a server, and is specified well enough that anyone
9
- can write their own engine for it.
10
-
11
- [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
12
- [![status](https://img.shields.io/badge/status-early%20development-orange.svg)](./ROADMAP.md)
13
-
14
- </div>
15
-
16
- ---
17
-
18
- ## Status
19
-
20
- Early development. The specification is being written first, and the
21
- implementation follows it. Nothing here is stable yet. Watch
22
- [ROADMAP.md](./ROADMAP.md) for what lands when.
23
-
24
- ## What it looks like
25
-
26
- ```
27
- study("EMA cross", overlay = true)
28
-
29
- fast = input(9, "Fast")
30
- slow = input(21, "Slow")
31
-
32
- ef = ema(close, fast)
33
- es = ema(close, slow)
34
-
35
- plot(ef, "Fast", aqua)
36
- plot(es, "Slow", orange)
37
-
38
- if crossUp(ef, es)
39
- signal("BUY")
40
- ```
41
-
42
- The same file becomes a strategy by adding orders:
43
-
44
- ```
45
- strategy("EMA cross", overlay = true)
46
-
47
- if crossUp(ef, es)
48
- buy(qty = 1)
49
-
50
- if crossDown(ef, es)
51
- close()
52
- ```
53
-
54
- One script. One set of numbers on the chart, in the backtest, and in the market.
55
-
56
- ## Why it exists
57
-
58
- Chart scripting today is closed. You write in someone's editor, your script runs
59
- on their servers under their limits, and the only way out is a webhook. The
60
- numbers you backtest are not the numbers you trade, and you cannot check either.
61
-
62
- OpenScript is the opposite of that:
63
-
64
- - **Yours.** Plain text files in a folder. Version control, diffs, your own editor.
65
- - **Local.** It compiles and runs on your machine. No execution quota, no loop
66
- timeout, no cap on how many things you may draw.
67
- - **Honest.** A higher timeframe read has to say whether it repaints. The
68
- compiler warns when a script would.
69
- - **Connected.** The same script places real orders through your own broker
70
- connection, on paper by default.
71
- - **Open.** Apache-2.0, a written specification, and a conformance suite anyone
72
- can run against their own implementation.
73
-
74
- ## How it is built
75
-
76
- The compiler does not emit JavaScript. It emits a **compiled program**: a plain
77
- data structure of instructions, defined by a versioned schema.
78
-
79
- That one decision carries the whole project:
80
-
81
- 1. It runs in a browser under a strict content security policy, with no `eval`
82
- and nothing for a security team to approve.
83
- 2. A server-side engine is a few hundred lines that walk an instruction list,
84
- not a second implementation of the language.
85
- 3. Anyone can write an engine in any language, and prove it correct by running
86
- the conformance suite.
87
-
88
- One compiler. One compiled format. Many small engines, all of which must agree
89
- to the last decimal.
90
-
91
- The same decision shapes the editor. This project ships the language
92
- intelligence as pure functions with no DOM: highlight, complete, diagnose, hover,
93
- signature, format. Highlighting comes from the real lexer, completions from the
94
- standard library manifest, and the errors you see while typing are the compiler's
95
- own, with their fixes taken from the error catalogue. A host supplies the text
96
- component and the panel around it, and keeps its own design. The editor is not a
97
- second implementation of the language to be kept in step.
98
-
99
- ```
100
- source text
101
- -> tokens
102
- -> tree
103
- -> checked tree (errors carry a code, a line and a fix)
104
- -> compiled program (plain data, versioned schema)
105
- -> any engine (browser, server, yours)
106
- ```
107
-
108
- ## The pieces, and which way they point
109
-
110
- A platform adopting OpenScript usually already has a chart, or an editor, or a
111
- broker connection, and sometimes all three. So the pieces are separate packages
112
- and the dependencies only ever point one way.
113
-
114
- ```
115
- openalgo-script a chart library
116
- (knows nobody) (knows nobody)
117
- | \ /
118
- | \ /
119
- | .../adapters/charts <- knows both. The only place that does
120
- |
121
- .../editor
122
- |
123
- .../adapters/codemirror <- knows the editor component. Nothing else does
124
- ```
125
-
126
- The language ships as one package with an entry point per tier, so a consumer who
127
- wants only the compiler never pays for an adapter. A tier is declared only once it
128
- exists: an entry point that resolves to nothing fails at a consumer's run time
129
- rather than honestly at install.
130
-
131
- | Entry point | Is | Depends on |
132
- |---|---|---|
133
- | `openalgo-script` | Compiler and engine | Nothing |
134
- | `openalgo-script/editor` | Highlight, complete, diagnose, hover, signature, format. No DOM | The compiler |
135
- | `openalgo-script/adapters/charts` | Turns a compiled study into a chart's indicator descriptor | The compiler and a chart |
136
- | `openalgo-script/adapters/codemirror` | A drop-in editor language package | The editor half and an editor component |
137
- | The Python engine, on its own index | The same compiled program, run on a server | Nothing |
138
-
139
- An adapter is the only thing allowed to know two worlds at once, which is what
140
- makes it the piece a platform replaces rather than the piece they patch. A
141
- platform with its own chart writes their own chart adapter and keeps everything
142
- else. A platform with its own editor does the same on that side.
143
-
144
- This is enforced rather than promised. `scripts/check-layering.mjs` runs in
145
- continuous integration and fails the build if the compiler imports a chart, if
146
- anything outside an adapter imports a package, or if the compiler or the editor
147
- half so much as mentions a browser global.
148
-
149
- ## Taking it, one step at a time
150
-
151
- Each row is usable on its own. Nobody has to take the next one.
152
-
153
- | You want | You add | Roughly |
154
- |---|---|---|
155
- | Scripts that produce numbers | `openalgo-script`, and the six-item host interface | An afternoon |
156
- | Those studies on your chart | the charts adapter, plus a chart | Days. Free if the chart is the one this adapter already targets |
157
- | Traders authoring in your app | `openalgo-script/editor`, and your own text component or the drop-in one | Days |
158
- | Traders trading from it | Wire the order half of the host interface to your order API | About a week |
159
- | To run it on your own stack | Implement the compiled program format in your language, then pass the conformance suite | Weeks |
160
-
161
- The last row is the one that matters for the standard. A platform that will not
162
- run our code at all reads the compiled program specification, writes its own
163
- engine, passes the suite, and its traders' scripts are the same scripts as
164
- everyone else's.
165
-
166
- ## What is guaranteed, and what proves it
167
-
168
- A platform's engineering review asks two questions about a dependency: what do you
169
- promise, and how would I know. This table is the answer to the second one. Where a
170
- row says a check enforces something, that check runs in continuous integration and
171
- fails the build.
172
-
173
- | Guarantee | How you can tell | Today |
174
- |---|---|---|
175
- | No `eval`, no generated code, runs under a strict content security policy | Grep the source. There is no code construction anywhere, and the compiler emits data | Enforced |
176
- | Zero runtime dependencies | `dependencies` is empty and stays empty | Enforced |
177
- | The pieces are separable: take the language without the chart, or the chart without the language | `scripts/check-layering.mjs`. The core may not import a package or touch a browser global | Enforced |
178
- | Small modules with a stated surface | `scripts/check-modularity.mjs`. A module's index is its only door | Enforced |
179
- | Every error is documented, with a code, a cause and a fix | `scripts/check-error-codes.mjs`, and the code type is generated from the catalogue so an invented code will not compile | Enforced |
180
- | No fact is stated in two places | `scripts/check-duplication.mjs` | Enforced, with recorded debt |
181
- | The compiled program is implementable without reading our code | `spec/compiled-program.md` and `spec/host-interface.md` | Written |
182
- | Two engines agree to the last decimal | The conformance suite, run against both. A disagreement blocks a release | Phase 6 gate |
183
- | A runaway script stops | Instruction, memory and wall clock budgets, enforced by the engine that owns the loop | Phase 2 gate |
184
- | A failing script does not take anything else down | One script's failure is a diagnostic on that script | Phase 2 gate |
185
- | A saved script never stops working | The language version is declared per file and old front ends are retained | Phase 7, with a test per retained version |
186
- | Performance | A benchmark with a number, in continuous integration | Phase 2 gate |
187
-
188
- The rows marked as gates are not promises we intend to keep. They are conditions a
189
- phase does not finish without, and each one is written into the roadmap beside the
190
- phase that owes it.
191
-
192
- ### Why a script cannot reach anything
193
-
194
- This is the row a security review spends its time on, so it is worth stating
195
- plainly rather than leaving as a property of the architecture.
196
-
197
- A compiled program is **data**. It is a list of instructions the engine walks. A
198
- script has no way to name a function the instruction set does not expose, so there
199
- is no call into the host, no network, no filesystem, no access to the object graph
200
- of the process it runs in. There is nothing to escape from, because nothing was
201
- ever handed over.
202
-
203
- That also makes the budgets real rather than best-effort. The engine owns the
204
- loop, so an instruction count per bar, a memory ceiling and a wall clock are
205
- counters in that loop rather than something to hope about. A platform running many
206
- customers' scripts in one process needs exactly this, and a design that generates
207
- code and runs it cannot offer it.
208
-
209
- ## The host interface
210
-
211
- Whatever a platform takes, it supplies six things and nothing more:
212
-
213
- 1. Bars: open, high, low, close, volume, time.
214
- 2. Instrument facts: tick size, lot size, session, timezone.
215
- 3. More bars on request, for another instrument or another timeframe.
216
- 4. Somewhere to draw.
217
- 5. Somewhere to send orders, if scripts are allowed to trade.
218
- 6. Somewhere to save settings.
219
-
220
- No instrument naming scheme, no exchange rules and no broker concepts appear in
221
- the language. A symbol is opaque to it: a script names a contract by what the
222
- contract is, and the platform resolves that to whatever its own symbology calls
223
- it. A format built around one market's derivatives means nothing on a crypto
224
- exchange, and portability is the entire objective.
225
-
226
- ## Errors
227
-
228
- Every error has a stable code, a message, the cause, the fix and an example,
229
- held in one machine-readable catalogue. The compiler, the editor and the
230
- documentation all read that same file, so the documentation cannot drift from
231
- the compiler. The build fails if an error exists without a documented entry, or
232
- an entry without a test.
233
-
234
- ## Documentation
235
-
236
- - [ROADMAP.md](./ROADMAP.md) - what is being built, in what order
237
- - [docs/](./docs) - guides, once there is something to guide
238
- - [spec/](./spec) - the language specification and the compiled program schema
239
- - [CONTRIBUTING.md](./CONTRIBUTING.md) - how to work on this
240
- - [RELEASING.md](./RELEASING.md) - how a release is published, and the one manual step that cannot be automated
241
-
242
- ## Licence
243
-
244
- Apache-2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).
245
-
246
- Apache-2.0 was chosen deliberately over a copyleft licence. A trading platform
247
- that wants to embed OpenScript must be able to do so without publishing its own
248
- source, or the language cannot become a shared standard.
249
-
250
- ## A note on independence
251
-
252
- OpenScript is an independent open source language. It is not affiliated with,
253
- sponsored by, or endorsed by any charting or trading platform, and it is not a
254
- reimplementation of any existing product. Its specification, its documentation
255
- and its error text are original work.
1
+ <div align="center">
2
+
3
+ # OpenScript
4
+
5
+ **An open trading language. Write a study or a strategy once, plot it, backtest it, trade it.**
6
+
7
+ Compiles in the browser in milliseconds with no build step and no `eval`, runs
8
+ the same compiled program on a server, and is specified well enough that anyone
9
+ can write their own engine for it.
10
+
11
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
12
+ [![status](https://img.shields.io/badge/status-early%20development-orange.svg)](./ROADMAP.md)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## Status
19
+
20
+ **`0.1.0-alpha.0` parses. It does not yet compute anything.**
21
+
22
+ That is the honest description of what an install gets you today: a lexer, a
23
+ parser, a syntax tree, and diagnostics carrying a code, a line, a column and a
24
+ fix. It will tell you whether a script is well formed. It will not calculate a
25
+ moving average, draw anything, or place an order.
26
+
27
+ The registry shows this version under `latest` only because a package must have
28
+ one and this is the first release. The `-alpha.0` on the version is the part to
29
+ read.
30
+
31
+ The checker and the engine are Phase 2, and the roadmap says what each phase owes
32
+ before it is allowed to finish. The specification is written first and the
33
+ implementation follows it, which is why there is a great deal more specification
34
+ here than there is compiler.
35
+
36
+ ## What it looks like
37
+
38
+ ```
39
+ study("EMA cross", overlay = true)
40
+
41
+ fast = input(9, "Fast")
42
+ slow = input(21, "Slow")
43
+
44
+ ef = ema(close, fast)
45
+ es = ema(close, slow)
46
+
47
+ plot(ef, "Fast", aqua)
48
+ plot(es, "Slow", orange)
49
+
50
+ if crossUp(ef, es)
51
+ signal("BUY")
52
+ ```
53
+
54
+ The same file becomes a strategy by adding orders:
55
+
56
+ ```
57
+ strategy("EMA cross", overlay = true)
58
+
59
+ if crossUp(ef, es)
60
+ buy(qty = 1)
61
+
62
+ if crossDown(ef, es)
63
+ close()
64
+ ```
65
+
66
+ One script. One set of numbers on the chart, in the backtest, and in the market.
67
+
68
+ ## Why it exists
69
+
70
+ Chart scripting today is closed. You write in someone's editor, your script runs
71
+ on their servers under their limits, and the only way out is a webhook. The
72
+ numbers you backtest are not the numbers you trade, and you cannot check either.
73
+
74
+ OpenScript is the opposite of that:
75
+
76
+ - **Yours.** Plain text files in a folder. Version control, diffs, your own editor.
77
+ - **Local.** It compiles and runs on your machine. No execution quota, no loop
78
+ timeout, no cap on how many things you may draw.
79
+ - **Honest.** A higher timeframe read has to say whether it repaints. The
80
+ compiler warns when a script would.
81
+ - **Connected.** The same script places real orders through your own broker
82
+ connection, on paper by default.
83
+ - **Open.** Apache-2.0, a written specification, and a conformance suite anyone
84
+ can run against their own implementation.
85
+
86
+ ## How it is built
87
+
88
+ The compiler does not emit JavaScript. It emits a **compiled program**: a plain
89
+ data structure of instructions, defined by a versioned schema.
90
+
91
+ That one decision carries the whole project:
92
+
93
+ 1. It runs in a browser under a strict content security policy, with no `eval`
94
+ and nothing for a security team to approve.
95
+ 2. A server-side engine is a few hundred lines that walk an instruction list,
96
+ not a second implementation of the language.
97
+ 3. Anyone can write an engine in any language, and prove it correct by running
98
+ the conformance suite.
99
+
100
+ One compiler. One compiled format. Many small engines, all of which must agree
101
+ to the last decimal.
102
+
103
+ The same decision shapes the editor. This project ships the language
104
+ intelligence as pure functions with no DOM: highlight, complete, diagnose, hover,
105
+ signature, format. Highlighting comes from the real lexer, completions from the
106
+ standard library manifest, and the errors you see while typing are the compiler's
107
+ own, with their fixes taken from the error catalogue. A host supplies the text
108
+ component and the panel around it, and keeps its own design. The editor is not a
109
+ second implementation of the language to be kept in step.
110
+
111
+ ```
112
+ source text
113
+ -> tokens
114
+ -> tree
115
+ -> checked tree (errors carry a code, a line and a fix)
116
+ -> compiled program (plain data, versioned schema)
117
+ -> any engine (browser, server, yours)
118
+ ```
119
+
120
+ ## The pieces, and which way they point
121
+
122
+ A platform adopting OpenScript usually already has a chart, or an editor, or a
123
+ broker connection, and sometimes all three. So the pieces are separate packages
124
+ and the dependencies only ever point one way.
125
+
126
+ ```
127
+ openalgo-script a chart library
128
+ (knows nobody) (knows nobody)
129
+ | \ /
130
+ | \ /
131
+ | .../adapters/charts <- knows both. The only place that does
132
+ |
133
+ .../editor
134
+ |
135
+ .../adapters/codemirror <- knows the editor component. Nothing else does
136
+ ```
137
+
138
+ The language ships as one package with an entry point per tier, so a consumer who
139
+ wants only the compiler never pays for an adapter. A tier is declared only once it
140
+ exists: an entry point that resolves to nothing fails at a consumer's run time
141
+ rather than honestly at install.
142
+
143
+ | Entry point | Is | Depends on |
144
+ |---|---|---|
145
+ | `openalgo-script` | Compiler and engine | Nothing |
146
+ | `openalgo-script/editor` | Highlight, complete, diagnose, hover, signature, format. No DOM | The compiler |
147
+ | `openalgo-script/adapters/charts` | Turns a compiled study into a chart's indicator descriptor | The compiler and a chart |
148
+ | `openalgo-script/adapters/codemirror` | A drop-in editor language package | The editor half and an editor component |
149
+ | The Python engine, on its own index | The same compiled program, run on a server | Nothing |
150
+
151
+ An adapter is the only thing allowed to know two worlds at once, which is what
152
+ makes it the piece a platform replaces rather than the piece they patch. A
153
+ platform with its own chart writes their own chart adapter and keeps everything
154
+ else. A platform with its own editor does the same on that side.
155
+
156
+ This is enforced rather than promised. `scripts/check-layering.mjs` runs in
157
+ continuous integration and fails the build if the compiler imports a chart, if
158
+ anything outside an adapter imports a package, or if the compiler or the editor
159
+ half so much as mentions a browser global.
160
+
161
+ ## Taking it, one step at a time
162
+
163
+ Each row is usable on its own. Nobody has to take the next one.
164
+
165
+ | You want | You add | Roughly |
166
+ |---|---|---|
167
+ | Scripts that produce numbers | `openalgo-script`, and the six-item host interface | An afternoon |
168
+ | Those studies on your chart | the charts adapter, plus a chart | Days. Free if the chart is the one this adapter already targets |
169
+ | Traders authoring in your app | `openalgo-script/editor`, and your own text component or the drop-in one | Days |
170
+ | Traders trading from it | Wire the order half of the host interface to your order API | About a week |
171
+ | To run it on your own stack | Implement the compiled program format in your language, then pass the conformance suite | Weeks |
172
+
173
+ The last row is the one that matters for the standard. A platform that will not
174
+ run our code at all reads the compiled program specification, writes its own
175
+ engine, passes the suite, and its traders' scripts are the same scripts as
176
+ everyone else's.
177
+
178
+ ## What is guaranteed, and what proves it
179
+
180
+ A platform's engineering review asks two questions about a dependency: what do you
181
+ promise, and how would I know. This table is the answer to the second one. Where a
182
+ row says a check enforces something, that check runs in continuous integration and
183
+ fails the build.
184
+
185
+ | Guarantee | How you can tell | Today |
186
+ |---|---|---|
187
+ | No `eval`, no generated code, runs under a strict content security policy | Grep the source. There is no code construction anywhere, and the compiler emits data | Enforced |
188
+ | Zero runtime dependencies | `dependencies` is empty and stays empty | Enforced |
189
+ | The pieces are separable: take the language without the chart, or the chart without the language | `scripts/check-layering.mjs`. The core may not import a package or touch a browser global | Enforced |
190
+ | Small modules with a stated surface | `scripts/check-modularity.mjs`. A module's index is its only door | Enforced |
191
+ | Every error is documented, with a code, a cause and a fix | `scripts/check-error-codes.mjs`, and the code type is generated from the catalogue so an invented code will not compile | Enforced |
192
+ | No fact is stated in two places | `scripts/check-duplication.mjs` | Enforced, with recorded debt |
193
+ | The compiled program is implementable without reading our code | `spec/compiled-program.md` and `spec/host-interface.md` | Written |
194
+ | Two engines agree to the last decimal | The conformance suite, run against both. A disagreement blocks a release | Phase 6 gate |
195
+ | A runaway script stops | Instruction, memory and wall clock budgets, enforced by the engine that owns the loop | Phase 2 gate |
196
+ | A failing script does not take anything else down | One script's failure is a diagnostic on that script | Phase 2 gate |
197
+ | A saved script never stops working | The language version is declared per file and old front ends are retained | Phase 7, with a test per retained version |
198
+ | Performance | A benchmark with a number, in continuous integration | Phase 2 gate |
199
+
200
+ The rows marked as gates are not promises we intend to keep. They are conditions a
201
+ phase does not finish without, and each one is written into the roadmap beside the
202
+ phase that owes it.
203
+
204
+ ### Why a script cannot reach anything
205
+
206
+ This is the row a security review spends its time on, so it is worth stating
207
+ plainly rather than leaving as a property of the architecture.
208
+
209
+ A compiled program is **data**. It is a list of instructions the engine walks. A
210
+ script has no way to name a function the instruction set does not expose, so there
211
+ is no call into the host, no network, no filesystem, no access to the object graph
212
+ of the process it runs in. There is nothing to escape from, because nothing was
213
+ ever handed over.
214
+
215
+ That also makes the budgets real rather than best-effort. The engine owns the
216
+ loop, so an instruction count per bar, a memory ceiling and a wall clock are
217
+ counters in that loop rather than something to hope about. A platform running many
218
+ customers' scripts in one process needs exactly this, and a design that generates
219
+ code and runs it cannot offer it.
220
+
221
+ ## The host interface
222
+
223
+ Whatever a platform takes, it supplies six things and nothing more:
224
+
225
+ 1. Bars: open, high, low, close, volume, time.
226
+ 2. Instrument facts: tick size, lot size, session, timezone.
227
+ 3. More bars on request, for another instrument or another timeframe.
228
+ 4. Somewhere to draw.
229
+ 5. Somewhere to send orders, if scripts are allowed to trade.
230
+ 6. Somewhere to save settings.
231
+
232
+ No instrument naming scheme, no exchange rules and no broker concepts appear in
233
+ the language. A symbol is opaque to it: a script names a contract by what the
234
+ contract is, and the platform resolves that to whatever its own symbology calls
235
+ it. A format built around one market's derivatives means nothing on a crypto
236
+ exchange, and portability is the entire objective.
237
+
238
+ ## Errors
239
+
240
+ Every error has a stable code, a message, the cause, the fix and an example,
241
+ held in one machine-readable catalogue. The compiler, the editor and the
242
+ documentation all read that same file, so the documentation cannot drift from
243
+ the compiler. The build fails if an error exists without a documented entry, or
244
+ an entry without a test.
245
+
246
+ ## Documentation
247
+
248
+ - [ROADMAP.md](./ROADMAP.md) - what is being built, in what order
249
+ - [docs/](./docs) - guides, once there is something to guide
250
+ - [spec/](./spec) - the language specification and the compiled program schema
251
+ - [CONTRIBUTING.md](./CONTRIBUTING.md) - how to work on this
252
+ - [RELEASING.md](./RELEASING.md) - how a release is published, and the one manual step that cannot be automated
253
+
254
+ ## Licence
255
+
256
+ Apache-2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).
257
+
258
+ Apache-2.0 was chosen deliberately over a copyleft licence. A trading platform
259
+ that wants to embed OpenScript must be able to do so without publishing its own
260
+ source, or the language cannot become a shared standard.
261
+
262
+ ## A note on independence
263
+
264
+ OpenScript is an independent open source language. It is not affiliated with,
265
+ sponsored by, or endorsed by any charting or trading platform, and it is not a
266
+ reimplementation of any existing product. Its specification, its documentation
267
+ and its error text are original work.
@@ -25,4 +25,5 @@ export type { Argument, ArithmeticOperator, ArrayLiteral, ArrayType, Assignment,
25
25
  export { ARITHMETIC_OPERATORS, ASSIGNMENT_OPERATORS, COMPARISON_OPERATORS, EQUALITY_OPERATORS, LOGICAL_OPERATORS, OBJECT_TYPE_NAMES, UNARY_OPERATORS, VALUE_TYPE_NAMES, binaryPrecedence, childrenOf, isExpression, isObjectTypeName, isStatement, isTypeAnnotation, isValueTypeName, makeNode, nodeAtOffset, pathAtOffset, typeAnnotationText, walk, withoutGrouping, } from './ast/index.js';
26
26
  export { lex } from './lex/index.js';
27
27
  export { parse, parseTokens } from './parse/index.js';
28
+ export { COMPILED_FORMAT_VERSION, VERSION } from './version/index.js';
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhF,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,KAAK,EACL,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,cAAc,EACd,KAAK,EACL,cAAc,EACd,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,EACL,UAAU,EACV,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,eAAe,EACf,OAAO,EACP,YAAY,EACZ,cAAc,EACd,KAAK,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,OAAO,EACP,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,IAAI,EACJ,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhF,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,KAAK,EACL,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,cAAc,EACd,KAAK,EACL,cAAc,EACd,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,EACL,UAAU,EACV,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,eAAe,EACf,OAAO,EACP,YAAY,EACZ,cAAc,EACd,KAAK,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,OAAO,EACP,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,IAAI,EACJ,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
@@ -19,4 +19,5 @@ export { PUNCTUATORS, RESERVED_WORDS } from './tokens/index.js';
19
19
  export { ARITHMETIC_OPERATORS, ASSIGNMENT_OPERATORS, COMPARISON_OPERATORS, EQUALITY_OPERATORS, LOGICAL_OPERATORS, OBJECT_TYPE_NAMES, UNARY_OPERATORS, VALUE_TYPE_NAMES, binaryPrecedence, childrenOf, isExpression, isObjectTypeName, isStatement, isTypeAnnotation, isValueTypeName, makeNode, nodeAtOffset, pathAtOffset, typeAnnotationText, walk, withoutGrouping, } from './ast/index.js';
20
20
  export { lex } from './lex/index.js';
21
21
  export { parse, parseTokens } from './parse/index.js';
22
+ export { COMPILED_FORMAT_VERSION, VERSION } from './version/index.js';
22
23
  //# sourceMappingURL=index.js.map