@elaraai/east-node-std 0.0.1-beta.18 → 0.0.1-beta.19
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/dist/console.js +3 -3
- package/dist/console.js.map +1 -1
- package/dist/crypto.js +4 -4
- package/dist/crypto.js.map +1 -1
- package/dist/fetch.js +5 -5
- package/dist/fetch.js.map +1 -1
- package/dist/fs.js +8 -8
- package/dist/fs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/parallel.d.ts +141 -0
- package/dist/parallel.d.ts.map +1 -0
- package/dist/parallel.js +263 -0
- package/dist/parallel.js.map +1 -0
- package/dist/path.js +5 -5
- package/dist/path.js.map +1 -1
- package/dist/random.js +12 -12
- package/dist/random.js.map +1 -1
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js +21 -21
- package/dist/test.js.map +1 -1
- package/dist/time.js +2 -2
- package/dist/time.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/parallel.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
|
|
6
|
+
import { cpus } from "os";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
import { East, ArrayType, FunctionType, IntegerType, StructType, OptionType } from "@elaraai/east";
|
|
9
|
+
import { EastError, EAST_IR_SYMBOL, encodeBeast2For, decodeBeast2For } from "@elaraai/east/internal";
|
|
10
|
+
// Import platform implementations for worker threads (avoid circular dep with index.ts)
|
|
11
|
+
import { ConsoleImpl } from "./console.js";
|
|
12
|
+
import { FileSystemImpl } from "./fs.js";
|
|
13
|
+
import { PathImpl } from "./path.js";
|
|
14
|
+
import { CryptoImpl } from "./crypto.js";
|
|
15
|
+
import { TimeImpl } from "./time.js";
|
|
16
|
+
import { FetchImpl } from "./fetch.js";
|
|
17
|
+
import { RandomImpl } from "./random.js";
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
/** Platform functions available in worker threads */
|
|
20
|
+
const WorkerPlatform = [
|
|
21
|
+
...ConsoleImpl,
|
|
22
|
+
...FileSystemImpl,
|
|
23
|
+
...PathImpl,
|
|
24
|
+
...CryptoImpl,
|
|
25
|
+
...TimeImpl,
|
|
26
|
+
...FetchImpl,
|
|
27
|
+
...RandomImpl,
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Configuration options for parallel operations.
|
|
31
|
+
*/
|
|
32
|
+
export const ParallelConfigType = StructType({
|
|
33
|
+
/** Number of worker threads to use. Defaults to the number of CPU cores. */
|
|
34
|
+
workers: OptionType(IntegerType),
|
|
35
|
+
/** Size of each chunk to process. Defaults to array.length / workers. */
|
|
36
|
+
chunkSize: OptionType(IntegerType),
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Splits an array into chunks of the specified size.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
function chunkArray(array, chunkSize) {
|
|
43
|
+
const chunks = [];
|
|
44
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
45
|
+
chunks.push(array.slice(i, i + chunkSize));
|
|
46
|
+
}
|
|
47
|
+
return chunks;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Maps a function over an array in parallel using worker threads.
|
|
51
|
+
*
|
|
52
|
+
* Distributes the array across multiple worker threads, applies the mapping
|
|
53
|
+
* function to each element in parallel, and collects the results. This enables
|
|
54
|
+
* true CPU parallelism for compute-intensive operations.
|
|
55
|
+
*
|
|
56
|
+
* The mapping function's IR is serialized and sent to workers, where it is
|
|
57
|
+
* recompiled with the Node.js platform functions and executed.
|
|
58
|
+
*
|
|
59
|
+
* This is a platform function for the East language, enabling parallel
|
|
60
|
+
* computation in East programs running on Node.js.
|
|
61
|
+
*
|
|
62
|
+
* @typeParam T - The type of elements in the input array
|
|
63
|
+
* @typeParam R - The type of elements in the output array
|
|
64
|
+
* @param array - The input array to map over
|
|
65
|
+
* @param fn - The East function to apply to each element (T -> R)
|
|
66
|
+
* @returns An array of results with the same length as the input
|
|
67
|
+
*
|
|
68
|
+
* @throws {EastError} When worker execution fails or function IR is unavailable
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { East, IntegerType, ArrayType } from "@elaraai/east";
|
|
73
|
+
* import { Parallel } from "@elaraai/east-node-std";
|
|
74
|
+
*
|
|
75
|
+
* // Define a CPU-intensive mapping function
|
|
76
|
+
* const square = East.function([IntegerType], IntegerType, ($, x) => {
|
|
77
|
+
* return x.multiply(x);
|
|
78
|
+
* });
|
|
79
|
+
*
|
|
80
|
+
* // Use parallel map to process array across multiple cores
|
|
81
|
+
* const processData = East.asyncFunction([ArrayType(IntegerType)], ArrayType(IntegerType), ($, data) => {
|
|
82
|
+
* return Parallel.map([IntegerType, IntegerType], data, square);
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* const compiled = await East.compileAsync(processData, Parallel.Implementation);
|
|
86
|
+
* const result = await compiled([1n, 2n, 3n, 4n, 5n]);
|
|
87
|
+
* // result: [1n, 4n, 9n, 16n, 25n]
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* - Workers have access to all Node.js platform functions (Console, FileSystem, etc.)
|
|
92
|
+
* - The number of workers defaults to the number of CPU cores
|
|
93
|
+
* - For small arrays, the overhead of worker creation may exceed the parallelism benefit
|
|
94
|
+
* - The mapping function must be serializable (no closures over external JavaScript variables)
|
|
95
|
+
*/
|
|
96
|
+
export const parallel_map = East.asyncGenericPlatform("parallel_map", ["T", "R"], [ArrayType("T"), FunctionType(["T"], "R")], ArrayType("R"));
|
|
97
|
+
/**
|
|
98
|
+
* Node.js implementation of parallel platform functions.
|
|
99
|
+
*
|
|
100
|
+
* Pass this array to {@link East.compileAsync} to enable parallel operations.
|
|
101
|
+
*/
|
|
102
|
+
const ParallelImpl = [
|
|
103
|
+
parallel_map.implement((T, R) => async (...args) => {
|
|
104
|
+
const array = args[0];
|
|
105
|
+
const fn = args[1];
|
|
106
|
+
try {
|
|
107
|
+
// For small arrays, just run sequentially to avoid worker overhead
|
|
108
|
+
if (array.length <= 4) {
|
|
109
|
+
return array.map(item => fn(item));
|
|
110
|
+
}
|
|
111
|
+
// Verify the function has IR attached
|
|
112
|
+
const ir = fn[EAST_IR_SYMBOL];
|
|
113
|
+
if (!ir) {
|
|
114
|
+
throw new Error("Function does not have attached IR. Ensure you're passing an East function.");
|
|
115
|
+
}
|
|
116
|
+
// Build the function type and serialize using Beast2
|
|
117
|
+
const fnType = FunctionType([T], R);
|
|
118
|
+
const encodeFn = encodeBeast2For(fnType);
|
|
119
|
+
const encodedFn = encodeFn(fn);
|
|
120
|
+
// Serialize the input array using Beast2
|
|
121
|
+
const arrayType = ArrayType(T);
|
|
122
|
+
const encodeArray = encodeBeast2For(arrayType);
|
|
123
|
+
const numWorkers = Math.min(cpus().length, array.length);
|
|
124
|
+
const chunkSize = Math.ceil(array.length / numWorkers);
|
|
125
|
+
const chunks = chunkArray(array, chunkSize);
|
|
126
|
+
// Encode each chunk
|
|
127
|
+
const encodedChunks = chunks.map(chunk => encodeArray(chunk));
|
|
128
|
+
// Spawn workers and process chunks
|
|
129
|
+
const promises = encodedChunks.map((encodedChunk, index) => {
|
|
130
|
+
return new Promise((resolve, reject) => {
|
|
131
|
+
const worker = new Worker(__filename, {
|
|
132
|
+
workerData: {
|
|
133
|
+
encodedChunk,
|
|
134
|
+
encodedFn,
|
|
135
|
+
inputType: T,
|
|
136
|
+
outputType: R,
|
|
137
|
+
chunkIndex: index,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
worker.on("message", (result) => {
|
|
141
|
+
resolve(result);
|
|
142
|
+
});
|
|
143
|
+
worker.on("error", (err) => {
|
|
144
|
+
reject(err);
|
|
145
|
+
});
|
|
146
|
+
worker.on("exit", (code) => {
|
|
147
|
+
if (code !== 0) {
|
|
148
|
+
reject(new Error(`Worker exited with code ${code}`));
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
// Wait for all workers and flatten results
|
|
154
|
+
const results = await Promise.all(promises);
|
|
155
|
+
return results.flat();
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
throw new EastError(`Parallel map failed: ${err.message}`, {
|
|
159
|
+
location: [{ filename: "parallel_map", line: 0n, column: 0n }],
|
|
160
|
+
cause: err,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}),
|
|
164
|
+
];
|
|
165
|
+
/**
|
|
166
|
+
* Grouped parallel execution platform functions.
|
|
167
|
+
*
|
|
168
|
+
* Provides parallel computation capabilities for East programs running on Node.js
|
|
169
|
+
* using worker threads for true CPU parallelism.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* import { East, IntegerType, ArrayType } from "@elaraai/east";
|
|
174
|
+
* import { Parallel } from "@elaraai/east-node-std";
|
|
175
|
+
*
|
|
176
|
+
* // Define a function to apply to each element
|
|
177
|
+
* const double = East.function([IntegerType], IntegerType, ($, x) => {
|
|
178
|
+
* return x.multiply(2n);
|
|
179
|
+
* });
|
|
180
|
+
*
|
|
181
|
+
* // Process array in parallel
|
|
182
|
+
* const processArray = East.asyncFunction([ArrayType(IntegerType)], ArrayType(IntegerType), ($, arr) => {
|
|
183
|
+
* return Parallel.map([IntegerType, IntegerType], arr, double);
|
|
184
|
+
* });
|
|
185
|
+
*
|
|
186
|
+
* const compiled = await East.compileAsync(processArray, Parallel.Implementation);
|
|
187
|
+
* const result = await compiled([1n, 2n, 3n, 4n]);
|
|
188
|
+
* // result: [2n, 4n, 6n, 8n]
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export const Parallel = {
|
|
192
|
+
/**
|
|
193
|
+
* Maps a function over an array in parallel using worker threads.
|
|
194
|
+
*
|
|
195
|
+
* Distributes work across multiple CPU cores for compute-intensive operations.
|
|
196
|
+
* The mapping function is serialized and executed in worker threads.
|
|
197
|
+
*
|
|
198
|
+
* @typeParam T - The type of elements in the input array
|
|
199
|
+
* @typeParam R - The type of elements in the output array
|
|
200
|
+
* @param typeArgs - Type arguments as `[T, R]`
|
|
201
|
+
* @param array - The input array to map over
|
|
202
|
+
* @param fn - The East function to apply to each element
|
|
203
|
+
* @returns An array of results
|
|
204
|
+
* @throws {EastError} When worker execution fails
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```ts
|
|
208
|
+
* const square = East.function([IntegerType], IntegerType, ($, x) => x.multiply(x));
|
|
209
|
+
*
|
|
210
|
+
* const processData = East.asyncFunction([ArrayType(IntegerType)], ArrayType(IntegerType), ($, data) => {
|
|
211
|
+
* return Parallel.map([IntegerType, IntegerType], data, square);
|
|
212
|
+
* });
|
|
213
|
+
*
|
|
214
|
+
* const compiled = await East.compileAsync(processData, Parallel.Implementation);
|
|
215
|
+
* const result = await compiled([1n, 2n, 3n, 4n, 5n]);
|
|
216
|
+
* // result: [1n, 4n, 9n, 16n, 25n]
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
map: parallel_map,
|
|
220
|
+
/**
|
|
221
|
+
* Node.js implementation of parallel platform functions.
|
|
222
|
+
*
|
|
223
|
+
* Pass this to {@link East.compileAsync} to enable parallel operations.
|
|
224
|
+
*/
|
|
225
|
+
Implementation: ParallelImpl,
|
|
226
|
+
/**
|
|
227
|
+
* Type definitions for parallel operations.
|
|
228
|
+
*/
|
|
229
|
+
Types: {
|
|
230
|
+
/** Configuration options for parallel operations */
|
|
231
|
+
Config: ParallelConfigType,
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
// Export for backwards compatibility
|
|
235
|
+
export { ParallelImpl };
|
|
236
|
+
// =============================================================================
|
|
237
|
+
// Worker Thread Logic
|
|
238
|
+
// =============================================================================
|
|
239
|
+
/** Handles execution when this module is loaded as a worker thread. */
|
|
240
|
+
function runWorker() {
|
|
241
|
+
if (!isMainThread && workerData) {
|
|
242
|
+
const data = workerData;
|
|
243
|
+
try {
|
|
244
|
+
// Decode the input array chunk
|
|
245
|
+
const arrayType = ArrayType(data.inputType);
|
|
246
|
+
const decodeArray = decodeBeast2For(arrayType);
|
|
247
|
+
const chunk = decodeArray(data.encodedChunk);
|
|
248
|
+
// Decode and compile the function with WorkerPlatform
|
|
249
|
+
const fnType = FunctionType([data.inputType], data.outputType);
|
|
250
|
+
const decodeFn = decodeBeast2For(fnType, { platform: WorkerPlatform });
|
|
251
|
+
const compiledFn = decodeFn(data.encodedFn);
|
|
252
|
+
// Apply the function to each item in the chunk
|
|
253
|
+
const results = chunk.map(item => compiledFn(item));
|
|
254
|
+
// Send results back to main thread
|
|
255
|
+
parentPort?.postMessage(results);
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
throw new Error(`Worker ${data.chunkIndex} failed: ${err.message}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
runWorker();
|
|
263
|
+
//# sourceMappingURL=parallel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel.js","sourceRoot":"","sources":["../src/parallel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,UAA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,CAAC,IAAI,CAAC,YAAY,CAAc,CAAC;YAE1D,sDAAsD;YACtD,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC;YACvE,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAgC,CAAC;YAE3E,+CAA+C;YAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAEpD,mCAAmC;YACnC,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,UAAU,YAAY,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAS,EAAE,CAAC"}
|
package/dist/path.js
CHANGED
|
@@ -126,7 +126,7 @@ const PathImpl = [
|
|
|
126
126
|
}
|
|
127
127
|
catch (err) {
|
|
128
128
|
throw new EastError(`Failed to join path segments: ${err.message}`, {
|
|
129
|
-
location: { filename: "path_join", line: 0n, column: 0n },
|
|
129
|
+
location: [{ filename: "path_join", line: 0n, column: 0n }],
|
|
130
130
|
cause: err
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -137,7 +137,7 @@ const PathImpl = [
|
|
|
137
137
|
}
|
|
138
138
|
catch (err) {
|
|
139
139
|
throw new EastError(`Failed to resolve path: ${err.message}`, {
|
|
140
|
-
location: { filename: "path_resolve", line: 0n, column: 0n },
|
|
140
|
+
location: [{ filename: "path_resolve", line: 0n, column: 0n }],
|
|
141
141
|
cause: err
|
|
142
142
|
});
|
|
143
143
|
}
|
|
@@ -148,7 +148,7 @@ const PathImpl = [
|
|
|
148
148
|
}
|
|
149
149
|
catch (err) {
|
|
150
150
|
throw new EastError(`Failed to get dirname: ${err.message}`, {
|
|
151
|
-
location: { filename: "path_dirname", line: 0n, column: 0n },
|
|
151
|
+
location: [{ filename: "path_dirname", line: 0n, column: 0n }],
|
|
152
152
|
cause: err
|
|
153
153
|
});
|
|
154
154
|
}
|
|
@@ -159,7 +159,7 @@ const PathImpl = [
|
|
|
159
159
|
}
|
|
160
160
|
catch (err) {
|
|
161
161
|
throw new EastError(`Failed to get basename: ${err.message}`, {
|
|
162
|
-
location: { filename: "path_basename", line: 0n, column: 0n },
|
|
162
|
+
location: [{ filename: "path_basename", line: 0n, column: 0n }],
|
|
163
163
|
cause: err
|
|
164
164
|
});
|
|
165
165
|
}
|
|
@@ -170,7 +170,7 @@ const PathImpl = [
|
|
|
170
170
|
}
|
|
171
171
|
catch (err) {
|
|
172
172
|
throw new EastError(`Failed to get extname: ${err.message}`, {
|
|
173
|
-
location: { filename: "path_extname", line: 0n, column: 0n },
|
|
173
|
+
location: [{ filename: "path_extname", line: 0n, column: 0n }],
|
|
174
174
|
cause: err
|
|
175
175
|
});
|
|
176
176
|
}
|
package/dist/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,UAAU,CAA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AE,CAAC;gBAC/D,KAAK,EAAE,GAAG;aACb,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IACF,YAAY,CAAC,SAAS,CAAC,CAAC,IAAY,EAAE,EAAE;QACpC,IAAI,CAAC;YACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,MAAM,IAAI,SAAS,CAAC,0BAA0B,GAAG,CAAC,OAAO,EAAE,EAAE;gBACzD,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;gBAC9D,KAAK,EAAE,GAAG;aACb,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;CACL,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,EAAE,SAAS;IAEf;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAAE,YAAY;IAErB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAAE,YAAY;IAErB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,EAAE,aAAa;IAEvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,EAAE,YAAY;IAErB;;;;OAIG;IACH,cAAc,EAAE,QAAQ;CAClB,CAAC;AAEX,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/random.js
CHANGED
|
@@ -444,7 +444,7 @@ const RandomImpl = [
|
|
|
444
444
|
random_range.implement((min, max) => {
|
|
445
445
|
if (min > max) {
|
|
446
446
|
throw new EastError(`Invalid range: min (${min}) > max (${max})`, {
|
|
447
|
-
location: { filename: "random_range", line: 0n, column: 0n },
|
|
447
|
+
location: [{ filename: "random_range", line: 0n, column: 0n }],
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
try {
|
|
@@ -452,7 +452,7 @@ const RandomImpl = [
|
|
|
452
452
|
}
|
|
453
453
|
catch (err) {
|
|
454
454
|
throw new EastError(`Random range generation failed: ${err.message}`, {
|
|
455
|
-
location: { filename: "random_range", line: 0n, column: 0n },
|
|
455
|
+
location: [{ filename: "random_range", line: 0n, column: 0n }],
|
|
456
456
|
cause: err
|
|
457
457
|
});
|
|
458
458
|
}
|
|
@@ -463,7 +463,7 @@ const RandomImpl = [
|
|
|
463
463
|
}
|
|
464
464
|
catch (err) {
|
|
465
465
|
throw new EastError(`Random exponential generation failed: ${err.message}`, {
|
|
466
|
-
location: { filename: "random_exponential", line: 0n, column: 0n },
|
|
466
|
+
location: [{ filename: "random_exponential", line: 0n, column: 0n }],
|
|
467
467
|
cause: err
|
|
468
468
|
});
|
|
469
469
|
}
|
|
@@ -476,7 +476,7 @@ const RandomImpl = [
|
|
|
476
476
|
}
|
|
477
477
|
catch (err) {
|
|
478
478
|
throw new EastError(`Random Weibull generation failed: ${err.message}`, {
|
|
479
|
-
location: { filename: "random_weibull", line: 0n, column: 0n },
|
|
479
|
+
location: [{ filename: "random_weibull", line: 0n, column: 0n }],
|
|
480
480
|
cause: err
|
|
481
481
|
});
|
|
482
482
|
}
|
|
@@ -487,7 +487,7 @@ const RandomImpl = [
|
|
|
487
487
|
}
|
|
488
488
|
catch (err) {
|
|
489
489
|
throw new EastError(`Random Bernoulli generation failed: ${err.message}`, {
|
|
490
|
-
location: { filename: "random_bernoulli", line: 0n, column: 0n },
|
|
490
|
+
location: [{ filename: "random_bernoulli", line: 0n, column: 0n }],
|
|
491
491
|
cause: err
|
|
492
492
|
});
|
|
493
493
|
}
|
|
@@ -498,7 +498,7 @@ const RandomImpl = [
|
|
|
498
498
|
}
|
|
499
499
|
catch (err) {
|
|
500
500
|
throw new EastError(`Random binomial generation failed: ${err.message}`, {
|
|
501
|
-
location: { filename: "random_binomial", line: 0n, column: 0n },
|
|
501
|
+
location: [{ filename: "random_binomial", line: 0n, column: 0n }],
|
|
502
502
|
cause: err
|
|
503
503
|
});
|
|
504
504
|
}
|
|
@@ -509,7 +509,7 @@ const RandomImpl = [
|
|
|
509
509
|
}
|
|
510
510
|
catch (err) {
|
|
511
511
|
throw new EastError(`Random geometric generation failed: ${err.message}`, {
|
|
512
|
-
location: { filename: "random_geometric", line: 0n, column: 0n },
|
|
512
|
+
location: [{ filename: "random_geometric", line: 0n, column: 0n }],
|
|
513
513
|
cause: err
|
|
514
514
|
});
|
|
515
515
|
}
|
|
@@ -520,7 +520,7 @@ const RandomImpl = [
|
|
|
520
520
|
}
|
|
521
521
|
catch (err) {
|
|
522
522
|
throw new EastError(`Random Poisson generation failed: ${err.message}`, {
|
|
523
|
-
location: { filename: "random_poisson", line: 0n, column: 0n },
|
|
523
|
+
location: [{ filename: "random_poisson", line: 0n, column: 0n }],
|
|
524
524
|
cause: err
|
|
525
525
|
});
|
|
526
526
|
}
|
|
@@ -531,7 +531,7 @@ const RandomImpl = [
|
|
|
531
531
|
}
|
|
532
532
|
catch (err) {
|
|
533
533
|
throw new EastError(`Random Pareto generation failed: ${err.message}`, {
|
|
534
|
-
location: { filename: "random_pareto", line: 0n, column: 0n },
|
|
534
|
+
location: [{ filename: "random_pareto", line: 0n, column: 0n }],
|
|
535
535
|
cause: err
|
|
536
536
|
});
|
|
537
537
|
}
|
|
@@ -542,7 +542,7 @@ const RandomImpl = [
|
|
|
542
542
|
}
|
|
543
543
|
catch (err) {
|
|
544
544
|
throw new EastError(`Random log-normal generation failed: ${err.message}`, {
|
|
545
|
-
location: { filename: "random_log_normal", line: 0n, column: 0n },
|
|
545
|
+
location: [{ filename: "random_log_normal", line: 0n, column: 0n }],
|
|
546
546
|
cause: err
|
|
547
547
|
});
|
|
548
548
|
}
|
|
@@ -553,7 +553,7 @@ const RandomImpl = [
|
|
|
553
553
|
}
|
|
554
554
|
catch (err) {
|
|
555
555
|
throw new EastError(`Random Irwin-Hall generation failed: ${err.message}`, {
|
|
556
|
-
location: { filename: "random_irwin_hall", line: 0n, column: 0n },
|
|
556
|
+
location: [{ filename: "random_irwin_hall", line: 0n, column: 0n }],
|
|
557
557
|
cause: err
|
|
558
558
|
});
|
|
559
559
|
}
|
|
@@ -564,7 +564,7 @@ const RandomImpl = [
|
|
|
564
564
|
}
|
|
565
565
|
catch (err) {
|
|
566
566
|
throw new EastError(`Random Bates generation failed: ${err.message}`, {
|
|
567
|
-
location: { filename: "random_bates", line: 0n, column: 0n },
|
|
567
|
+
location: [{ filename: "random_bates", line: 0n, column: 0n }],
|
|
568
568
|
cause: err
|
|
569
569
|
});
|
|
570
570
|
}
|
package/dist/random.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAC5D,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAChE,OAAO,YAAY,MAAM,oCAAoC,CAAC;AAC9D,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAChE,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAC5D,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,wEAAwE;AACxE,IAAI,SAAS,GAAQ,IAAI,SAAS,E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;;;;OAqBG;IACH,SAAS,EAAE,gBAAgB;IAE3B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,EAAE,eAAe;IAEzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAS,EAAE,gBAAgB;IAE3B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,EAAE,cAAc;IAEvB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,EAAE,aAAa;IAErB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,EAAE,iBAAiB;IAE5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAS,EAAE,iBAAiB;IAE5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,EAAE,YAAY;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI,EAAE,WAAW;IAEjB;;;;OAIG;IACH,cAAc,EAAE,UAAU;CACpB,CAAC;AAEX,gDAAgD;AAChD,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AASA,OAAO,EAA2B,IAAI,EAAwB,QAAQ,
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AASA,OAAO,EAA2B,IAAI,EAAwB,QAAQ,EAAkB,UAAU,EAAa,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9J,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkDzF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,gBAAgB,EAQtC,CAAA;AAID;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEjC;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AAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAgBpF;;;;;;;OAOG;cACO,CAAC,SAAS,IAAI,UAAU,CAAC,YAAY,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAgBzF;;;;;;;OAOG;YACK,CAAC,SAAS,IAAI,UAAU,CAAC,YAAY,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAgBvF;;;;;;;OAOG;iBACU,CAAC,SAAS,IAAI,UAAU,CAAC,YAAY,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAgB5F;;;;;;;;OAQG;YACK,CAAC,SAAS,IAAI,UAAU,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAgBnI;;;;;;OAMG;eACQ,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM;IAuBtC;;;;;OAKG;kBACW,kBAAkB,CAAC,UAAU,CAAC;CAK/C,CAAC"}
|
package/dist/test.js
CHANGED
|
@@ -7,7 +7,7 @@ import util from "node:util";
|
|
|
7
7
|
import { test as testNode, describe as describeNode } from "node:test";
|
|
8
8
|
import { writeFileSync, mkdirSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
|
-
import { AsyncFunctionType, East, Expr, get_location, IRType, NullType, StringType, toJSONFor } from "@elaraai/east";
|
|
10
|
+
import { AsyncFunctionType, East, Expr, get_location, IRType, NullType, printLocations, StringType, toJSONFor } from "@elaraai/east";
|
|
11
11
|
const { str } = East;
|
|
12
12
|
// Force node test to show full stack traces for easier debugging
|
|
13
13
|
Error.stackTraceLimit = Infinity;
|
|
@@ -166,12 +166,12 @@ export const Assert = {
|
|
|
166
166
|
* @returns An East expression that performs the equality check
|
|
167
167
|
*/
|
|
168
168
|
is(actual, expected) {
|
|
169
|
-
const location = get_location(
|
|
169
|
+
const location = get_location();
|
|
170
170
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
171
171
|
return Expr.tryCatch(Expr.block($ => {
|
|
172
172
|
const act = $.let(actual);
|
|
173
173
|
const exp = $.let(expected_expr);
|
|
174
|
-
return East.is(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be ${exp} (${
|
|
174
|
+
return East.is(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be ${exp} (${printLocations(location)})`));
|
|
175
175
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
176
176
|
},
|
|
177
177
|
/**
|
|
@@ -183,12 +183,12 @@ export const Assert = {
|
|
|
183
183
|
* @returns An East expression that performs the equality check
|
|
184
184
|
*/
|
|
185
185
|
equal(actual, expected) {
|
|
186
|
-
const location = get_location(
|
|
186
|
+
const location = get_location();
|
|
187
187
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
188
188
|
return Expr.tryCatch(Expr.block($ => {
|
|
189
189
|
const act = $.let(actual);
|
|
190
190
|
const exp = $.let(expected_expr);
|
|
191
|
-
return East.equal(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to equal ${exp} (${
|
|
191
|
+
return East.equal(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to equal ${exp} (${printLocations(location)})`));
|
|
192
192
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
193
193
|
},
|
|
194
194
|
/**
|
|
@@ -200,12 +200,12 @@ export const Assert = {
|
|
|
200
200
|
* @returns An East expression that performs the inequality check
|
|
201
201
|
*/
|
|
202
202
|
notEqual(actual, expected) {
|
|
203
|
-
const location = get_location(
|
|
203
|
+
const location = get_location();
|
|
204
204
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
205
205
|
return Expr.tryCatch(Expr.block($ => {
|
|
206
206
|
const act = $.let(actual);
|
|
207
207
|
const exp = $.let(expected_expr);
|
|
208
|
-
return East.notEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to not equal ${exp} (${
|
|
208
|
+
return East.notEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to not equal ${exp} (${printLocations(location)})`));
|
|
209
209
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
210
210
|
},
|
|
211
211
|
/**
|
|
@@ -217,12 +217,12 @@ export const Assert = {
|
|
|
217
217
|
* @returns An East expression that performs the less-than check
|
|
218
218
|
*/
|
|
219
219
|
less(actual, expected) {
|
|
220
|
-
const location = get_location(
|
|
220
|
+
const location = get_location();
|
|
221
221
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
222
222
|
return Expr.tryCatch(Expr.block($ => {
|
|
223
223
|
const act = $.let(actual);
|
|
224
224
|
const exp = $.let(expected_expr);
|
|
225
|
-
return East.less(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be less than ${exp} (${
|
|
225
|
+
return East.less(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be less than ${exp} (${printLocations(location)})`));
|
|
226
226
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
227
227
|
},
|
|
228
228
|
/**
|
|
@@ -234,12 +234,12 @@ export const Assert = {
|
|
|
234
234
|
* @returns An East expression that performs the less-than-or-equal check
|
|
235
235
|
*/
|
|
236
236
|
lessEqual(actual, expected) {
|
|
237
|
-
const location = get_location(
|
|
237
|
+
const location = get_location();
|
|
238
238
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
239
239
|
return Expr.tryCatch(Expr.block($ => {
|
|
240
240
|
const act = $.let(actual);
|
|
241
241
|
const exp = $.let(expected_expr);
|
|
242
|
-
return East.lessEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be less than or equal to ${exp} (${
|
|
242
|
+
return East.lessEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be less than or equal to ${exp} (${printLocations(location)})`));
|
|
243
243
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
244
244
|
},
|
|
245
245
|
/**
|
|
@@ -251,12 +251,12 @@ export const Assert = {
|
|
|
251
251
|
* @returns An East expression that performs the greater-than check
|
|
252
252
|
*/
|
|
253
253
|
greater(actual, expected) {
|
|
254
|
-
const location = get_location(
|
|
254
|
+
const location = get_location();
|
|
255
255
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
256
256
|
return Expr.tryCatch(Expr.block($ => {
|
|
257
257
|
const act = $.let(actual);
|
|
258
258
|
const exp = $.let(expected_expr);
|
|
259
|
-
return East.greater(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be greater than ${exp} (${
|
|
259
|
+
return East.greater(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be greater than ${exp} (${printLocations(location)})`));
|
|
260
260
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
261
261
|
},
|
|
262
262
|
/**
|
|
@@ -268,12 +268,12 @@ export const Assert = {
|
|
|
268
268
|
* @returns An East expression that performs the greater-than-or-equal check
|
|
269
269
|
*/
|
|
270
270
|
greaterEqual(actual, expected) {
|
|
271
|
-
const location = get_location(
|
|
271
|
+
const location = get_location();
|
|
272
272
|
const expected_expr = Expr.from(expected, Expr.type(actual));
|
|
273
273
|
return Expr.tryCatch(Expr.block($ => {
|
|
274
274
|
const act = $.let(actual);
|
|
275
275
|
const exp = $.let(expected_expr);
|
|
276
|
-
return East.greaterEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be greater than or equal to ${exp} (${
|
|
276
|
+
return East.greaterEqual(act, exp).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${act} to be greater than or equal to ${exp} (${printLocations(location)})`));
|
|
277
277
|
}), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
278
278
|
},
|
|
279
279
|
/**
|
|
@@ -286,10 +286,10 @@ export const Assert = {
|
|
|
286
286
|
* @returns An East expression that performs the range check
|
|
287
287
|
*/
|
|
288
288
|
between(actual, min, max) {
|
|
289
|
-
const location = get_location(
|
|
289
|
+
const location = get_location();
|
|
290
290
|
const min_expr = Expr.from(min, Expr.type(actual));
|
|
291
291
|
const max_expr = Expr.from(max, Expr.type(actual));
|
|
292
|
-
return Expr.tryCatch(East.greaterEqual(actual, min_expr).ifElse(_$ => East.lessEqual(actual, max_expr).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${actual} to be less than or equal to ${max_expr} (${
|
|
292
|
+
return Expr.tryCatch(East.greaterEqual(actual, min_expr).ifElse(_$ => East.lessEqual(actual, max_expr).ifElse(_$ => testPass(), _$ => testFail(str `Expected ${actual} to be less than or equal to ${max_expr} (${printLocations(location)})`)), _$ => testFail(str `Expected ${actual} to be greater than or equal to ${min_expr}`)), (_$, message, stack) => testFail(East.String.printError(message, stack)));
|
|
293
293
|
},
|
|
294
294
|
/**
|
|
295
295
|
* Asserts that an expression throws an error.
|
|
@@ -299,10 +299,10 @@ export const Assert = {
|
|
|
299
299
|
* @returns An East expression that verifies an error is thrown
|
|
300
300
|
*/
|
|
301
301
|
throws(fn, pattern) {
|
|
302
|
-
const location = get_location(
|
|
302
|
+
const location = get_location();
|
|
303
303
|
return Expr.tryCatch(Expr.block($ => {
|
|
304
304
|
const result = $.let(fn);
|
|
305
|
-
$(testFail(str `Expected error, got ${result} (${
|
|
305
|
+
$(testFail(str `Expected error, got ${result} (${printLocations(location)})`));
|
|
306
306
|
return null;
|
|
307
307
|
}), ($, message, stack) => {
|
|
308
308
|
if (pattern) {
|
|
@@ -322,9 +322,9 @@ export const Assert = {
|
|
|
322
322
|
* @returns An East expression that unconditionally fails the test
|
|
323
323
|
*/
|
|
324
324
|
fail(message) {
|
|
325
|
-
const location = get_location(
|
|
325
|
+
const location = get_location();
|
|
326
326
|
const message_expr = Expr.from(message, StringType);
|
|
327
|
-
return testFail(str `${message_expr} (${
|
|
327
|
+
return testFail(str `${message_expr} (${printLocations(location)})`);
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
330
|
//# sourceMappingURL=test.js.map
|