@onda-lang/wasm-compiler 0.8.2 → 0.8.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.
package/api.md CHANGED
@@ -119,7 +119,11 @@ versions rather than guessing layout compatibility.
119
119
  ### Parameter controls
120
120
 
121
121
  `createParamControl(metadata)` validates one scalar parameter descriptor and returns a reusable
122
- `OndaPreparedParamControl`. `createParamDomain(domain)` does the same from already-decoded values.
122
+ `OndaPreparedParamControl`. For an array, `createParamControl(metadata, index)` prepares one element;
123
+ `paramElementMetadata(metadata, index)` projects its scalar descriptor, default, and storage offset.
124
+ The Web Audio adapter accepts indexed names such as `offsets[1]` in `setParam` and
125
+ `setParamNormalized`, and exact-length arrays in `setParam("offsets", values)`.
126
+ `createParamDomain(domain)` does the same from already-decoded values.
123
127
  Prepared controls expose `constrainPlain`, `normalizedToPlain`, and `plainToNormalized` methods.
124
128
 
125
129
  The one-shot `constrainParamPlain`, `paramNormalizedToPlain`, and `paramPlainToNormalized`
@@ -271,6 +275,7 @@ PROCESSOR_INIT_PRESERVE_PINNED
271
275
  PROCESSOR_SNAPSHOT_FORMAT_VERSION
272
276
  constrainParamPlain
273
277
  createParamControl
278
+ paramElementMetadata
274
279
  createParamDomain
275
280
  createProcessorArtifactFiles
276
281
  decodeDelegateRecords
@@ -1689,7 +1689,7 @@ export class MirCompiler extends MirCompilerLowering {
1689
1689
  default_reprs: this.constantReprs(param.default),
1690
1690
  range_min_repr: this.scalarRepr(param.range?.min),
1691
1691
  range_max_repr: this.scalarRepr(param.range?.max),
1692
- param_control: this.storageShape(param.ty).length === 1 && param.range
1692
+ param_control: param.range
1693
1693
  ? {
1694
1694
  scale: param.control.scale,
1695
1695
  curve: param.control.curve,
@@ -44,7 +44,21 @@ export class MirCompilerLowering extends MirCompilerCore {
44
44
  );
45
45
  }
46
46
  }
47
- if (this.type(this.placeTypeId(data.destination, context)).kind === "slice") {
47
+ const destinationType = this.placeTypeId(data.destination, context);
48
+ if (this.type(destinationType).kind === "array") {
49
+ const source = data.value.kind === "load"
50
+ ? data.value.data
51
+ : data.value.kind === "use" && data.value.data.kind === "local"
52
+ ? { base: data.value.data, projections: [] }
53
+ : null;
54
+ if (!source) this.fail("array assignment requires an array load or local value");
55
+ return this.module.memory.copy(
56
+ this.placeAddress(data.destination, context),
57
+ this.placeAddress(source, context),
58
+ this.module.i32.const(this.typeLayout(destinationType).size),
59
+ );
60
+ }
61
+ if (this.type(destinationType).kind === "slice") {
48
62
  return this.storeSlicePlace(
49
63
  data.destination,
50
64
  this.compileSliceRvalue(data.value, context),
package/dist/build.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "ondaVersion": "0.8.2",
2
+ "ondaVersion": "0.8.3",
3
3
  "binaryenVersion": "130.0.0",
4
4
  "frontendPackage": "onda_compiler_web",
5
5
  "frontendOptimization": {
6
6
  "tool": "wasm-opt",
7
7
  "binaryenVersion": "130.0.0",
8
8
  "optimizeLevel": 4,
9
- "inputBytes": 9582841,
10
- "outputBytes": 7092689
9
+ "inputBytes": 9628201,
10
+ "outputBytes": 7143809
11
11
  }
12
12
  }
@@ -5,7 +5,7 @@
5
5
  "Francesco Cameli"
6
6
  ],
7
7
  "description": "Browser-safe Onda source-to-MIR compiler",
8
- "version": "0.8.2",
8
+ "version": "0.8.3",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -675,7 +675,7 @@ SOFTWARE.
675
675
  MIT License (MIT)
676
676
 
677
677
  Used by:
678
- - onda_compiler_web 0.8.2 (https://github.com/onda-lang/onda)
678
+ - onda_compiler_web 0.8.3 (https://github.com/onda-lang/onda)
679
679
 
680
680
  MIT License
681
681
 
@@ -704,12 +704,12 @@ SOFTWARE.
704
704
  MIT License (MIT)
705
705
 
706
706
  Used by:
707
- - onda_frontend 0.8.2
708
- - onda_host_protocol 0.8.2
709
- - onda_lsp 0.8.2
710
- - onda_mir 0.8.2
711
- - onda_project 0.8.2
712
- - onda_semantics 0.8.2
707
+ - onda_frontend 0.8.3
708
+ - onda_host_protocol 0.8.3
709
+ - onda_lsp 0.8.3
710
+ - onda_mir 0.8.3
711
+ - onda_project 0.8.3
712
+ - onda_semantics 0.8.3
713
713
 
714
714
  MIT License
715
715
 
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const ONDA_VERSION = "0.8.2";
1
+ export const ONDA_VERSION = "0.8.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onda-lang/wasm-compiler",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "type": "module",
5
5
  "description": "Onda source-to-WebAssembly compiler for browsers and Node.js",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "prepack": "npm run build && node ../../scripts/stage-web-api-docs.mjs"
61
61
  },
62
62
  "dependencies": {
63
- "@onda-lang/processor-abi": "0.8.2",
63
+ "@onda-lang/processor-abi": "0.8.3",
64
64
  "binaryen": "130.0.0"
65
65
  },
66
66
  "publishConfig": {