@onda-lang/binaryen-web 0.7.5 → 0.8.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/README.md +15 -5
- package/api.md +407 -0
- package/package.json +4 -2
- package/src/compiler/core.js +2544 -0
- package/src/compiler/index.js +1900 -0
- package/src/compiler/lowering.js +2297 -0
- package/src/compiler/shared.js +247 -0
- package/src/constants.js +1 -1
- package/src/index.js +1 -6012
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Onda Binaryen Web Backend
|
|
2
2
|
|
|
3
|
+
See [api.md](api.md) for the complete public Web API shared with the released package.
|
|
4
|
+
|
|
3
5
|
This package consumes Onda's versioned MIR as compact MessagePack, JSON, or an already-decoded
|
|
4
6
|
object and emits an executable WebAssembly DSP module with Binaryen.js. It runs in browsers and Node
|
|
5
7
|
without LLVM, `wasm-ld`, or an Onda toolchain in the code-generation environment.
|
|
@@ -30,14 +32,20 @@ such a boundary would need to reproduce every invariant enforced by `onda_mir`.
|
|
|
30
32
|
a JSON string, a MessagePack `ArrayBuffer`/typed-array view, or a decoded object. JSON remains useful
|
|
31
33
|
for inspection; the browser compiler and test corpus use MessagePack as the production transport.
|
|
32
34
|
|
|
33
|
-
The generated module exports `memory`, `__heap_base`,
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
The generated module exports `memory`, `__heap_base`,
|
|
36
|
+
the 8-argument `onda_processor_init(params_ptr, state_ptr, mode, buffers_ptr,
|
|
37
|
+
buffer_frames_ptr, buffer_channels_ptr, buffer_sample_rates_ptr, output_ptr)`, the 12-argument processor
|
|
38
|
+
`onda_process`, and one `onda_event_N` function per declared event. Init, process, and event entries
|
|
39
|
+
take an optional call-scoped execution-output pointer carrying independent delegate and print
|
|
40
|
+
batches. Each function returns zero on success or a positive generated execution-failure code. These are
|
|
36
41
|
the complete wasm32-module profile of the generic
|
|
37
42
|
[`Onda processor ABI`](../../docs/processor-abi.md), not a Web Audio-specific interface. The host
|
|
38
43
|
owns allocation in linear memory. Metadata contains resolved target/integration facts,
|
|
39
44
|
state/parameter layouts, state-backed control-output offsets, flattened audio-port channels, packed
|
|
40
|
-
event payload layouts, and all exported ABI names.
|
|
45
|
+
event/delegate payload layouts, print log sites, source tables, and all exported ABI names. See
|
|
46
|
+
the internal [delegate host integration](../../docs/delegates.md) and
|
|
47
|
+
[print host integration](../../docs/printing.md) references for batch sizing, decoding, formatting,
|
|
48
|
+
and overflow handling.
|
|
41
49
|
|
|
42
50
|
`createProcessorArtifactFiles()` validates the final module, computes a SHA-256 digest, and returns
|
|
43
51
|
a reusable `.wasm` plus `.onda.json` descriptor pair. `validateProcessorArtifact`,
|
|
@@ -68,7 +76,7 @@ The backend also supports primitive slice locals and reference arguments, event
|
|
|
68
76
|
|
|
69
77
|
The MIR schema defines three ordered `i32` process parameters:
|
|
70
78
|
`(start_frame, frames, flags)`. `process_frame(offset)` is the checked source of audio-I/O
|
|
71
|
-
addresses. The public
|
|
79
|
+
addresses. The public 12-argument `onda_process` export keeps full-block base pointers and accepts
|
|
72
80
|
any segment contained in the configured block. BEGIN and END flags independently gate block hooks;
|
|
73
81
|
they do not assert a position or maintain a hidden ABI cursor, and zero-frame calls are valid. The
|
|
74
82
|
reference AudioWorklet maintains its own compile-block cursor so Web Audio render quanta may be
|
|
@@ -78,6 +86,8 @@ continuous.
|
|
|
78
86
|
Emitted metadata distinguishes physical Wasm state storage from the packed persistent snapshot:
|
|
79
87
|
`runtime.state_size_bytes` sizes linear-memory state, while `runtime.snapshot_size_bytes` and
|
|
80
88
|
`metadata.states` describe the deterministic scratch-free snapshot layout shared with native MIR.
|
|
89
|
+
Snapshot entries carry an `authored` flag so compiler-owned task frames remain serializable without
|
|
90
|
+
being presented as user-authored state reflection.
|
|
81
91
|
|
|
82
92
|
Core WebAssembly has no scalar fused multiply-add or transcendental instructions. The backend
|
|
83
93
|
therefore links only the required closure from an embedded, pure-Wasm math kernel into each DSP
|
package/api.md
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
<!-- Generated from docs/web-api.md; do not edit this packaged copy. -->
|
|
2
|
+
|
|
3
|
+
# Web API reference
|
|
4
|
+
|
|
5
|
+
Onda publishes four ECMAScript-module packages for browsers and Node.js:
|
|
6
|
+
|
|
7
|
+
| Package | Purpose |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `@onda-lang/wasm-compiler` | Compile Onda source, workspaces, and project images to complete WebAssembly processor artifacts. |
|
|
10
|
+
| `@onda-lang/processor-abi` | Validate artifacts, inspect metadata, prepare parameter controls, and decode raw delegate and print output. |
|
|
11
|
+
| `@onda-lang/binaryen-web` | Lower trusted, version-matched Onda MIR directly to a processor artifact. |
|
|
12
|
+
| `@onda-lang/webaudio` | Host a complete processor artifact in an `AudioWorklet`. |
|
|
13
|
+
|
|
14
|
+
All packages are ESM-only. `@onda-lang/wasm-compiler` and `@onda-lang/binaryen-web` support modern
|
|
15
|
+
browsers and Node.js 20 or newer. Web Audio construction requires a browser environment with
|
|
16
|
+
`AudioWorklet`; the metadata and parameter helpers re-exported by `@onda-lang/webaudio` are ordinary
|
|
17
|
+
synchronous JavaScript.
|
|
18
|
+
|
|
19
|
+
Each published package contains this reference as `api.md`. TypeScript declarations are included
|
|
20
|
+
at every exported module path.
|
|
21
|
+
|
|
22
|
+
## Compile source and start audio
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { createCompiler } from "@onda-lang/wasm-compiler";
|
|
26
|
+
import {
|
|
27
|
+
createOndaAudioProcessorInitialized,
|
|
28
|
+
} from "@onda-lang/webaudio";
|
|
29
|
+
|
|
30
|
+
const compiler = await createCompiler();
|
|
31
|
+
const { artifact } = await compiler.compileSource(source, {
|
|
32
|
+
sampleRate: audioContext.sampleRate,
|
|
33
|
+
blockSize: 128,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const print = ({ text }) => console.debug(text);
|
|
37
|
+
const processor = await createOndaAudioProcessorInitialized(
|
|
38
|
+
audioContext,
|
|
39
|
+
artifact,
|
|
40
|
+
{
|
|
41
|
+
params: { gain: 0.5 },
|
|
42
|
+
// A construction-time listener also receives prints emitted by init.
|
|
43
|
+
onPrint: print,
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
processor.node.connect(audioContext.destination);
|
|
47
|
+
|
|
48
|
+
const stopDelegates = processor.onDelegates(({ occurrences }) => {
|
|
49
|
+
for (const occurrence of occurrences) {
|
|
50
|
+
console.log(occurrence.name, occurrence.values);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Compilation is an offline operation and may allocate. Constructing the adapter compiles or accepts
|
|
56
|
+
a reusable `WebAssembly.Module` before the audio node starts. Normal rendering uses preallocated
|
|
57
|
+
storage. Delegate and print callbacks run on the main side after bounded worklet transport; they do
|
|
58
|
+
not call JavaScript from generated DSP execution.
|
|
59
|
+
|
|
60
|
+
## `@onda-lang/wasm-compiler`
|
|
61
|
+
|
|
62
|
+
### `createCompiler(options?)`
|
|
63
|
+
|
|
64
|
+
Creates an `OndaCompilerInstance`. With no options, compilation runs directly on the calling
|
|
65
|
+
JavaScript thread. Pass `{ worker: true }` to run the frontend and backend in a module worker;
|
|
66
|
+
`workerUrl`, `frontendWasm`, and a custom `Worker` constructor are optional integration hooks.
|
|
67
|
+
|
|
68
|
+
The returned instance provides:
|
|
69
|
+
|
|
70
|
+
- `compileSource(source, options?)` and `inspectSourceConstants(source, options?)`.
|
|
71
|
+
- `compileWorkspace(workspace, options?)` and `inspectWorkspaceConstants(workspace, options?)`.
|
|
72
|
+
- `compileProjectImage(bytes, options?)` and `inspectProjectImageConstants(bytes, options?)`.
|
|
73
|
+
- `createProjectImage(sourceGraph, buffers?)`, `inspectProjectImage(bytes)`,
|
|
74
|
+
`loadProjectFiles(files, projectFilePath?)`, and `materializeProjectImage(bytes, names?)`.
|
|
75
|
+
- `encodeBufferAsset(binding)`, `decodeBufferAsset(bytes)`, and `decodeBufferFile(bytes, path?)`.
|
|
76
|
+
- `projectCapabilities()` for supported image, buffer, and standard-library versions.
|
|
77
|
+
- `sendLspMessage(message)` and `setLspAnalysisOptions(options?)` for the embedded language server.
|
|
78
|
+
- `dispose()`, an idempotent terminal release of compiler and worker resources.
|
|
79
|
+
|
|
80
|
+
Compile options accept `sampleRate`, `blockSize`, typed compile-constant overrides, and `codegen`.
|
|
81
|
+
Code generation can select optimization level `0..4`, shrink level `0..2`, strict or fast math,
|
|
82
|
+
SIMD, loop-containing inlining, and optional WAT emission. A successful compilation returns an
|
|
83
|
+
`OndaCompilationResult` containing the artifact, resolved source paths, and the exact source graph
|
|
84
|
+
when one is available.
|
|
85
|
+
|
|
86
|
+
Configuration and lifecycle failures throw `OndaCompilerError`. Authored-source, project, MIR, and
|
|
87
|
+
code-generation failures throw `OndaCompileError`, whose `diagnostics`, `sourceFiles`, and
|
|
88
|
+
`unresolvedSourceFiles` fields support editors and file watchers. `OndaBinaryenError` identifies a
|
|
89
|
+
failure in the MIR-to-Wasm backend.
|
|
90
|
+
|
|
91
|
+
`MIR_SCHEMA_VERSION` is the schema accepted by the bundled backend. `ONDA_VERSION` is the compiler
|
|
92
|
+
version. `createDefaultImports()` returns the imports required by current generated modules; it is
|
|
93
|
+
currently an empty object because artifacts are self-contained.
|
|
94
|
+
|
|
95
|
+
The `@onda-lang/wasm-compiler/artifact` subpath re-exports the complete
|
|
96
|
+
`@onda-lang/processor-abi` surface without loading the compiler. The
|
|
97
|
+
`@onda-lang/wasm-compiler/worker` subpath is a side-effect-only module-worker entry and has no
|
|
98
|
+
named exports.
|
|
99
|
+
|
|
100
|
+
## `@onda-lang/processor-abi`
|
|
101
|
+
|
|
102
|
+
An `OndaProcessorArtifact` contains WebAssembly bytes, an `OndaProcessorMetadata` descriptor, and
|
|
103
|
+
optional WAT. Treat the bytes and descriptor as one integrity-associated pair.
|
|
104
|
+
|
|
105
|
+
### Validation and files
|
|
106
|
+
|
|
107
|
+
- `validateProcessorMetadata(metadata, expectedKind?)` validates and returns the current descriptor.
|
|
108
|
+
- `validateProcessorArtifact(artifact, options?)` normalizes bytes and optionally inspects the module.
|
|
109
|
+
- `validateProcessorModule(module, metadata)` verifies a precompiled module against its descriptor.
|
|
110
|
+
- `parseProcessorMetadata(input, expectedKind?)` parses JSON or validates an object.
|
|
111
|
+
- `serializeProcessorMetadata(metadata, space?)` validates before producing newline-terminated JSON.
|
|
112
|
+
- `createProcessorArtifactFiles(artifact, options?)` creates associated `.wasm` and `.onda.json`
|
|
113
|
+
records, including integrity metadata.
|
|
114
|
+
- `loadProcessorArtifactFiles(wasm, metadata)` validates a loaded pair and its integrity association.
|
|
115
|
+
|
|
116
|
+
Failures throw `OndaArtifactError`. Hosts must reject unsupported artifact-format, ABI, and snapshot
|
|
117
|
+
versions rather than guessing layout compatibility.
|
|
118
|
+
|
|
119
|
+
### Parameter controls
|
|
120
|
+
|
|
121
|
+
`createParamControl(metadata)` validates one scalar parameter descriptor and returns a reusable
|
|
122
|
+
`OndaPreparedParamControl`. `createParamDomain(domain)` does the same from already-decoded values.
|
|
123
|
+
Prepared controls expose `constrainPlain`, `normalizedToPlain`, and `plainToNormalized` methods.
|
|
124
|
+
|
|
125
|
+
The one-shot `constrainParamPlain`, `paramNormalizedToPlain`, and `paramPlainToNormalized`
|
|
126
|
+
functions provide the same behavior. Preparing once is preferable for frequently updated UI:
|
|
127
|
+
validation and decimal descriptor decoding stay off the interaction path. Mappings preserve exact
|
|
128
|
+
endpoints, apply linear, logarithmic, or curved scale, and clamp and snap to the declared grid.
|
|
129
|
+
|
|
130
|
+
### Delegates and print output
|
|
131
|
+
|
|
132
|
+
Complete wasm32 processor exports receive an optional execution-output descriptor containing
|
|
133
|
+
independently nullable delegate and print batches. Allocate all descriptors and storage before
|
|
134
|
+
real-time execution.
|
|
135
|
+
|
|
136
|
+
`writeDelegateBatch` and `writePrintBatch` initialize reusable batch descriptors.
|
|
137
|
+
`writeExecutionOutput` connects their addresses. Call `resetExecutionOutput` immediately before
|
|
138
|
+
every generated init, process, or event entry. After a successful generated call,
|
|
139
|
+
`readDelegateBatch` or `readPrintBatch` validates the result counters.
|
|
140
|
+
`decodeDelegateRecords` converts delegate payloads using `metadata.delegates`.
|
|
141
|
+
`decodePrintRecords` preserves primitive types and source sites; `formatPrintRecords` and
|
|
142
|
+
`formatPrintBatch` add canonical text formatting. Both decoded record types expose a `sequence` from
|
|
143
|
+
the host-reset call-local counter; merge that call's two arrays by this field when presenting one
|
|
144
|
+
chronological output stream.
|
|
145
|
+
|
|
146
|
+
Batch capacity is host policy. `overflowCount` reports whole records that did not fit; it is not a
|
|
147
|
+
byte count. Consume the returned storage before reusing it for another init, process, or event call.
|
|
148
|
+
See the [language guide](https://onda-lang.org/docs/language/#delegates) for authored semantics and
|
|
149
|
+
the [processor API](https://onda-lang.org/docs/processor-api/#call-scoped-execution-output) for
|
|
150
|
+
physical record layout.
|
|
151
|
+
|
|
152
|
+
The metadata interfaces expose target facts, storage sizes, ports, parameters, states, events,
|
|
153
|
+
delegates, print sites, buffers, and integration profiles. Scalar `i64` values decoded from records
|
|
154
|
+
use `bigint`; booleans use `boolean`; fixed arrays and slices become JavaScript arrays.
|
|
155
|
+
|
|
156
|
+
## `@onda-lang/binaryen-web`
|
|
157
|
+
|
|
158
|
+
### `compileTrustedMir(mir, options?)`
|
|
159
|
+
|
|
160
|
+
Lowers MIR emitted by the matching Onda semantic frontend. Input may be compact MessagePack, JSON,
|
|
161
|
+
or an already-decoded object. The function is synchronous and returns an
|
|
162
|
+
`OndaProcessorArtifact`. It is intentionally not a validator for untrusted or hand-authored MIR;
|
|
163
|
+
the producer owns semantic, type, bounds, and resource proofs.
|
|
164
|
+
|
|
165
|
+
`OndaBinaryenOptions` controls the same backend policies exposed through compiler `codegen`.
|
|
166
|
+
`SUPPORTED_MIR_SCHEMA_VERSION` identifies the required producer schema. `createDefaultImports()`
|
|
167
|
+
returns an empty object for current self-contained artifacts. Backend failures throw
|
|
168
|
+
`OndaBinaryenError`.
|
|
169
|
+
|
|
170
|
+
The package root re-exports the common artifact validation and file helpers. The
|
|
171
|
+
`@onda-lang/binaryen-web/artifact` subpath re-exports the complete
|
|
172
|
+
`@onda-lang/processor-abi` module without loading Binaryen.
|
|
173
|
+
|
|
174
|
+
## `@onda-lang/webaudio`
|
|
175
|
+
|
|
176
|
+
### Construction
|
|
177
|
+
|
|
178
|
+
- `registerOndaAudioWorklet(context, workletUrl?)` registers the processor once per context.
|
|
179
|
+
- `compileOndaProcessorModule(artifact)` validates and compiles a reusable module off the render thread.
|
|
180
|
+
- `ondaAudioWorkletNodeOptions(artifact, options?)` builds low-level node options.
|
|
181
|
+
- `createOndaAudioProcessor(context, artifact, options?)` allocates an uninitialized adapter.
|
|
182
|
+
- `createOndaAudioProcessorInitialized(context, artifact, options?)` allocates and fully initializes it.
|
|
183
|
+
- `flattenedAudioChannelCount(ports?)` totals declared physical channels with validation.
|
|
184
|
+
|
|
185
|
+
`OndaAudioProcessorOptions` accepts initial plain parameter values, external buffers, event,
|
|
186
|
+
delegate, and print capacities, an optional construction-time `onPrint` listener, a precompiled
|
|
187
|
+
module, custom node options, and an `AudioWorkletNode` constructor. Pass `onPrint` when using the
|
|
188
|
+
initialized constructor if initialization output must be observed; registering a listener after
|
|
189
|
+
construction cannot replay output from an execution that has already completed. The artifact sample
|
|
190
|
+
rate must equal the context sample rate and it must expose at least one audio input or output.
|
|
191
|
+
Print and delegate delivery uses a bounded `SharedArrayBuffer` ring and requires cross-origin
|
|
192
|
+
isolation in browsers; ordinary audio processing remains available when shared memory is absent.
|
|
193
|
+
Low-level callers that manually pair the returned node options with `OndaAudioProcessor` must pass
|
|
194
|
+
`processorOptions.executionOutputRing` as the adapter constructor's fourth argument.
|
|
195
|
+
|
|
196
|
+
### `OndaAudioProcessor`
|
|
197
|
+
|
|
198
|
+
The adapter exposes its `node` and validated `metadata`, plus these operations:
|
|
199
|
+
|
|
200
|
+
- `setParam(nameOrIndex, plain)` and `setParamNormalized(nameOrIndex, normalized)`.
|
|
201
|
+
- `trigger(nameOrIndex, values?)` for input events.
|
|
202
|
+
- `onDelegates(listener)` and `onPrint(listener)`, each returning an unsubscribe function.
|
|
203
|
+
- `init(mode)`, `snapshot()`, and `restoreSnapshot(bytes)`.
|
|
204
|
+
- `readControlOutputs()` and `readBuffer(nameOrIndex)`.
|
|
205
|
+
- `request(type, fields?, transfer?)` for adapter protocol extensions.
|
|
206
|
+
- `close(reason?)`, an idempotent terminal release of adapter-side resources.
|
|
207
|
+
|
|
208
|
+
Delegate and print batches report `overflowCount` for generated-storage loss and
|
|
209
|
+
`transportDropCount` for bounded worklet-to-main queue loss. Loss-only notifications can arrive
|
|
210
|
+
without occurrences. Collection is enabled only while the corresponding listener set is nonempty;
|
|
211
|
+
setting the capacity to zero disables host delivery even with listeners while preserving language
|
|
212
|
+
evaluation semantics.
|
|
213
|
+
|
|
214
|
+
With both listener types active, the adapter invokes them in call-local sequence order and may split
|
|
215
|
+
a same-stream batch around an intervening occurrence from the other stream. Ordering resets for
|
|
216
|
+
each init, event, or process segment.
|
|
217
|
+
|
|
218
|
+
`ONDA_INIT_FULL` clears and initializes all physical state. `ONDA_INIT_PRESERVE_PINNED` retains
|
|
219
|
+
pinned state according to the processor ABI. The package also re-exports the prepared and one-shot
|
|
220
|
+
parameter conversion helpers.
|
|
221
|
+
|
|
222
|
+
`@onda-lang/webaudio/worklet` is the side-effect-only AudioWorklet registration module and has no
|
|
223
|
+
named exports.
|
|
224
|
+
|
|
225
|
+
## Complete exported surface
|
|
226
|
+
|
|
227
|
+
The following indexes include runtime values and TypeScript-only types from each package root.
|
|
228
|
+
They are checked against the shipped declarations so additions cannot silently escape this
|
|
229
|
+
reference. Artifact subpaths are complete processor-ABI re-exports; worker and worklet subpaths are
|
|
230
|
+
side-effect-only as described above.
|
|
231
|
+
|
|
232
|
+
### `@onda-lang/processor-abi`
|
|
233
|
+
|
|
234
|
+
<!-- BEGIN WEB API onda_processor_abi -->
|
|
235
|
+
DELEGATE_BATCH_SIZE_BYTES
|
|
236
|
+
DELEGATE_RECORD_HEADER_SIZE_BYTES
|
|
237
|
+
EXECUTION_OUTPUT_SIZE_BYTES
|
|
238
|
+
OndaArtifactError
|
|
239
|
+
OndaArtifactKind
|
|
240
|
+
OndaBufferArrayMetadata
|
|
241
|
+
OndaBufferMetadata
|
|
242
|
+
OndaDelegateBatch
|
|
243
|
+
OndaDelegateMetadata
|
|
244
|
+
OndaDelegateOccurrence
|
|
245
|
+
OndaDelegateParamMetadata
|
|
246
|
+
OndaEventMetadata
|
|
247
|
+
OndaEventParamMetadata
|
|
248
|
+
OndaIntegrationProfile
|
|
249
|
+
OndaIoMetadata
|
|
250
|
+
OndaLogSiteMetadata
|
|
251
|
+
OndaParamControlMetadata
|
|
252
|
+
OndaParamDomain
|
|
253
|
+
OndaPreparedParamControl
|
|
254
|
+
OndaPrintBatch
|
|
255
|
+
OndaPrintEntry
|
|
256
|
+
OndaProcessorArtifact
|
|
257
|
+
OndaProcessorInitMode
|
|
258
|
+
OndaProcessorMetadata
|
|
259
|
+
OndaScalarType
|
|
260
|
+
OndaStateMetadata
|
|
261
|
+
OndaTargetInfo
|
|
262
|
+
PRINT_BATCH_SIZE_BYTES
|
|
263
|
+
PRINT_RECORD_HEADER_SIZE_BYTES
|
|
264
|
+
PROCESSOR_ABI_VERSION
|
|
265
|
+
PROCESSOR_ARTIFACT_FORMAT
|
|
266
|
+
PROCESSOR_ARTIFACT_FORMAT_VERSION
|
|
267
|
+
PROCESSOR_EXECUTION_OK
|
|
268
|
+
PROCESSOR_EXECUTION_RUNTIME_SAFETY_FAILURE
|
|
269
|
+
PROCESSOR_INIT_FULL
|
|
270
|
+
PROCESSOR_INIT_PRESERVE_PINNED
|
|
271
|
+
PROCESSOR_SNAPSHOT_FORMAT_VERSION
|
|
272
|
+
constrainParamPlain
|
|
273
|
+
createParamControl
|
|
274
|
+
createParamDomain
|
|
275
|
+
createProcessorArtifactFiles
|
|
276
|
+
decodeDelegateRecords
|
|
277
|
+
decodePrintRecords
|
|
278
|
+
formatPrintBatch
|
|
279
|
+
formatPrintRecords
|
|
280
|
+
loadProcessorArtifactFiles
|
|
281
|
+
paramNormalizedToPlain
|
|
282
|
+
paramPlainToNormalized
|
|
283
|
+
parseProcessorMetadata
|
|
284
|
+
readDelegateBatch
|
|
285
|
+
readPrintBatch
|
|
286
|
+
resetExecutionOutput
|
|
287
|
+
serializeProcessorMetadata
|
|
288
|
+
validateProcessorArtifact
|
|
289
|
+
validateProcessorMetadata
|
|
290
|
+
validateProcessorModule
|
|
291
|
+
writeDelegateBatch
|
|
292
|
+
writeExecutionOutput
|
|
293
|
+
writePrintBatch
|
|
294
|
+
<!-- END WEB API onda_processor_abi -->
|
|
295
|
+
|
|
296
|
+
### `@onda-lang/binaryen-web`
|
|
297
|
+
|
|
298
|
+
<!-- BEGIN WEB API onda_binaryen_web -->
|
|
299
|
+
OndaArtifactError
|
|
300
|
+
OndaBinaryenError
|
|
301
|
+
OndaBinaryenOptions
|
|
302
|
+
OndaProcessorArtifact
|
|
303
|
+
OndaProcessorMetadata
|
|
304
|
+
PROCESSOR_ABI_VERSION
|
|
305
|
+
PROCESSOR_ARTIFACT_FORMAT
|
|
306
|
+
PROCESSOR_ARTIFACT_FORMAT_VERSION
|
|
307
|
+
PROCESSOR_EXECUTION_OK
|
|
308
|
+
PROCESSOR_EXECUTION_RUNTIME_SAFETY_FAILURE
|
|
309
|
+
PROCESSOR_SNAPSHOT_FORMAT_VERSION
|
|
310
|
+
SUPPORTED_MIR_SCHEMA_VERSION
|
|
311
|
+
compileTrustedMir
|
|
312
|
+
createDefaultImports
|
|
313
|
+
createProcessorArtifactFiles
|
|
314
|
+
loadProcessorArtifactFiles
|
|
315
|
+
parseProcessorMetadata
|
|
316
|
+
serializeProcessorMetadata
|
|
317
|
+
validateProcessorArtifact
|
|
318
|
+
validateProcessorMetadata
|
|
319
|
+
validateProcessorModule
|
|
320
|
+
<!-- END WEB API onda_binaryen_web -->
|
|
321
|
+
|
|
322
|
+
### `@onda-lang/wasm-compiler`
|
|
323
|
+
|
|
324
|
+
<!-- BEGIN WEB API onda_wasm_compiler -->
|
|
325
|
+
DirectCompilerOptions
|
|
326
|
+
MIR_SCHEMA_VERSION
|
|
327
|
+
ONDA_VERSION
|
|
328
|
+
OndaArtifactError
|
|
329
|
+
OndaBinaryenError
|
|
330
|
+
OndaBufferAssetBinding
|
|
331
|
+
OndaBufferData
|
|
332
|
+
OndaBufferElement
|
|
333
|
+
OndaCodegenOptions
|
|
334
|
+
OndaCompilationResult
|
|
335
|
+
OndaCompileConstDescriptor
|
|
336
|
+
OndaCompileConstElement
|
|
337
|
+
OndaCompileConstInspectionOptions
|
|
338
|
+
OndaCompileConstKind
|
|
339
|
+
OndaCompileConstValue
|
|
340
|
+
OndaCompileError
|
|
341
|
+
OndaCompileOptions
|
|
342
|
+
OndaCompilerDiagnostic
|
|
343
|
+
OndaCompilerError
|
|
344
|
+
OndaCompilerInstance
|
|
345
|
+
OndaLspAnalysisOptions
|
|
346
|
+
OndaLspMessage
|
|
347
|
+
OndaMaterializedProjectFile
|
|
348
|
+
OndaProcessorArtifact
|
|
349
|
+
OndaProcessorMetadata
|
|
350
|
+
OndaProjectBufferInfo
|
|
351
|
+
OndaProjectCapabilities
|
|
352
|
+
OndaProjectImageInfo
|
|
353
|
+
OndaProjectMaterialization
|
|
354
|
+
OndaResolvedCompileConstValue
|
|
355
|
+
OndaSerializedProjectImage
|
|
356
|
+
OndaSourceDocument
|
|
357
|
+
OndaSourceGraph
|
|
358
|
+
OndaSourceReferenceKind
|
|
359
|
+
OndaSourceResolution
|
|
360
|
+
OndaSourceWorkspace
|
|
361
|
+
OndaWorkerConstructor
|
|
362
|
+
OndaWorkerLike
|
|
363
|
+
PROCESSOR_ABI_VERSION
|
|
364
|
+
PROCESSOR_ARTIFACT_FORMAT
|
|
365
|
+
PROCESSOR_ARTIFACT_FORMAT_VERSION
|
|
366
|
+
PROCESSOR_EXECUTION_OK
|
|
367
|
+
PROCESSOR_EXECUTION_RUNTIME_SAFETY_FAILURE
|
|
368
|
+
PROCESSOR_SNAPSHOT_FORMAT_VERSION
|
|
369
|
+
WorkerCompilerOptions
|
|
370
|
+
createCompiler
|
|
371
|
+
createDefaultImports
|
|
372
|
+
createProcessorArtifactFiles
|
|
373
|
+
loadProcessorArtifactFiles
|
|
374
|
+
parseProcessorMetadata
|
|
375
|
+
serializeProcessorMetadata
|
|
376
|
+
validateProcessorArtifact
|
|
377
|
+
validateProcessorMetadata
|
|
378
|
+
validateProcessorModule
|
|
379
|
+
<!-- END WEB API onda_wasm_compiler -->
|
|
380
|
+
|
|
381
|
+
### `@onda-lang/webaudio`
|
|
382
|
+
|
|
383
|
+
<!-- BEGIN WEB API onda_webaudio -->
|
|
384
|
+
ONDA_AUDIO_WORKLET_PROCESSOR_NAME
|
|
385
|
+
ONDA_INIT_FULL
|
|
386
|
+
ONDA_INIT_PRESERVE_PINNED
|
|
387
|
+
OndaAudioProcessor
|
|
388
|
+
OndaAudioProcessorOptions
|
|
389
|
+
OndaAudioPrintBatch
|
|
390
|
+
OndaAudioPrintListener
|
|
391
|
+
OndaInitMode
|
|
392
|
+
OndaParamDomain
|
|
393
|
+
OndaPreparedParamControl
|
|
394
|
+
OndaProcessorArtifact
|
|
395
|
+
OndaProcessorMetadata
|
|
396
|
+
compileOndaProcessorModule
|
|
397
|
+
constrainParamPlain
|
|
398
|
+
createOndaAudioProcessor
|
|
399
|
+
createOndaAudioProcessorInitialized
|
|
400
|
+
createParamControl
|
|
401
|
+
createParamDomain
|
|
402
|
+
flattenedAudioChannelCount
|
|
403
|
+
ondaAudioWorkletNodeOptions
|
|
404
|
+
paramNormalizedToPlain
|
|
405
|
+
paramPlainToNormalized
|
|
406
|
+
registerOndaAudioWorklet
|
|
407
|
+
<!-- END WEB API onda_webaudio -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onda-lang/binaryen-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Binaryen backend for versioned Onda MIR in browsers and Node.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,11 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"src",
|
|
32
|
+
"api.md",
|
|
32
33
|
"math-kernel/LICENSE-libm.txt",
|
|
33
34
|
"LICENSE",
|
|
34
35
|
"README.md"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
38
|
+
"prepack": "node ../../scripts/stage-web-api-docs.mjs",
|
|
37
39
|
"build:math-kernel": "node ./scripts/build-math-kernel.mjs",
|
|
38
40
|
"test": "node --test",
|
|
39
41
|
"test:onda": "node ./scripts/verify-language-slice.mjs && node ./scripts/verify-backend-parity.mjs && node ./scripts/verify-fma-oracle.mjs",
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
"verify-mir": "node ./scripts/verify-mir.mjs"
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
47
|
-
"@onda-lang/processor-abi": "0.
|
|
49
|
+
"@onda-lang/processor-abi": "0.8.1",
|
|
48
50
|
"binaryen": "130.0.0"
|
|
49
51
|
},
|
|
50
52
|
"publishConfig": {
|