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.
Files changed (121) hide show
  1. package/LICENSE +201 -201
  2. package/NOTICE +94 -94
  3. package/README.md +101 -114
  4. package/bin/asc.js +0 -0
  5. package/bin/asinit.js +6 -6
  6. package/dist/asc.generated.d.ts +10027 -0
  7. package/dist/asc.js +24474 -0
  8. package/dist/asc.js.map +7 -0
  9. package/dist/importmap.json +9 -0
  10. package/dist/toilscript.generated.d.ts +11242 -0
  11. package/dist/toilscript.js +337 -0
  12. package/dist/toilscript.js.map +7 -0
  13. package/dist/web.js +22 -0
  14. package/lib/binaryen.d.ts +2 -2
  15. package/lib/binaryen.js +2 -2
  16. package/package.json +115 -114
  17. package/std/README.md +6 -6
  18. package/std/assembly/array.ts +550 -550
  19. package/std/assembly/arraybuffer.ts +77 -77
  20. package/std/assembly/atomics.ts +127 -127
  21. package/std/assembly/bindings/asyncify.ts +16 -16
  22. package/std/assembly/bindings/dom.ts +291 -291
  23. package/std/assembly/bindings/node.ts +6 -6
  24. package/std/assembly/bitflags.ts +53 -53
  25. package/std/assembly/builtins.ts +2650 -2650
  26. package/std/assembly/byteslice.ts +177 -177
  27. package/std/assembly/compat.ts +2 -2
  28. package/std/assembly/console.ts +42 -42
  29. package/std/assembly/crypto.ts +9 -9
  30. package/std/assembly/dataview.ts +181 -181
  31. package/std/assembly/date.ts +375 -375
  32. package/std/assembly/diagnostics.ts +11 -11
  33. package/std/assembly/encoding.ts +151 -151
  34. package/std/assembly/endian.ts +45 -45
  35. package/std/assembly/error.ts +44 -44
  36. package/std/assembly/fixedarray.ts +173 -173
  37. package/std/assembly/fixedmap.ts +326 -326
  38. package/std/assembly/fixedset.ts +275 -275
  39. package/std/assembly/function.ts +42 -42
  40. package/std/assembly/index.d.ts +2892 -2891
  41. package/std/assembly/iterator.ts +35 -35
  42. package/std/assembly/map.ts +269 -269
  43. package/std/assembly/math.ts +3289 -3289
  44. package/std/assembly/memory.ts +123 -123
  45. package/std/assembly/number.ts +388 -388
  46. package/std/assembly/object.ts +36 -36
  47. package/std/assembly/performance.ts +9 -9
  48. package/std/assembly/pointer.ts +80 -80
  49. package/std/assembly/polyfills.ts +27 -27
  50. package/std/assembly/process.ts +50 -50
  51. package/std/assembly/reference.ts +48 -48
  52. package/std/assembly/regexp.ts +12 -12
  53. package/std/assembly/rt/README.md +83 -83
  54. package/std/assembly/rt/common.ts +81 -81
  55. package/std/assembly/rt/index-incremental.ts +2 -2
  56. package/std/assembly/rt/index-memory.ts +1 -1
  57. package/std/assembly/rt/index-minimal.ts +2 -2
  58. package/std/assembly/rt/index-stub.ts +1 -1
  59. package/std/assembly/rt/index.d.ts +37 -37
  60. package/std/assembly/rt/itcms.ts +419 -419
  61. package/std/assembly/rt/memory-runtime.ts +94 -94
  62. package/std/assembly/rt/rtrace.ts +15 -15
  63. package/std/assembly/rt/stub.ts +133 -133
  64. package/std/assembly/rt/tcms.ts +254 -254
  65. package/std/assembly/rt/tlsf.ts +592 -592
  66. package/std/assembly/rt.ts +90 -90
  67. package/std/assembly/set.ts +225 -225
  68. package/std/assembly/shared/feature.ts +68 -68
  69. package/std/assembly/shared/runtime.ts +13 -13
  70. package/std/assembly/shared/target.ts +11 -11
  71. package/std/assembly/shared/tsconfig.json +11 -11
  72. package/std/assembly/shared/typeinfo.ts +72 -72
  73. package/std/assembly/staticarray.ts +423 -423
  74. package/std/assembly/string.ts +850 -850
  75. package/std/assembly/symbol.ts +114 -114
  76. package/std/assembly/table.ts +16 -16
  77. package/std/assembly/toilscript.ts +16 -0
  78. package/std/assembly/tsconfig.json +6 -6
  79. package/std/assembly/typedarray.ts +1954 -1954
  80. package/std/assembly/uri.ts +17 -17
  81. package/std/assembly/util/bytes.ts +107 -107
  82. package/std/assembly/util/casemap.ts +497 -497
  83. package/std/assembly/util/error.ts +58 -58
  84. package/std/assembly/util/hash.ts +117 -117
  85. package/std/assembly/util/math.ts +1922 -1922
  86. package/std/assembly/util/memory.ts +290 -290
  87. package/std/assembly/util/number.ts +873 -873
  88. package/std/assembly/util/sort.ts +313 -313
  89. package/std/assembly/util/string.ts +1202 -1202
  90. package/std/assembly/util/uri.ts +275 -275
  91. package/std/assembly/vector.ts +4 -4
  92. package/std/assembly.json +16 -16
  93. package/std/portable/index.d.ts +461 -461
  94. package/std/portable/index.js +416 -416
  95. package/std/portable.json +11 -11
  96. package/std/types/assembly/index.d.ts +1 -1
  97. package/std/types/assembly/package.json +2 -2
  98. package/std/types/portable/index.d.ts +1 -1
  99. package/std/types/portable/package.json +2 -2
  100. package/tsconfig-base.json +13 -13
  101. package/util/README.md +23 -23
  102. package/util/browser/fs.js +1 -1
  103. package/util/browser/module.js +5 -5
  104. package/util/browser/path.js +520 -520
  105. package/util/browser/process.js +59 -59
  106. package/util/browser/url.js +23 -23
  107. package/util/cpu.d.ts +9 -9
  108. package/util/cpu.js +42 -42
  109. package/util/find.d.ts +6 -6
  110. package/util/find.js +20 -20
  111. package/util/node.d.ts +21 -21
  112. package/util/node.js +34 -34
  113. package/util/options.d.ts +70 -70
  114. package/util/options.js +262 -262
  115. package/util/terminal.d.ts +52 -52
  116. package/util/terminal.js +35 -35
  117. package/util/text.d.ts +26 -26
  118. package/util/text.js +114 -114
  119. package/util/tsconfig.json +9 -9
  120. package/util/web.d.ts +11 -11
  121. 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.0.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
- "asc": "./bin/asc.js",
72
- "asinit": "./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
- "watch": "node scripts/build --watch",
81
- "coverage": "npx c8 -- npm test",
82
- "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",
83
- "test:parser": "node --enable-source-maps tests/parser",
84
- "test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
85
- "test:browser": "node --enable-source-maps tests/browser",
86
- "test:asconfig": "cd tests/asconfig && npm run test",
87
- "test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
88
- "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",
89
- "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",
90
- "test:cli": "node tests/cli/options.js",
91
- "asbuild": "npm run asbuild:debug && npm run asbuild:release",
92
- "asbuild:debug": "node bin/asc --config src/toilconfig.json --target debug",
93
- "asbuild:release": "node bin/asc --config src/toilconfig.json --target release",
94
- "asbuild:rtraced": "node bin/asc --config src/toilconfig.json --target rtraced",
95
- "bootstrap": "npm run bootstrap:debug && npm run bootstrap:release",
96
- "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",
97
- "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",
98
- "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"
99
- },
100
- "files": [
101
- "bin/",
102
- "dist/",
103
- "std/",
104
- "util/",
105
- "lib/binaryen.js",
106
- "lib/binaryen.d.ts",
107
- "tsconfig-base.json",
108
- "NOTICE"
109
- ],
110
- "funding": {
111
- "type": "opencollective",
112
- "url": "https://opencollective.com/assemblyscript"
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`.