warpo 2.2.5 → 2.3.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.
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "WARPO Configuration Schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"entries": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"description": "List of entry AssemblyScript source files to be compiled. Each item is a file path.",
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Path to an AssemblyScript entry file."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"options": {
|
|
15
|
+
"$ref": "#/$defs/OptionsSchema"
|
|
16
|
+
},
|
|
17
|
+
"targets": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"description": "Build targets configuration. Each property defines a build target with its own output and options.",
|
|
20
|
+
"additionalProperties": {
|
|
21
|
+
"$ref": "#/$defs/OptionsSchema"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["entries", "options", "targets"],
|
|
26
|
+
|
|
27
|
+
"$defs": {
|
|
28
|
+
"OptionsSchema": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Compiler options that control the build process and output.",
|
|
31
|
+
"properties": {
|
|
32
|
+
"exportStart": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Name of the exported start function for the WebAssembly module."
|
|
35
|
+
},
|
|
36
|
+
"exportRuntime": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Whether to export the runtime from the WebAssembly module."
|
|
39
|
+
},
|
|
40
|
+
"exportTable": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "Whether to export the function table from the WebAssembly module."
|
|
43
|
+
},
|
|
44
|
+
"initialMemory": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"description": "Initial memory size for the WebAssembly module, in WebAssembly pages."
|
|
47
|
+
},
|
|
48
|
+
"stackSize": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"description": "Stack size for the WebAssembly module, in bytes."
|
|
51
|
+
},
|
|
52
|
+
"runtime": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Type of runtime to use, either 'incremental' or 'radical'.",
|
|
55
|
+
"enum": ["incremental", "radical"]
|
|
56
|
+
},
|
|
57
|
+
"stats": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"description": "Whether to output compilation statistics."
|
|
60
|
+
},
|
|
61
|
+
"outFile": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Path to the output WebAssembly (.wasm or .wat) file."
|
|
64
|
+
},
|
|
65
|
+
"disable": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"description": "List of compiler features to disable.",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Name of a feature to disable.",
|
|
71
|
+
"enum": ["mutable-globals", "sign-extension", "nontrapping-f2i", "bulk-memory"]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"debug": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"description": "Enable debug information for this build target."
|
|
77
|
+
},
|
|
78
|
+
"sourceMap": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"description": "Generate source map for this build target."
|
|
81
|
+
},
|
|
82
|
+
"optimizeLevel": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"description": "Optimization level for this build target (higher means more optimization).",
|
|
85
|
+
"minimum": 0,
|
|
86
|
+
"maximum": 3
|
|
87
|
+
},
|
|
88
|
+
"shrinkLevel": {
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"description": "Shrink level for this build target (higher means smaller output).",
|
|
91
|
+
"minimum": 0,
|
|
92
|
+
"maximum": 2
|
|
93
|
+
},
|
|
94
|
+
"use": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"description": "Additional compiler flags or environment variables for this build target.",
|
|
97
|
+
"additionalProperties": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Value for the use option."
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -187,7 +187,7 @@ declare function eq<T extends i32 | i64 | f32 | f64>(left: T, right: T): i32;
|
|
|
187
187
|
declare function ne<T extends i32 | i64 | f32 | f64>(left: T, right: T): i32;
|
|
188
188
|
/** Computes the remainder of two integers. */
|
|
189
189
|
declare function rem<T extends i32 | i64>(left: T, right: T): T;
|
|
190
|
-
/** Loads a value of the specified type from memory. Equivalent to
|
|
190
|
+
/** Loads a value of the specified type from memory. Equivalent to dereferencing a pointer in other languages. */
|
|
191
191
|
declare function load<T>(ptr: usize, immOffset?: usize, immAlign?: usize): T;
|
|
192
192
|
/** Stores a value of the specified type to memory. Equivalent to dereferencing a pointer in other languages when assigning a value. */
|
|
193
193
|
declare function store<T>(ptr: usize, value: T, immOffset?: usize, immAlign?: usize): void;
|
|
@@ -612,7 +612,7 @@ declare namespace i64 {
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
/** Converts any other numeric value to a 32-bit (in WASM32)
|
|
615
|
+
/** Converts any other numeric value to a 32-bit (in WASM32) respectively 64-bit (in WASM64) signed integer. */
|
|
616
616
|
declare let isize: typeof i32 | typeof i64;
|
|
617
617
|
/** Converts any other numeric value to an 8-bit unsigned integer. */
|
|
618
618
|
declare function u8(value: any): u8;
|
|
@@ -654,7 +654,7 @@ declare namespace u64 {
|
|
|
654
654
|
/** Parses a string as an u64. */
|
|
655
655
|
export function parse(value: string, radix?: i32): u64;
|
|
656
656
|
}
|
|
657
|
-
/** Converts any other numeric value to a 32-bit (in WASM32)
|
|
657
|
+
/** Converts any other numeric value to a 32-bit (in WASM32) respectively 64-bit (in WASM64) unsigned integer. */
|
|
658
658
|
declare let usize: typeof u32 | typeof u64;
|
|
659
659
|
/** Converts any other numeric value to a 1-bit unsigned integer. */
|
|
660
660
|
declare function bool(value: any): bool;
|
|
@@ -985,7 +985,7 @@ declare namespace v128 {
|
|
|
985
985
|
* depending on hardware capabilities:
|
|
986
986
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
987
987
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
988
|
-
*
|
|
988
|
+
* saturated result or maximum integer value.
|
|
989
989
|
*/
|
|
990
990
|
export function relaxed_trunc<T extends i32 | u32>(a: v128): v128;
|
|
991
991
|
/**
|
|
@@ -996,7 +996,7 @@ declare namespace v128 {
|
|
|
996
996
|
* depending on hardware capabilities:
|
|
997
997
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
998
998
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
999
|
-
*
|
|
999
|
+
* saturated result or maximum integer value.
|
|
1000
1000
|
*/
|
|
1001
1001
|
export function relaxed_trunc_zero<T extends i32 | u32>(a: v128): v128;
|
|
1002
1002
|
/**
|
|
@@ -1411,7 +1411,7 @@ declare namespace i32x4 {
|
|
|
1411
1411
|
* defined, depending on hardware capabilities:
|
|
1412
1412
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
1413
1413
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
1414
|
-
*
|
|
1414
|
+
* saturated result or maximum integer value.
|
|
1415
1415
|
*/
|
|
1416
1416
|
export function relaxed_trunc_f32x4_s(a: v128): v128;
|
|
1417
1417
|
/**
|
|
@@ -1421,7 +1421,7 @@ declare namespace i32x4 {
|
|
|
1421
1421
|
* defined, depending on hardware capabilities:
|
|
1422
1422
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
1423
1423
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
1424
|
-
*
|
|
1424
|
+
* saturated result or maximum integer value.
|
|
1425
1425
|
*/
|
|
1426
1426
|
export function relaxed_trunc_f32x4_u(a: v128): v128;
|
|
1427
1427
|
/**
|
|
@@ -1432,7 +1432,7 @@ declare namespace i32x4 {
|
|
|
1432
1432
|
* defined, depending on hardware capabilities:
|
|
1433
1433
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
1434
1434
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
1435
|
-
*
|
|
1435
|
+
* saturated result or maximum integer value.
|
|
1436
1436
|
*/
|
|
1437
1437
|
export function relaxed_trunc_f64x2_s_zero(a: v128): v128;
|
|
1438
1438
|
/**
|
|
@@ -1443,7 +1443,7 @@ declare namespace i32x4 {
|
|
|
1443
1443
|
* defined, depending on hardware capabilities:
|
|
1444
1444
|
* - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
|
|
1445
1445
|
* - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
|
|
1446
|
-
*
|
|
1446
|
+
* saturated result or maximum integer value.
|
|
1447
1447
|
*/
|
|
1448
1448
|
export function relaxed_trunc_f64x2_u_zero(a: v128): v128;
|
|
1449
1449
|
/**
|
|
@@ -2149,6 +2149,7 @@ declare class Array<T> {
|
|
|
2149
2149
|
static isArray<U>(value: any): value is Array<any>;
|
|
2150
2150
|
|
|
2151
2151
|
[key: number]: T;
|
|
2152
|
+
[Symbol.iterator](): Iterator<T>;
|
|
2152
2153
|
/** Current length of the array. */
|
|
2153
2154
|
length: i32;
|
|
2154
2155
|
/** Returns raw pointer to data storage (unsafe). */
|
|
@@ -2287,7 +2288,7 @@ declare namespace String {
|
|
|
2287
2288
|
export function byteLength(str: string, nullTerminated?: bool): i32;
|
|
2288
2289
|
/** Encodes the specified string to UTF-8 bytes, optionally null terminated. ErrorMode defaults to WTF-8. */
|
|
2289
2290
|
export function encode(str: string, nullTerminated?: bool, errorMode?: ErrorMode): ArrayBuffer;
|
|
2290
|
-
/** Encodes the specified raw string to UTF-8 bytes,
|
|
2291
|
+
/** Encodes the specified raw string to UTF-8 bytes, optionally null terminated. ErrorMode defaults to WTF-8. Returns the number of bytes written. */
|
|
2291
2292
|
export function encodeUnsafe(str: usize, len: i32, buf: usize, nullTerminated?: bool, errorMode?: ErrorMode): usize;
|
|
2292
2293
|
/** Decodes the specified buffer from UTF-8 bytes to a string, optionally null terminated. */
|
|
2293
2294
|
export function decode(buf: ArrayBuffer, nullTerminated?: bool): string;
|
|
@@ -2520,28 +2521,38 @@ declare class Set<K> {
|
|
|
2520
2521
|
clear(): void;
|
|
2521
2522
|
values(): K[]; // preliminary
|
|
2522
2523
|
toString(): string;
|
|
2524
|
+
[Symbol.iterator](): Iterator<K>;
|
|
2523
2525
|
}
|
|
2524
2526
|
|
|
2525
|
-
interface SymbolConstructor {
|
|
2526
|
-
readonly hasInstance: symbol;
|
|
2527
|
-
readonly isConcatSpreadable: symbol;
|
|
2528
|
-
readonly isRegExp: symbol;
|
|
2529
|
-
readonly iterator: symbol;
|
|
2530
|
-
readonly match: symbol;
|
|
2531
|
-
readonly replace: symbol;
|
|
2532
|
-
readonly search: symbol;
|
|
2533
|
-
readonly species: symbol;
|
|
2534
|
-
readonly split: symbol;
|
|
2535
|
-
readonly toPrimitive: symbol;
|
|
2536
|
-
readonly toStringTag: symbol;
|
|
2537
|
-
readonly unscopables: symbol;
|
|
2527
|
+
declare interface SymbolConstructor {
|
|
2538
2528
|
(description?: string | null): symbol;
|
|
2529
|
+
readonly iterator: symbol;
|
|
2539
2530
|
for(key: string): symbol;
|
|
2540
2531
|
keyFor(sym: symbol): string | null;
|
|
2541
2532
|
}
|
|
2542
|
-
|
|
2543
2533
|
declare const Symbol: SymbolConstructor;
|
|
2544
2534
|
|
|
2535
|
+
interface Symbol {
|
|
2536
|
+
/** Returns a string representation of an object. */
|
|
2537
|
+
toString(): string;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
declare class IteratorResult<T> {
|
|
2541
|
+
private constructor(value: T);
|
|
2542
|
+
get done(): boolean;
|
|
2543
|
+
get value(): T;
|
|
2544
|
+
static done<T>(): IteratorResult<T>;
|
|
2545
|
+
static fromValue<T>(value: T): IteratorResult<T>;
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
interface Iterator<T> {
|
|
2549
|
+
next(): IteratorResult<T>;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
interface Iterable<T> {
|
|
2553
|
+
[Symbol.iterator](): Iterator<T>;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2545
2556
|
/** @internal */
|
|
2546
2557
|
interface IMath<T> {
|
|
2547
2558
|
/** The base of natural logarithms, e, approximately 2.718. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warpo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha-1",
|
|
4
4
|
"description": "next generation AssemblyScript compiler with optimizations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"test:debug_symbol": "cross-env-shell ./build/tests/DebugSymbol/TestDebugSymbol",
|
|
20
20
|
"test:debug_symbol:update": "cross-env-shell build/tests/DebugSymbol/TestDebugSymbol --update-fixtures",
|
|
21
21
|
"test:driver": "node tests/driver/index.mjs",
|
|
22
|
-
"test": "npm run test:as:ut && npm run test:cpp:ut && npm run test:as:snapshot && npm run test:opt:snapshot && npm run test:driver && npm run test:debug_symbol
|
|
22
|
+
"test": "npm run test:as:ut && npm run test:cpp:ut && npm run test:as:snapshot && npm run test:opt:snapshot && npm run test:driver && npm run test:debug_symbol",
|
|
23
|
+
"test:all": "npm run test && npm run test:bootstrap:debug && npm run test:bootstrap:release",
|
|
23
24
|
"test:update": "npm run test:as:snapshot -- -u && npm run test:opt:snapshot -- -u && npm run test:driver -- -u && npm run test:debug_symbol -- -u",
|
|
24
25
|
"docs:dev": "vitepress dev docs",
|
|
25
26
|
"docs:build": "vitepress build docs",
|
|
@@ -39,12 +40,12 @@
|
|
|
39
40
|
"url": "https://github.com/wasm-ecosystem/warpo"
|
|
40
41
|
},
|
|
41
42
|
"files": [
|
|
43
|
+
"asconfig.schema.json",
|
|
44
|
+
"assemblyscript/std/assembly/index.d.ts",
|
|
42
45
|
"create",
|
|
43
46
|
"dist",
|
|
44
|
-
"types",
|
|
45
47
|
"tsconfig-warpo.json",
|
|
46
|
-
"
|
|
47
|
-
"assemblyscript/std/assembly/index.d.ts"
|
|
48
|
+
"types"
|
|
48
49
|
],
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@assemblyscript/loader": "^0.28.9",
|
|
@@ -58,6 +59,6 @@
|
|
|
58
59
|
"diff": "^8.0.0",
|
|
59
60
|
"prettier": "^3.6.2",
|
|
60
61
|
"typescript": "^5.8.3",
|
|
61
|
-
"vitepress": "^
|
|
62
|
+
"vitepress": "^2.0.0-alpha.15"
|
|
62
63
|
}
|
|
63
64
|
}
|
package/types/warpo/index.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
/// <reference path="../../assemblyscript/std/assembly/index.d.ts" />
|
|
2
2
|
|
|
3
3
|
declare module "rt/index" {
|
|
4
|
-
|
|
4
|
+
// allocate new object with size and rtid
|
|
5
|
+
function __new(size: usize, id: u32): usize;
|
|
6
|
+
// re-allocate a object
|
|
7
|
+
function __renew(ptr: usize, size: usize): usize;
|
|
8
|
+
// insert write barrier (only useful for incremental runtime)
|
|
9
|
+
function __link(parentPtr: usize, childPtr: usize, expectMultiple: bool): void;
|
|
10
|
+
// trigger full GC manually
|
|
11
|
+
function __collect(): void;
|
|
12
|
+
// pin an object to prevent being garbage collected
|
|
13
|
+
function __pin(ptr: usize): usize;
|
|
14
|
+
// cancel the pin operation
|
|
15
|
+
function __unpin(ptr: usize): void;
|
|
5
16
|
}
|
|
6
17
|
|
|
7
18
|
declare module "warpo/utf8/const_str" {
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"alwaysStrict": true,
|
|
5
|
-
"noImplicitAny": true,
|
|
6
|
-
"noImplicitReturns": true,
|
|
7
|
-
"noImplicitThis": true,
|
|
8
|
-
"noEmitOnError": true,
|
|
9
|
-
"strictNullChecks": true,
|
|
10
|
-
"experimentalDecorators": true,
|
|
11
|
-
"preserveConstEnums": false,
|
|
12
|
-
"downlevelIteration": true
|
|
13
|
-
}
|
|
14
|
-
}
|