toilscript 0.0.1 → 0.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/LICENSE +201 -201
- package/NOTICE +94 -94
- package/README.md +101 -114
- package/bin/asc.js +0 -0
- package/bin/asinit.js +6 -6
- package/dist/asc.generated.d.ts +10027 -0
- package/dist/asc.js +24474 -0
- package/dist/asc.js.map +7 -0
- package/dist/importmap.json +9 -0
- package/dist/toilscript.generated.d.ts +11242 -0
- package/dist/toilscript.js +337 -0
- package/dist/toilscript.js.map +7 -0
- package/dist/web.js +22 -0
- package/lib/binaryen.d.ts +2 -2
- package/lib/binaryen.js +2 -2
- package/package.json +115 -114
- package/std/README.md +6 -6
- package/std/assembly/array.ts +550 -550
- package/std/assembly/arraybuffer.ts +77 -77
- package/std/assembly/atomics.ts +127 -127
- package/std/assembly/bindings/asyncify.ts +16 -16
- package/std/assembly/bindings/dom.ts +291 -291
- package/std/assembly/bindings/node.ts +6 -6
- package/std/assembly/bitflags.ts +53 -53
- package/std/assembly/builtins.ts +2650 -2650
- package/std/assembly/byteslice.ts +177 -177
- package/std/assembly/compat.ts +2 -2
- package/std/assembly/console.ts +42 -42
- package/std/assembly/crypto.ts +9 -9
- package/std/assembly/dataview.ts +181 -181
- package/std/assembly/date.ts +375 -375
- package/std/assembly/diagnostics.ts +11 -11
- package/std/assembly/encoding.ts +151 -151
- package/std/assembly/endian.ts +45 -45
- package/std/assembly/error.ts +44 -44
- package/std/assembly/fixedarray.ts +173 -173
- package/std/assembly/fixedmap.ts +326 -326
- package/std/assembly/fixedset.ts +275 -275
- package/std/assembly/function.ts +42 -42
- package/std/assembly/index.d.ts +2892 -2891
- package/std/assembly/iterator.ts +35 -35
- package/std/assembly/map.ts +269 -269
- package/std/assembly/math.ts +3289 -3289
- package/std/assembly/memory.ts +123 -123
- package/std/assembly/number.ts +388 -388
- package/std/assembly/object.ts +36 -36
- package/std/assembly/performance.ts +9 -9
- package/std/assembly/pointer.ts +80 -80
- package/std/assembly/polyfills.ts +27 -27
- package/std/assembly/process.ts +50 -50
- package/std/assembly/reference.ts +48 -48
- package/std/assembly/regexp.ts +12 -12
- package/std/assembly/rt/README.md +83 -83
- package/std/assembly/rt/common.ts +81 -81
- package/std/assembly/rt/index-incremental.ts +2 -2
- package/std/assembly/rt/index-memory.ts +1 -1
- package/std/assembly/rt/index-minimal.ts +2 -2
- package/std/assembly/rt/index-stub.ts +1 -1
- package/std/assembly/rt/index.d.ts +37 -37
- package/std/assembly/rt/itcms.ts +419 -419
- package/std/assembly/rt/memory-runtime.ts +94 -94
- package/std/assembly/rt/rtrace.ts +15 -15
- package/std/assembly/rt/stub.ts +133 -133
- package/std/assembly/rt/tcms.ts +254 -254
- package/std/assembly/rt/tlsf.ts +592 -592
- package/std/assembly/rt.ts +90 -90
- package/std/assembly/set.ts +225 -225
- package/std/assembly/shared/feature.ts +68 -68
- package/std/assembly/shared/runtime.ts +13 -13
- package/std/assembly/shared/target.ts +11 -11
- package/std/assembly/shared/tsconfig.json +11 -11
- package/std/assembly/shared/typeinfo.ts +72 -72
- package/std/assembly/staticarray.ts +423 -423
- package/std/assembly/string.ts +850 -850
- package/std/assembly/symbol.ts +114 -114
- package/std/assembly/table.ts +16 -16
- package/std/assembly/toilscript.ts +16 -0
- package/std/assembly/tsconfig.json +6 -6
- package/std/assembly/typedarray.ts +1954 -1954
- package/std/assembly/uri.ts +17 -17
- package/std/assembly/util/bytes.ts +107 -107
- package/std/assembly/util/casemap.ts +497 -497
- package/std/assembly/util/error.ts +58 -58
- package/std/assembly/util/hash.ts +117 -117
- package/std/assembly/util/math.ts +1922 -1922
- package/std/assembly/util/memory.ts +290 -290
- package/std/assembly/util/number.ts +873 -873
- package/std/assembly/util/sort.ts +313 -313
- package/std/assembly/util/string.ts +1202 -1202
- package/std/assembly/util/uri.ts +275 -275
- package/std/assembly/vector.ts +4 -4
- package/std/assembly.json +16 -16
- package/std/portable/index.d.ts +461 -461
- package/std/portable/index.js +416 -416
- package/std/portable.json +11 -11
- package/std/types/assembly/index.d.ts +1 -1
- package/std/types/assembly/package.json +2 -2
- package/std/types/portable/index.d.ts +1 -1
- package/std/types/portable/package.json +2 -2
- package/tsconfig-base.json +13 -13
- package/util/README.md +23 -23
- package/util/browser/fs.js +1 -1
- package/util/browser/module.js +5 -5
- package/util/browser/path.js +520 -520
- package/util/browser/process.js +59 -59
- package/util/browser/url.js +23 -23
- package/util/cpu.d.ts +9 -9
- package/util/cpu.js +42 -42
- package/util/find.d.ts +6 -6
- package/util/find.js +20 -20
- package/util/node.d.ts +21 -21
- package/util/node.js +34 -34
- package/util/options.d.ts +70 -70
- package/util/options.js +262 -262
- package/util/terminal.d.ts +52 -52
- package/util/terminal.js +35 -35
- package/util/text.d.ts +26 -26
- package/util/text.js +114 -114
- package/util/tsconfig.json +9 -9
- package/util/web.d.ts +11 -11
- package/util/web.js +33 -33
package/dist/web.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var ASSEMBLYSCRIPT_VERSION = "0.1.1";
|
|
2
|
+
var ASSEMBLYSCRIPT_IMPORTMAP = {
|
|
3
|
+
"imports": {
|
|
4
|
+
"toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.1/dist/toilscript.js",
|
|
5
|
+
"toilscript/asc": "https://cdn.jsdelivr.net/npm/toilscript@0.1.1/dist/asc.js",
|
|
6
|
+
"binaryen": "https://cdn.jsdelivr.net/npm/binaryen@129.0.0-nightly.20260428/index.js",
|
|
7
|
+
"long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
if (!document.currentScript.src.includes("noinstall")) {
|
|
11
|
+
let elem = document.createElement("script");
|
|
12
|
+
elem.type = "importmap";
|
|
13
|
+
elem.text = JSON.stringify(ASSEMBLYSCRIPT_IMPORTMAP);
|
|
14
|
+
document.head.appendChild(elem);
|
|
15
|
+
}
|
|
16
|
+
if (!document.currentScript.src.includes("noshim")) {
|
|
17
|
+
let elem = document.createElement("script");
|
|
18
|
+
elem.async = true;
|
|
19
|
+
elem.src = "https://cdn.jsdelivr.net/npm/es-module-shims@1/dist/es-module-shims.wasm.min.js";
|
|
20
|
+
document.head.appendChild(elem);
|
|
21
|
+
}
|
|
22
|
+
|
package/lib/binaryen.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "binaryen";
|
|
2
|
-
export { default } from "binaryen";
|
|
1
|
+
export * from "binaryen";
|
|
2
|
+
export { default } from "binaryen";
|
package/lib/binaryen.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "binaryen";
|
|
2
|
-
export { default } from "binaryen";
|
|
1
|
+
export * from "binaryen";
|
|
2
|
+
export { default } from "binaryen";
|
package/package.json
CHANGED
|
@@ -1,114 +1,115 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "toilscript",
|
|
3
|
-
"description": "A TypeScript-like language for WebAssembly.",
|
|
4
|
-
"keywords": [
|
|
5
|
-
"typescript",
|
|
6
|
-
"webassembly",
|
|
7
|
-
"compiler",
|
|
8
|
-
"toilscript",
|
|
9
|
-
"wasm"
|
|
10
|
-
],
|
|
11
|
-
"version": "0.
|
|
12
|
-
"author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
|
|
13
|
-
"license": "Apache-2.0",
|
|
14
|
-
"homepage": "https://github.com/dacely-cloud/toilscript",
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "https://github.com/dacely-cloud/toilscript.git"
|
|
18
|
-
},
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/dacely-cloud/toilscript/issues"
|
|
21
|
-
},
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=20",
|
|
24
|
-
"npm": ">=10"
|
|
25
|
-
},
|
|
26
|
-
"engineStrict": true,
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"binaryen": "129.0.0-nightly.20260428",
|
|
29
|
-
"long": "^5.2.4"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@eslint/js": "^10.0.1",
|
|
33
|
-
"@types/node": "^25.6.0",
|
|
34
|
-
"as-float": "^1.0.1",
|
|
35
|
-
"diff": "^9.0.0",
|
|
36
|
-
"esbuild": "^0.28.0",
|
|
37
|
-
"eslint": "^10.2.1",
|
|
38
|
-
"glob": "^13.0.6",
|
|
39
|
-
"globals": "^17.5.0",
|
|
40
|
-
"typescript": "^6.0.3",
|
|
41
|
-
"typescript-eslint": "^8.59.0"
|
|
42
|
-
},
|
|
43
|
-
"type": "module",
|
|
44
|
-
"exports": {
|
|
45
|
-
".": {
|
|
46
|
-
"import": "./dist/toilscript.js",
|
|
47
|
-
"types": "./dist/toilscript.d.ts"
|
|
48
|
-
},
|
|
49
|
-
"./asc": {
|
|
50
|
-
"import": "./dist/asc.js",
|
|
51
|
-
"types": "./dist/asc.d.ts"
|
|
52
|
-
},
|
|
53
|
-
"./transform": {
|
|
54
|
-
"import": "./dist/transform.js",
|
|
55
|
-
"types": "./dist/transform.d.ts",
|
|
56
|
-
"require": "./dist/transform.cjs"
|
|
57
|
-
},
|
|
58
|
-
"./binaryen": {
|
|
59
|
-
"import": "./lib/binaryen.js",
|
|
60
|
-
"types": "./lib/binaryen.d.ts"
|
|
61
|
-
},
|
|
62
|
-
"./*": "./*"
|
|
63
|
-
},
|
|
64
|
-
"imports": {
|
|
65
|
-
"#rtrace": {
|
|
66
|
-
"import": "./lib/rtrace/index.js",
|
|
67
|
-
"types": "./lib/rtrace/index.d.ts"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"bin": {
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
},
|
|
74
|
-
"scripts": {
|
|
75
|
-
"check": "npm run check:config && npm run check:import && npm run lint",
|
|
76
|
-
"check:config": "tsc --noEmit -p src --diagnostics --listFiles",
|
|
77
|
-
"check:import": "tsc --noEmit --skipLibCheck --target ESNEXT --module nodenext --moduleResolution nodenext --experimentalDecorators tests/import/index",
|
|
78
|
-
"lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
|
|
79
|
-
"build": "node scripts/build",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"test
|
|
84
|
-
"test:
|
|
85
|
-
"test:
|
|
86
|
-
"test:
|
|
87
|
-
"test:
|
|
88
|
-
"test:transform
|
|
89
|
-
"test:transform:
|
|
90
|
-
"test:
|
|
91
|
-
"
|
|
92
|
-
"asbuild
|
|
93
|
-
"asbuild:
|
|
94
|
-
"asbuild:
|
|
95
|
-
"
|
|
96
|
-
"bootstrap
|
|
97
|
-
"bootstrap:
|
|
98
|
-
"bootstrap:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"lib/binaryen.
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "toilscript",
|
|
3
|
+
"description": "A TypeScript-like language for WebAssembly.",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"typescript",
|
|
6
|
+
"webassembly",
|
|
7
|
+
"compiler",
|
|
8
|
+
"toilscript",
|
|
9
|
+
"wasm"
|
|
10
|
+
],
|
|
11
|
+
"version": "0.1.1",
|
|
12
|
+
"author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"homepage": "https://github.com/dacely-cloud/toilscript",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/dacely-cloud/toilscript.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/dacely-cloud/toilscript/issues"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20",
|
|
24
|
+
"npm": ">=10"
|
|
25
|
+
},
|
|
26
|
+
"engineStrict": true,
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"binaryen": "129.0.0-nightly.20260428",
|
|
29
|
+
"long": "^5.2.4"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@eslint/js": "^10.0.1",
|
|
33
|
+
"@types/node": "^25.6.0",
|
|
34
|
+
"as-float": "^1.0.1",
|
|
35
|
+
"diff": "^9.0.0",
|
|
36
|
+
"esbuild": "^0.28.0",
|
|
37
|
+
"eslint": "^10.2.1",
|
|
38
|
+
"glob": "^13.0.6",
|
|
39
|
+
"globals": "^17.5.0",
|
|
40
|
+
"typescript": "^6.0.3",
|
|
41
|
+
"typescript-eslint": "^8.59.0"
|
|
42
|
+
},
|
|
43
|
+
"type": "module",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"import": "./dist/toilscript.js",
|
|
47
|
+
"types": "./dist/toilscript.d.ts"
|
|
48
|
+
},
|
|
49
|
+
"./asc": {
|
|
50
|
+
"import": "./dist/asc.js",
|
|
51
|
+
"types": "./dist/asc.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"./transform": {
|
|
54
|
+
"import": "./dist/transform.js",
|
|
55
|
+
"types": "./dist/transform.d.ts",
|
|
56
|
+
"require": "./dist/transform.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./binaryen": {
|
|
59
|
+
"import": "./lib/binaryen.js",
|
|
60
|
+
"types": "./lib/binaryen.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./*": "./*"
|
|
63
|
+
},
|
|
64
|
+
"imports": {
|
|
65
|
+
"#rtrace": {
|
|
66
|
+
"import": "./lib/rtrace/index.js",
|
|
67
|
+
"types": "./lib/rtrace/index.d.ts"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"bin": {
|
|
71
|
+
"toilscript": "./bin/asc.js",
|
|
72
|
+
"toilinit": "./bin/asinit.js"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"check": "npm run check:config && npm run check:import && npm run lint",
|
|
76
|
+
"check:config": "tsc --noEmit -p src --diagnostics --listFiles",
|
|
77
|
+
"check:import": "tsc --noEmit --skipLibCheck --target ESNEXT --module nodenext --moduleResolution nodenext --experimentalDecorators tests/import/index",
|
|
78
|
+
"lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
|
|
79
|
+
"build": "node scripts/build",
|
|
80
|
+
"prepublishOnly": "node scripts/build",
|
|
81
|
+
"watch": "node scripts/build --watch",
|
|
82
|
+
"coverage": "npx c8 -- npm test",
|
|
83
|
+
"test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform && npm run test:cli",
|
|
84
|
+
"test:parser": "node --enable-source-maps tests/parser",
|
|
85
|
+
"test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
|
|
86
|
+
"test:browser": "node --enable-source-maps tests/browser",
|
|
87
|
+
"test:asconfig": "cd tests/asconfig && npm run test",
|
|
88
|
+
"test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
|
|
89
|
+
"test:transform:esm": "node bin/asc tests/compiler/empty --transform ./tests/transform/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/simple.js --noEmit",
|
|
90
|
+
"test:transform:cjs": "node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/simple.js --noEmit",
|
|
91
|
+
"test:cli": "node tests/cli/options.js",
|
|
92
|
+
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
|
|
93
|
+
"asbuild:debug": "node bin/asc --config src/toilconfig.json --target debug",
|
|
94
|
+
"asbuild:release": "node bin/asc --config src/toilconfig.json --target release",
|
|
95
|
+
"asbuild:rtraced": "node bin/asc --config src/toilconfig.json --target rtraced",
|
|
96
|
+
"bootstrap": "npm run bootstrap:debug && npm run bootstrap:release",
|
|
97
|
+
"bootstrap:debug": "node bin/asc --config src/toilconfig.json --target debug && node bin/asc --config src/toilconfig.json --target debug-bootstrap --wasm ./build/toilscript.debug.js && node bin/asc --config src/toilconfig.json --target debug-bootstrap --wasm ./build/toilscript.debug-bootstrap.js && git --no-pager diff --no-index build/toilscript.debug.wast build/toilscript.debug-bootstrap.wast",
|
|
98
|
+
"bootstrap:release": "node bin/asc --config src/toilconfig.json --target release && node bin/asc --config src/toilconfig.json --target release-bootstrap --wasm ./build/toilscript.release.js && node bin/asc --config src/toilconfig.json --target release-bootstrap --wasm ./build/toilscript.release-bootstrap.js && git --no-pager diff --no-index build/toilscript.release.wast build/toilscript.release-bootstrap.wast",
|
|
99
|
+
"bootstrap:rtraced": "node bin/asc --config src/toilconfig.json --target rtraced && node bin/asc --config src/toilconfig.json --target rtraced --wasm ./build/toilscript.rtraced.js"
|
|
100
|
+
},
|
|
101
|
+
"files": [
|
|
102
|
+
"bin/",
|
|
103
|
+
"dist/",
|
|
104
|
+
"std/",
|
|
105
|
+
"util/",
|
|
106
|
+
"lib/binaryen.js",
|
|
107
|
+
"lib/binaryen.d.ts",
|
|
108
|
+
"tsconfig-base.json",
|
|
109
|
+
"NOTICE"
|
|
110
|
+
],
|
|
111
|
+
"funding": {
|
|
112
|
+
"type": "opencollective",
|
|
113
|
+
"url": "https://opencollective.com/assemblyscript"
|
|
114
|
+
}
|
|
115
|
+
}
|
package/std/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Standard library
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
Standard library components for use with `tsc` (portable) and `asc` (assembly).
|
|
5
|
-
|
|
6
|
-
Base configurations (.json) and definition files (.d.ts) are relevant to `tsc` only and not used by `asc`.
|
|
1
|
+
Standard library
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
Standard library components for use with `tsc` (portable) and `asc` (assembly).
|
|
5
|
+
|
|
6
|
+
Base configurations (.json) and definition files (.d.ts) are relevant to `tsc` only and not used by `asc`.
|