substrate-lang 0.9.4 → 0.10.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 (199) hide show
  1. package/README.md +1 -1
  2. package/build/compiler/{binary.cdd2ffb408dd@0+0.wasm → binary.2d43b43d1600@0+0.wasm} +0 -0
  3. package/build/compiler/checker.4dd4556dd421@0+0.wasm +0 -0
  4. package/build/compiler/{compile.da85f9bc4478@0+0.wasm → compile.5d8f6407af2a@0+0.wasm} +0 -0
  5. package/build/compiler/{core.0410ffbdc488@0+0.wasm → core.f2defb75e00b@0+0.wasm} +0 -0
  6. package/build/compiler/expander.967ce443d379@0+0.wasm +0 -0
  7. package/build/compiler/fs.01b8aab4a9a8@0+0.wasm +0 -0
  8. package/build/compiler/{leb128.ba77430f659f@0+0.wasm → leb128.15d814b7b4f2@0+0.wasm} +0 -0
  9. package/build/compiler/{link.be6e641afa93@0+0.wasm → link.b826ea7c8f17@0+0.wasm} +0 -0
  10. package/build/compiler/{macros.b695763c0ca3@0+0.wasm → macros.b269e0c42784@0+0.wasm} +0 -0
  11. package/build/compiler/{main.cbbdf42e34c2@0+0.wasm → main.4fc52f204d54@0+0.wasm} +0 -0
  12. package/build/compiler/{ops.324f0a665fab@0+0.wasm → ops.515b5e05f646@0+0.wasm} +0 -0
  13. package/build/compiler/{path.1b5fd988b6f3@0+0.wasm → path.5a6286472cd4@0+0.wasm} +0 -0
  14. package/build/compiler/program +21 -21
  15. package/build/compiler/{prune.29dde307bdee@0+0.wasm → prune.406215c3e4f8@0+0.wasm} +0 -0
  16. package/build/compiler/reader.694b03770bf0@0+0.wasm +0 -0
  17. package/build/compiler/roots.cefd10e93684@0+0.wasm +0 -0
  18. package/build/compiler/{running.b99787c2d180@0+0.wasm → running.0d25dbaec018@0+0.wasm} +0 -0
  19. package/build/compiler/serialize.b0d82f3d63d2@0+0.wasm +0 -0
  20. package/build/compiler/{sha256.f6c742932dde@0+0.wasm → sha256.a6c32b04d799@0+0.wasm} +0 -0
  21. package/build/compiler/substrate.5ee5d0b4d3e7@0+0.wasm +0 -0
  22. package/build/compiler/{syntax.fadc832db29f@0+0.wasm → syntax.32f3e40b61c7@0+0.wasm} +0 -0
  23. package/build/compiler/{writer.550227768eb9@0+0.wasm → writer.00b7802cbe39@0+0.wasm} +0 -0
  24. package/build/sub/{base64.454b045156d2@0+0.wasm → base64.a26bdcf60a2d@0+0.wasm} +0 -0
  25. package/build/sub/build.459c5b9412bd@0+0.wasm +0 -0
  26. package/build/sub/chromium.3d5818f2707d@0+0.wasm +0 -0
  27. package/build/sub/common.1edc613607a0@0+0.wasm +0 -0
  28. package/build/sub/deflate.23f7c4679260@0+0.wasm +0 -0
  29. package/build/sub/doc.0775df5de6fe@0+0.wasm +0 -0
  30. package/build/sub/{doc.f18ad14060e9@0+0.wasm → doc.ef9965d5d402@0+0.wasm} +0 -0
  31. package/build/sub/env.e5451da6e747@0+0.wasm +0 -0
  32. package/build/sub/events.bf5473ebf220@0+0.wasm +0 -0
  33. package/build/sub/fetch.7790d4943758@0+0.wasm +0 -0
  34. package/build/sub/fetch.96b2d10f025e@0+0.wasm +0 -0
  35. package/build/sub/files.ad0469fdf6fa@0+0.wasm +0 -0
  36. package/build/sub/fs.01b8aab4a9a8@0+0.wasm +0 -0
  37. package/build/sub/git.dc4c0e757ebe@0+0.wasm +0 -0
  38. package/build/sub/grants.c54776c0d7e3@0+0.wasm +0 -0
  39. package/build/sub/gzip.16e372eda1cf@0+0.wasm +0 -0
  40. package/build/sub/hash.660682e4f491@0+0.wasm +0 -0
  41. package/build/sub/{html.0b0362932a75@0+0.wasm → html.a23126eb949a@0+0.wasm} +0 -0
  42. package/build/sub/{html.3b3c8d7d9971@0+0.wasm → html.e9ed37f34977@0+0.wasm} +0 -0
  43. package/build/sub/{inflate.3cfa17586072@0+0.wasm → inflate.59bb61f14001@0+0.wasm} +0 -0
  44. package/build/sub/json.55590d2f518a@0+0.wasm +0 -0
  45. package/build/sub/manifest.ef317480deb0@0+0.wasm +0 -0
  46. package/build/sub/{map.e582eae03ec2@0+0.wasm → map.f455cca6a42a@0+0.wasm} +0 -0
  47. package/build/sub/pack.e02836264f6a@0+0.wasm +0 -0
  48. package/build/sub/{path.1b5fd988b6f3@0+0.wasm → path.5a6286472cd4@0+0.wasm} +0 -0
  49. package/build/sub/path.6891ffea73ca@0+0.wasm +0 -0
  50. package/build/sub/process.7106571fa723@0+0.wasm +0 -0
  51. package/build/sub/program +48 -48
  52. package/build/sub/read.0b93933d62a2@0+0.wasm +0 -0
  53. package/build/sub/{reader.d256e69e09e2@0+0.wasm → reader.694b03770bf0@0+0.wasm} +0 -0
  54. package/build/sub/{root.02141d04d568@0+0.wasm → root.f10a4906f460@0+0.wasm} +0 -0
  55. package/build/sub/{roots.e366210c01d6@0+0.wasm → roots.cefd10e93684@0+0.wasm} +0 -0
  56. package/build/sub/{sha256.f6c742932dde@0+0.wasm → sha256.a6c32b04d799@0+0.wasm} +0 -0
  57. package/build/sub/{sha512.9fee24e95460@0+0.wasm → sha512.c24a792d7891@0+0.wasm} +0 -0
  58. package/build/sub/site.1732b58ec0e8@0+0.wasm +0 -0
  59. package/build/sub/site.ae3913b0b0f4@0+0.wasm +0 -0
  60. package/build/sub/store.a24d7a25daa6@0+0.wasm +0 -0
  61. package/build/sub/stream.126e3bd5d626@0+0.wasm +0 -0
  62. package/build/sub/sub.2e3092140706@0+0.wasm +0 -0
  63. package/build/sub/substrate.5ee5d0b4d3e7@0+0.wasm +0 -0
  64. package/build/sub/{syntax.fadc832db29f@0+0.wasm → syntax.32f3e40b61c7@0+0.wasm} +0 -0
  65. package/build/sub/tar.2a633861e654@0+0.wasm +0 -0
  66. package/build/sub/test.9bd59c73f65e@0+0.wasm +0 -0
  67. package/build/sub/{text.8ff142d72fd7@0+0.wasm → text.1bc90482bd43@0+0.wasm} +0 -0
  68. package/build/sub/{timer.d3454726b3bf@0+0.wasm → timer.f35eb62ae446@0+0.wasm} +0 -0
  69. package/build/sub/upgrade.39ee449b00d5@0+0.wasm +0 -0
  70. package/build/sub/{utf8.e82afeb9e953@0+0.wasm → utf8.e7216bd054e1@0+0.wasm} +0 -0
  71. package/build/sub/worker.762a9d642af0@0+0.wasm +0 -0
  72. package/build/sub/writer.00b7802cbe39@0+0.wasm +0 -0
  73. package/package.json +1 -1
  74. package/std/archive/tar.sub +30 -23
  75. package/std/browser/chromium.sub +5 -4
  76. package/std/browser/devtools.sub +24 -19
  77. package/std/compress/gzip.sub +18 -16
  78. package/std/compress/inflate.sub +7 -4
  79. package/std/crypto/password.sub +3 -3
  80. package/std/doc/doc.sub +2 -2
  81. package/std/encoding/json.sub +20 -8
  82. package/std/encoding/wire.sub +9 -7
  83. package/std/http/form.sub +2 -2
  84. package/std/http/multipart.sub +8 -10
  85. package/std/http/route.sub +9 -4
  86. package/std/http/server.sub +14 -11
  87. package/std/http/session.sub +2 -2
  88. package/std/http/static.sub +5 -5
  89. package/std/meta/derive.sub +0 -2
  90. package/std/meta/method.sub +41 -0
  91. package/std/meta/type-info.sub +30 -37
  92. package/std/package/files.sub +24 -25
  93. package/std/package/git.sub +26 -33
  94. package/std/package/hash.sub +8 -8
  95. package/std/package/manifest.sub +67 -42
  96. package/std/package/map.sub +1 -1
  97. package/std/package/pack.sub +13 -13
  98. package/std/package/read.sub +7 -6
  99. package/std/package/site.sub +7 -7
  100. package/std/package/store.sub +16 -12
  101. package/std/package.sub +7 -6
  102. package/std/test/browser.sub +9 -8
  103. package/std/test/build.sub +2 -2
  104. package/std/test/page.sub +31 -26
  105. package/std/test/run.sub +8 -7
  106. package/std/test/test.sub +12 -13
  107. package/std/vector/vector.sub +75 -0
  108. package/std/web/canvas.sub +3 -3
  109. package/std/web/dom.sub +45 -11
  110. package/std/web/gpu-commands.sub +439 -0
  111. package/std/web/gpu.sub +17 -424
  112. package/std/web/patches.sub +45 -10
  113. package/substrate/VERSION +1 -1
  114. package/substrate/compiler/checker.sub +40 -212
  115. package/substrate/compiler/compile.sub +3 -3
  116. package/substrate/compiler/expander.sub +32 -50
  117. package/substrate/compiler/main.sub +9 -9
  118. package/substrate/compiler/reader.sub +4 -4
  119. package/substrate/compiler/roots.sub +8 -8
  120. package/substrate/compiler/running.sub +1 -1
  121. package/substrate/compiler/serialize.sub +56 -49
  122. package/substrate/compiler/substrate.sub +53 -11
  123. package/substrate/host/errors.mjs +3 -2
  124. package/substrate/host/events.sub +3 -16
  125. package/substrate/host/fs.mjs +5 -4
  126. package/substrate/host/fs.sub +135 -102
  127. package/substrate/host/grants.mjs +1 -1
  128. package/substrate/host/grants.sub +8 -7
  129. package/substrate/host/modules/fake.mjs +1 -1
  130. package/substrate/host/modules/websocket.mjs +4 -4
  131. package/substrate/host/modules/websocket.sub +8 -6
  132. package/substrate/host/node/env.mjs +12 -6
  133. package/substrate/host/node/env.sub +21 -16
  134. package/substrate/host/node/fs.mjs +1 -1
  135. package/substrate/host/node/net.mjs +2 -2
  136. package/substrate/host/node/net.sub +13 -6
  137. package/substrate/host/node/process.mjs +4 -4
  138. package/substrate/host/node/process.sub +25 -24
  139. package/substrate/host/node/signal.mjs +3 -2
  140. package/substrate/host/node/signal.sub +9 -6
  141. package/substrate/host/node/watch.mjs +1 -1
  142. package/substrate/host/node/watch.sub +11 -9
  143. package/substrate/host/stream.sub +2 -0
  144. package/substrate/host/subhost-core.mjs +9 -1
  145. package/substrate/host/web/audio.mjs +17 -9
  146. package/substrate/host/web/audio.sub +9 -3
  147. package/substrate/host/web/clipboard.mjs +2 -2
  148. package/substrate/host/web/clipboard.sub +10 -3
  149. package/substrate/host/web/dom.mjs +165 -64
  150. package/substrate/host/web/dom.sub +9 -27
  151. package/substrate/host/web/files.mjs +2 -2
  152. package/substrate/host/web/files.sub +6 -2
  153. package/substrate/host/web/fs.mjs +3 -3
  154. package/substrate/host/web/gpu.mjs +63 -25
  155. package/substrate/host/web/gpu.sub +18 -4
  156. package/substrate/host/web/location.mjs +18 -2
  157. package/substrate/host/web/location.sub +19 -7
  158. package/substrate/host/worker-side.mjs +3 -1
  159. package/substrate/host/worker.mjs +6 -5
  160. package/substrate/host/worker.sub +10 -10
  161. package/build/compiler/checker.2b0ea87ed311@0+0.wasm +0 -0
  162. package/build/compiler/expander.80707e1666d6@0+0.wasm +0 -0
  163. package/build/compiler/fs.5017b627cbd2@0+0.wasm +0 -0
  164. package/build/compiler/reader.d256e69e09e2@0+0.wasm +0 -0
  165. package/build/compiler/roots.e366210c01d6@0+0.wasm +0 -0
  166. package/build/compiler/serialize.a12536bbbe9a@0+0.wasm +0 -0
  167. package/build/compiler/substrate.728c690187f2@0+0.wasm +0 -0
  168. package/build/sub/build.115aeefc15e8@0+0.wasm +0 -0
  169. package/build/sub/chromium.fc0bfea0fbe6@0+0.wasm +0 -0
  170. package/build/sub/common.997c21b0b8cf@0+0.wasm +0 -0
  171. package/build/sub/deflate.3138a38325a1@0+0.wasm +0 -0
  172. package/build/sub/doc.e3f9a998cd91@0+0.wasm +0 -0
  173. package/build/sub/env.861d55fff974@0+0.wasm +0 -0
  174. package/build/sub/events.2c981f6f1ec7@0+0.wasm +0 -0
  175. package/build/sub/fetch.b0ce8f8b3da8@0+0.wasm +0 -0
  176. package/build/sub/fetch.d62aa5fc9623@0+0.wasm +0 -0
  177. package/build/sub/files.1706cc0941c0@0+0.wasm +0 -0
  178. package/build/sub/fs.5017b627cbd2@0+0.wasm +0 -0
  179. package/build/sub/git.1c5791236e35@0+0.wasm +0 -0
  180. package/build/sub/grants.cd99dff2854e@0+0.wasm +0 -0
  181. package/build/sub/gzip.9ebea150f218@0+0.wasm +0 -0
  182. package/build/sub/hash.ba8330dad9ff@0+0.wasm +0 -0
  183. package/build/sub/json.af2e0ae20084@0+0.wasm +0 -0
  184. package/build/sub/manifest.6e014ac19e5d@0+0.wasm +0 -0
  185. package/build/sub/pack.4295e4f5bdbd@0+0.wasm +0 -0
  186. package/build/sub/path.de22f6659534@0+0.wasm +0 -0
  187. package/build/sub/process.ca10ac0b8a62@0+0.wasm +0 -0
  188. package/build/sub/read.279fafcda508@0+0.wasm +0 -0
  189. package/build/sub/site.76aa8286c257@0+0.wasm +0 -0
  190. package/build/sub/site.e6e415bc3170@0+0.wasm +0 -0
  191. package/build/sub/store.c48db3345968@0+0.wasm +0 -0
  192. package/build/sub/stream.27fd2fe858e1@0+0.wasm +0 -0
  193. package/build/sub/sub.c0fb7310de12@0+0.wasm +0 -0
  194. package/build/sub/substrate.728c690187f2@0+0.wasm +0 -0
  195. package/build/sub/tar.692c0e8827cd@0+0.wasm +0 -0
  196. package/build/sub/test.1fd2ff8123bf@0+0.wasm +0 -0
  197. package/build/sub/upgrade.2a9219e6a45d@0+0.wasm +0 -0
  198. package/build/sub/worker.ea1e11f8f5e2@0+0.wasm +0 -0
  199. package/build/sub/writer.550227768eb9@0+0.wasm +0 -0
@@ -1,4 +1,6 @@
1
1
  // The host module "location" (location.sub).
2
+ import { errorOf } from '../errors.mjs';
3
+
2
4
  const utf8 = new TextEncoder();
3
5
 
4
6
  const SOURCE = 12;
@@ -6,14 +8,19 @@ const CHANGED = 1;
6
8
 
7
9
  export function locationModule() {
8
10
  return (caller) => {
9
- const popped = () => caller.event(CHANGED, 0, 0, 0, utf8.encode(globalThis.location.href));
11
+ const listeners = new Map();
12
+ let next = 1;
13
+ const popped = () => {
14
+ const url = utf8.encode(globalThis.location.href);
15
+ for (const [id, tag] of listeners) caller.event(CHANGED, id, tag, 0, url);
16
+ };
10
17
  addEventListener('popstate', popped);
11
18
  const move = (go, ptr, len, err) => {
12
19
  try {
13
20
  go(caller.string(ptr, len));
14
21
  return 0;
15
22
  } catch (e) {
16
- caller.fail(err, e.message);
23
+ caller.fail(err, e.message, errorOf(e));
17
24
  return -1;
18
25
  }
19
26
  };
@@ -28,6 +35,15 @@ export function locationModule() {
28
35
  back() {
29
36
  history.back();
30
37
  },
38
+ listen(tag) {
39
+ const id = next++;
40
+ listeners.set(id, tag);
41
+ return id;
42
+ },
43
+ unlisten(id) {
44
+ listeners.delete(id);
45
+ caller.forget(id);
46
+ },
31
47
  };
32
48
  };
33
49
  }
@@ -1,21 +1,33 @@
1
- ;; The page's URL and history: the host module "location". When the user goes back or forward, an untagged changed
2
- ;; event brings the URL as its bytes.
3
- (provide location-source location-changed location-get location-push location-replace location-back)
1
+ ;; The page's URL and history: the host module "location". When the user goes back or forward, each listener's tag
2
+ ;; gets a changed event with the URL as its bytes. location-listen gives the listener's number, and location-unlisten
3
+ ;; takes it.
4
+ (provide location-source location-changed location-get location-push location-replace location-back location-listen
5
+ location-unlisten)
4
6
 
5
7
  (import get "location" "get" (i32 -> i32))
6
8
  (import push "location" "push" (i32 i32 i32 -> i32))
7
9
  (import replace "location" "replace" (i32 i32 i32 -> i32))
8
10
  (import back "location" "back" (->))
11
+ (import listen "location" "listen" (i32 -> i32))
12
+ (import unlisten "location" "unlisten" (i32 ->))
9
13
 
10
14
  (const location-source u32 12)
11
15
  (const location-changed u32 1)
12
16
 
13
17
  (define (location-get) -> string (let* ([n u32 0] [p (get (cast i32 (& n)))]) (cast string (slice (cast (ptr u8) p) n))))
14
18
 
15
- (define (location-push [url string] [err (ptr string)]) -> i32
16
- (push (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 err)))
19
+ (define (location-push [url string] [err (ptr error)]) -> bool
20
+ (let ([why string])
21
+ (or (== (push (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 (& why))) 0)
22
+ (host-failed! (& why) err))))
17
23
 
18
- (define (location-replace [url string] [err (ptr string)]) -> i32
19
- (replace (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 err)))
24
+ (define (location-replace [url string] [err (ptr error)]) -> bool
25
+ (let ([why string])
26
+ (or (== (replace (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 (& why))) 0)
27
+ (host-failed! (& why) err))))
20
28
 
21
29
  (define (location-back) (back))
30
+
31
+ (define (location-listen [tag (ptr void)]) -> u32 (cast u32 (listen (cast i32 tag))))
32
+
33
+ (define (location-unlisten [id u32]) (unlisten (cast i32 id)))
@@ -1,5 +1,7 @@
1
1
  // The worker module's side inside a worker, in a browser or on Node. It batches output, delivers the parent's
2
2
  // messages as events, and reports back.
3
+ import { errors } from './errors.mjs';
4
+
3
5
  const utf8 = new TextEncoder();
4
6
 
5
7
  const SOURCE = 3;
@@ -72,7 +74,7 @@ export function workerSide(post) {
72
74
  const worker = (caller) => ({
73
75
  source: SOURCE,
74
76
  start(f, bp, bl, time, size, heard, tag, gp, gl, err) {
75
- caller.fail(err, 'worker.start: a worker cannot start workers');
77
+ caller.fail(err, 'worker.start: a worker cannot start workers', errors.invalid);
76
78
  return 0;
77
79
  },
78
80
  send(w, ptr, length) {
@@ -1,6 +1,7 @@
1
1
  // The host module "worker" (worker.sub). The browser and Node each give spawn, their way of starting a thread.
2
2
  import { entries } from './entries.mjs';
3
- import { askedOf, mayTree, within } from './grants.mjs';
3
+ import { errors, errorOf } from './errors.mjs';
4
+ import { askedOf, mayTree, notGranted, within } from './grants.mjs';
4
5
 
5
6
  const utf8 = new TextEncoder();
6
7
 
@@ -69,7 +70,7 @@ export function workerModule({ spawn }) {
69
70
  thread = spawn({ modules, compiled, entry, argument, grants, names: caller.moduleNames(), pages, heard, ...setup },
70
71
  app);
71
72
  } catch (e) {
72
- caller.fail(err, e.message);
73
+ caller.fail(err, e.message, errorOf(e));
73
74
  return 0;
74
75
  }
75
76
  const w = nextNumber++;
@@ -100,7 +101,7 @@ export function workerModule({ spawn }) {
100
101
  start(f, bp, bl, time, size, heard, tag, gp, gl, err, ends, ap, al) {
101
102
  const entry = caller.named(f >>> 0);
102
103
  if (!entry) {
103
- caller.fail(err, 'worker.start: a function of code the program loaded');
104
+ caller.fail(err, 'worker.start: a function of code the program loaded', errors.invalid);
104
105
  return 0;
105
106
  }
106
107
  const pages = Math.ceil((size >>> 0) / 65536);
@@ -113,11 +114,11 @@ export function workerModule({ spawn }) {
113
114
  const parent = caller.grants();
114
115
  const files = caller.parseGrants(read.flatMap((file) => ['read', file])).grants.read.items;
115
116
  for (const file of files) {
116
- if (!mayTree(parent.read, file)) throw new Error(`read ${file} reaches beyond the parent's grants`);
117
+ if (!mayTree(parent.read, file)) throw notGranted(`read ${file} reaches beyond the parent's grants`);
117
118
  }
118
119
  grants = within(askedOf(request, parent), parent);
119
120
  } catch (e) {
120
- caller.fail(err, `worker.start: ${e.message}`);
121
+ caller.fail(err, `worker.start: ${e.message}`, errorOf(e));
121
122
  return 0;
122
123
  }
123
124
  const args = al > 0 ? entries(string(ap, al)) : null;
@@ -1,6 +1,5 @@
1
1
  ;; Workers: functions of this program, each running on its own thread and sharing only messages. worker-start runs one
2
- ;; of the program's own functions with the bytes as its argument 0, and returns the worker's number, or 0 with the
3
- ;; reason at err. Its options:
2
+ ;; of the program's own functions with the bytes as its argument 0. Its options:
4
3
  ;; time, memory limits in ms for each stretch of work and in bytes, or 0 for none
5
4
  ;; output the worker's stdout and stderr come as events
6
5
  ;; grants the worker's grants (grants.sub), within the parent's and by default the parent's own
@@ -41,22 +40,23 @@
41
40
  (set! (-> o grants) (make-grants))
42
41
  (grants-inherit! (& (-> o grants))))
43
42
 
44
- (define (worker-start [function (fn ())] [argument (slice u8)] [o (ptr worker-options)] [tag (ptr void)]
45
- [err (ptr string)]) -> u32
46
- (let ([defaults worker-options] [p o] [entries (make-buffer)] [args (make-buffer)] [id u32 0])
43
+ (define (worker-start [function (fn ())] [argument (slice u8)] [o (ptr worker-options)] [tag (ptr void)] [id (ptr u32)]
44
+ [err (ptr error)]) -> bool
45
+ (let ([defaults worker-options] [p o] [entries (make-buffer)] [args (make-buffer)] [why string] [n u32 0])
47
46
  (when (== p 0)
48
47
  (worker-options-init! (& defaults))
49
48
  (set! p (& defaults)))
50
49
  (grants-entries! (& entries) (& (-> p grants)))
51
50
  (buffer-add-entries! (& args) (-> p args))
52
- (set! id (cast u32 (start (cast i32 function) (cast i32 (-> argument items)) (cast i32 (-> argument length))
53
- (cast i32 (-> p time)) (cast i32 (-> p memory)) (-> p output) (cast i32 tag)
54
- (cast i32 (-> entries bytes)) (cast i32 (-> entries length)) (cast i32 err) (-> p ends)
55
- (cast i32 (-> args bytes)) (cast i32 (-> args length)))))
51
+ (set! n (cast u32 (start (cast i32 function) (cast i32 (-> argument items)) (cast i32 (-> argument length))
52
+ (cast i32 (-> p time)) (cast i32 (-> p memory)) (-> p output) (cast i32 tag)
53
+ (cast i32 (-> entries bytes)) (cast i32 (-> entries length)) (cast i32 (& why))
54
+ (-> p ends) (cast i32 (-> args bytes)) (cast i32 (-> args length)))))
56
55
  (buffer-free! (& entries))
57
56
  (buffer-free! (& args))
58
57
  (when (== o 0) (buffer-free! (& (-> defaults grants list))))
59
- id))
58
+ (unless (== id 0) (set! (@ id) n))
59
+ (or (!= n 0) (host-failed! (& why) err))))
60
60
 
61
61
  (define (worker-send [w u32] [b (slice u8)]) -> i32 (send (cast i32 w) (cast i32 (-> b items)) (cast i32 (-> b length))))
62
62
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file