mimium-web 4.0.2 → 4.1.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
CHANGED
|
@@ -73,6 +73,8 @@ mimium can describe digital signal processing algorithm from very low-level, lik
|
|
|
73
73
|
|
|
74
74
|
mimium's VM design is inspired by Lua, that can be easily embedded on Rust application through the plugin system. External functions (closures) defined in Rust can be easily called from mimium.
|
|
75
75
|
|
|
76
|
+
Also, the code itself can be transpiled into Rust code which enables a quick prototyping of the development of native audio application.
|
|
77
|
+
|
|
76
78
|
## Installation
|
|
77
79
|
|
|
78
80
|
The easiest way to start mimium is using [Visual Studio Code Extension](https://github.com/mimium-org/mimium-language). The extention will automatically download CLI tool `mimium-cli` and language server (support for syntactic highlight and error reporting) when installed.
|
package/mimium_web.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export class Context {
|
|
|
18
18
|
clear_virtual_file_cache(): void;
|
|
19
19
|
compile(src: string): Promise<void>;
|
|
20
20
|
compile_direct(src: string): void;
|
|
21
|
+
emit_rust(src: string): Promise<string>;
|
|
22
|
+
emit_rust_direct(src: string): string;
|
|
21
23
|
export_virtual_file_cache_json(): string;
|
|
22
24
|
get_input_channels(): number;
|
|
23
25
|
get_output_channels(): number;
|
|
@@ -57,6 +59,8 @@ export interface InitOutput {
|
|
|
57
59
|
readonly context_clear_virtual_file_cache: (a: number) => [number, number];
|
|
58
60
|
readonly context_compile: (a: number, b: number, c: number) => any;
|
|
59
61
|
readonly context_compile_direct: (a: number, b: number, c: number) => [number, number];
|
|
62
|
+
readonly context_emit_rust: (a: number, b: number, c: number) => any;
|
|
63
|
+
readonly context_emit_rust_direct: (a: number, b: number, c: number) => [number, number, number, number];
|
|
60
64
|
readonly context_export_virtual_file_cache_json: (a: number) => [number, number, number, number];
|
|
61
65
|
readonly context_get_input_channels: (a: number) => number;
|
|
62
66
|
readonly context_get_output_channels: (a: number) => number;
|
package/mimium_web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @ts-self-types="./mimium_web.d.ts" */
|
|
2
|
-
import { __mimium_test_clear_cache, __mimium_test_put_cache, export_virtual_file_cache_json, get_env, has_network_api, import_virtual_file_cache_json, preload_mimium_lib_cache, preload_user_module_cache, read_file, set_module_base_url } from './snippets/mimium-lang-
|
|
2
|
+
import { __mimium_test_clear_cache, __mimium_test_put_cache, export_virtual_file_cache_json, get_env, has_network_api, import_virtual_file_cache_json, preload_mimium_lib_cache, preload_user_module_cache, read_file, set_module_base_url } from './snippets/mimium-lang-d0d4bf66b955afd8/src/utils/fileloader.js';
|
|
3
3
|
|
|
4
4
|
export class Config {
|
|
5
5
|
static __wrap(ptr) {
|
|
@@ -119,6 +119,40 @@ export class Context {
|
|
|
119
119
|
throw takeFromExternrefTable0(ret[0]);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* @param {string} src
|
|
124
|
+
* @returns {Promise<string>}
|
|
125
|
+
*/
|
|
126
|
+
emit_rust(src) {
|
|
127
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
128
|
+
const len0 = WASM_VECTOR_LEN;
|
|
129
|
+
const ret = wasm.context_emit_rust(this.__wbg_ptr, ptr0, len0);
|
|
130
|
+
return ret;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @param {string} src
|
|
134
|
+
* @returns {string}
|
|
135
|
+
*/
|
|
136
|
+
emit_rust_direct(src) {
|
|
137
|
+
let deferred3_0;
|
|
138
|
+
let deferred3_1;
|
|
139
|
+
try {
|
|
140
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
141
|
+
const len0 = WASM_VECTOR_LEN;
|
|
142
|
+
const ret = wasm.context_emit_rust_direct(this.__wbg_ptr, ptr0, len0);
|
|
143
|
+
var ptr2 = ret[0];
|
|
144
|
+
var len2 = ret[1];
|
|
145
|
+
if (ret[3]) {
|
|
146
|
+
ptr2 = 0; len2 = 0;
|
|
147
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
148
|
+
}
|
|
149
|
+
deferred3_0 = ptr2;
|
|
150
|
+
deferred3_1 = len2;
|
|
151
|
+
return getStringFromWasm0(ptr2, len2);
|
|
152
|
+
} finally {
|
|
153
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
122
156
|
/**
|
|
123
157
|
* @returns {string}
|
|
124
158
|
*/
|
|
@@ -263,10 +297,10 @@ if (Symbol.dispose) Context.prototype[Symbol.dispose] = Context.prototype.free;
|
|
|
263
297
|
function __wbg_get_imports() {
|
|
264
298
|
const import0 = {
|
|
265
299
|
__proto__: null,
|
|
266
|
-
|
|
300
|
+
__wbg___mimium_test_clear_cache_89961b5a0f901937: function() { return handleError(function () {
|
|
267
301
|
__mimium_test_clear_cache();
|
|
268
302
|
}, arguments); },
|
|
269
|
-
|
|
303
|
+
__wbg___mimium_test_put_cache_749da6d7af996257: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
270
304
|
__mimium_test_put_cache(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
271
305
|
}, arguments); },
|
|
272
306
|
__wbg___wbindgen_copy_to_typed_array_d2f20acdab8e0740: function(arg0, arg1, arg2) {
|
|
@@ -308,25 +342,25 @@ function __wbg_get_imports() {
|
|
|
308
342
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
309
343
|
}
|
|
310
344
|
},
|
|
311
|
-
|
|
345
|
+
__wbg_export_virtual_file_cache_json_9a56e9489ae394ce: function() { return handleError(function (arg0) {
|
|
312
346
|
const ret = export_virtual_file_cache_json();
|
|
313
347
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
348
|
const len1 = WASM_VECTOR_LEN;
|
|
315
349
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
316
350
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
317
351
|
}, arguments); },
|
|
318
|
-
|
|
352
|
+
__wbg_get_env_76170448cd707855: function() { return handleError(function (arg0, arg1, arg2) {
|
|
319
353
|
const ret = get_env(getStringFromWasm0(arg1, arg2));
|
|
320
354
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
355
|
const len1 = WASM_VECTOR_LEN;
|
|
322
356
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
323
357
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
324
358
|
}, arguments); },
|
|
325
|
-
|
|
359
|
+
__wbg_has_network_api_02befa5d40376823: function() { return handleError(function () {
|
|
326
360
|
const ret = has_network_api();
|
|
327
361
|
return ret;
|
|
328
362
|
}, arguments); },
|
|
329
|
-
|
|
363
|
+
__wbg_import_virtual_file_cache_json_e20e305af4609e51: function() { return handleError(function (arg0, arg1) {
|
|
330
364
|
import_virtual_file_cache_json(getStringFromWasm0(arg0, arg1));
|
|
331
365
|
}, arguments); },
|
|
332
366
|
__wbg_new_227d7c05414eb861: function() {
|
|
@@ -351,11 +385,11 @@ function __wbg_get_imports() {
|
|
|
351
385
|
state0.a = state0.b = 0;
|
|
352
386
|
}
|
|
353
387
|
},
|
|
354
|
-
|
|
388
|
+
__wbg_preload_mimium_lib_cache_4ff9f8dc91be76c2: function() { return handleError(function (arg0, arg1) {
|
|
355
389
|
const ret = preload_mimium_lib_cache(getStringFromWasm0(arg0, arg1));
|
|
356
390
|
return ret;
|
|
357
391
|
}, arguments); },
|
|
358
|
-
|
|
392
|
+
__wbg_preload_user_module_cache_459f8ba3895269ce: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
359
393
|
const ret = preload_user_module_cache(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
360
394
|
return ret;
|
|
361
395
|
}, arguments); },
|
|
@@ -366,7 +400,7 @@ function __wbg_get_imports() {
|
|
|
366
400
|
__wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
|
|
367
401
|
queueMicrotask(arg0);
|
|
368
402
|
},
|
|
369
|
-
|
|
403
|
+
__wbg_read_file_b163857e87690fb8: function() { return handleError(function (arg0, arg1, arg2) {
|
|
370
404
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
371
405
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
372
406
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -377,7 +411,7 @@ function __wbg_get_imports() {
|
|
|
377
411
|
const ret = Promise.resolve(arg0);
|
|
378
412
|
return ret;
|
|
379
413
|
},
|
|
380
|
-
|
|
414
|
+
__wbg_set_module_base_url_8faed4c6d76822ae: function() { return handleError(function (arg0, arg1) {
|
|
381
415
|
set_module_base_url(getStringFromWasm0(arg0, arg1));
|
|
382
416
|
}, arguments); },
|
|
383
417
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
@@ -412,7 +446,7 @@ function __wbg_get_imports() {
|
|
|
412
446
|
return ret;
|
|
413
447
|
},
|
|
414
448
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
415
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
449
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 627, function: Function { arguments: [Externref], shim_idx: 628, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
416
450
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__ha96a9ccc7977162c, wasm_bindgen__convert__closures_____invoke__hc29654df3a848ae0);
|
|
417
451
|
return ret;
|
|
418
452
|
},
|
package/mimium_web_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
File without changes
|