@shd101wyy/yo 0.1.28 → 0.1.30

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 (183) hide show
  1. package/.github/skills/yo-async-effects/SKILL.md +15 -15
  2. package/.github/skills/yo-async-effects/async-effects-recipes.md +118 -121
  3. package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +33 -13
  4. package/.github/skills/yo-project-workflow/workflow-cheatsheet.md +1 -1
  5. package/.github/skills/yo-syntax/SKILL.md +2 -2
  6. package/.github/skills/yo-syntax/syntax-cheatsheet.md +108 -96
  7. package/README.md +6 -3
  8. package/out/cjs/index.cjs +812 -706
  9. package/out/cjs/yo-cli.cjs +1023 -907
  10. package/out/cjs/yo-lsp.cjs +836 -730
  11. package/out/esm/index.mjs +757 -651
  12. package/out/types/src/codegen/exprs/async.d.ts +2 -0
  13. package/out/types/src/codegen/exprs/await.d.ts +1 -0
  14. package/out/types/src/codegen/exprs/closures.d.ts +4 -0
  15. package/out/types/src/codegen/functions/context.d.ts +6 -0
  16. package/out/types/src/codegen/functions/declarations.d.ts +1 -1
  17. package/out/types/src/doc/model.d.ts +0 -1
  18. package/out/types/src/env.d.ts +2 -2
  19. package/out/types/src/evaluator/builtins/pragma.d.ts +9 -0
  20. package/out/types/src/evaluator/builtins/unsafe.d.ts +8 -0
  21. package/out/types/src/evaluator/context.d.ts +3 -1
  22. package/out/types/src/evaluator/exprs/{escape.d.ts → unwind.d.ts} +1 -1
  23. package/out/types/src/evaluator/index.d.ts +1 -1
  24. package/out/types/src/evaluator/memory-safety.d.ts +14 -0
  25. package/out/types/src/evaluator/types/flowability.d.ts +6 -0
  26. package/out/types/src/evaluator/types/function.d.ts +1 -2
  27. package/out/types/src/evaluator/utils.d.ts +0 -1
  28. package/out/types/src/expr-traversal.d.ts +1 -0
  29. package/out/types/src/expr.d.ts +9 -7
  30. package/out/types/src/public-safe-report.d.ts +19 -0
  31. package/out/types/src/tests/comptime-ref-gate.test.d.ts +1 -0
  32. package/out/types/src/tests/pragma-validation.test.d.ts +1 -0
  33. package/out/types/src/tests/public-safe-report.test.d.ts +1 -0
  34. package/out/types/src/tests/type-representation-pointer.test.d.ts +1 -0
  35. package/out/types/src/tests/unsafe-gate.test.d.ts +1 -0
  36. package/out/types/src/tests/unsafe-report-classify.test.d.ts +1 -0
  37. package/out/types/src/types/creators.d.ts +4 -6
  38. package/out/types/src/types/definitions.d.ts +9 -16
  39. package/out/types/src/types/guards.d.ts +1 -2
  40. package/out/types/src/types/tags.d.ts +0 -1
  41. package/out/types/src/types/utils.d.ts +5 -0
  42. package/out/types/src/unsafe-report.d.ts +29 -0
  43. package/out/types/src/value.d.ts +1 -0
  44. package/out/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +1 -1
  46. package/scripts/add-pragma-for-pointer-decls.ts +134 -0
  47. package/scripts/add-pragma.ts +58 -0
  48. package/scripts/migrate-amp-method-calls.ts +186 -0
  49. package/scripts/migrate-clone-calls.ts +93 -0
  50. package/scripts/migrate-get-unwrap.ts +166 -0
  51. package/scripts/migrate-index-patterns.ts +210 -0
  52. package/scripts/migrate-index-trait.ts +142 -0
  53. package/scripts/migrate-iterator.ts +150 -0
  54. package/scripts/migrate-self-ptr.ts +220 -0
  55. package/scripts/migrate-skip-pragmas.ts +109 -0
  56. package/scripts/migrate-tostring.ts +134 -0
  57. package/scripts/trim-pragma.ts +130 -0
  58. package/scripts/wrap-extern-calls.ts +161 -0
  59. package/std/alg/hash.yo +3 -2
  60. package/std/allocator.yo +6 -5
  61. package/std/async.yo +2 -2
  62. package/std/collections/array_list.yo +59 -40
  63. package/std/collections/btree_map.yo +19 -18
  64. package/std/collections/deque.yo +9 -8
  65. package/std/collections/hash_map.yo +101 -13
  66. package/std/collections/hash_set.yo +5 -4
  67. package/std/collections/linked_list.yo +39 -4
  68. package/std/collections/ordered_map.yo +3 -3
  69. package/std/collections/priority_queue.yo +14 -13
  70. package/std/crypto/md5.yo +2 -1
  71. package/std/crypto/random.yo +21 -20
  72. package/std/crypto/sha256.yo +2 -1
  73. package/std/encoding/base64.yo +18 -18
  74. package/std/encoding/hex.yo +5 -5
  75. package/std/encoding/json.yo +62 -13
  76. package/std/encoding/punycode.yo +24 -23
  77. package/std/encoding/toml.yo +4 -3
  78. package/std/encoding/utf16.yo +3 -3
  79. package/std/env.yo +43 -28
  80. package/std/error.yo +15 -3
  81. package/std/fmt/display.yo +2 -2
  82. package/std/fmt/index.yo +6 -5
  83. package/std/fmt/to_string.yo +39 -38
  84. package/std/fmt/writer.yo +9 -8
  85. package/std/fs/dir.yo +61 -66
  86. package/std/fs/file.yo +121 -126
  87. package/std/fs/metadata.yo +13 -18
  88. package/std/fs/temp.yo +35 -30
  89. package/std/fs/walker.yo +14 -19
  90. package/std/gc.yo +1 -0
  91. package/std/glob.yo +7 -7
  92. package/std/http/client.yo +33 -36
  93. package/std/http/http.yo +6 -6
  94. package/std/http/index.yo +4 -4
  95. package/std/imm/list.yo +33 -0
  96. package/std/imm/map.yo +2 -1
  97. package/std/imm/set.yo +1 -0
  98. package/std/imm/sorted_map.yo +1 -0
  99. package/std/imm/sorted_set.yo +1 -0
  100. package/std/imm/string.yo +27 -23
  101. package/std/imm/vec.yo +18 -2
  102. package/std/io/reader.yo +2 -1
  103. package/std/io/writer.yo +3 -2
  104. package/std/libc/assert.yo +1 -0
  105. package/std/libc/ctype.yo +1 -0
  106. package/std/libc/dirent.yo +1 -0
  107. package/std/libc/errno.yo +1 -0
  108. package/std/libc/fcntl.yo +1 -0
  109. package/std/libc/float.yo +1 -0
  110. package/std/libc/limits.yo +1 -0
  111. package/std/libc/math.yo +1 -0
  112. package/std/libc/signal.yo +1 -0
  113. package/std/libc/stdatomic.yo +1 -0
  114. package/std/libc/stdint.yo +1 -0
  115. package/std/libc/stdio.yo +1 -0
  116. package/std/libc/stdlib.yo +1 -0
  117. package/std/libc/string.yo +1 -0
  118. package/std/libc/sys/stat.yo +1 -0
  119. package/std/libc/time.yo +1 -0
  120. package/std/libc/unistd.yo +1 -0
  121. package/std/libc/wctype.yo +1 -0
  122. package/std/libc/windows.yo +2 -0
  123. package/std/log.yo +7 -6
  124. package/std/net/addr.yo +6 -5
  125. package/std/net/dns.yo +13 -16
  126. package/std/net/errors.yo +9 -9
  127. package/std/net/tcp.yo +71 -74
  128. package/std/net/udp.yo +40 -43
  129. package/std/os/signal.yo +5 -5
  130. package/std/path.yo +1 -0
  131. package/std/prelude.yo +377 -200
  132. package/std/process/command.yo +57 -46
  133. package/std/process/index.yo +2 -1
  134. package/std/regex/compiler.yo +10 -9
  135. package/std/regex/index.yo +41 -41
  136. package/std/regex/match.yo +2 -2
  137. package/std/regex/parser.yo +31 -31
  138. package/std/regex/vm.yo +42 -41
  139. package/std/string/string.yo +95 -40
  140. package/std/string/string_builder.yo +9 -9
  141. package/std/string/unicode.yo +50 -49
  142. package/std/sync/channel.yo +2 -1
  143. package/std/sync/cond.yo +5 -4
  144. package/std/sync/mutex.yo +4 -3
  145. package/std/sys/advise.yo +1 -0
  146. package/std/sys/bufio/buf_reader.yo +27 -26
  147. package/std/sys/bufio/buf_writer.yo +22 -21
  148. package/std/sys/clock.yo +1 -0
  149. package/std/sys/copy.yo +1 -0
  150. package/std/sys/dir.yo +10 -9
  151. package/std/sys/dns.yo +6 -5
  152. package/std/sys/errors.yo +12 -12
  153. package/std/sys/events.yo +1 -0
  154. package/std/sys/externs.yo +38 -37
  155. package/std/sys/file.yo +17 -16
  156. package/std/sys/future.yo +4 -3
  157. package/std/sys/iov.yo +1 -0
  158. package/std/sys/mmap.yo +1 -0
  159. package/std/sys/path.yo +1 -0
  160. package/std/sys/perm.yo +2 -1
  161. package/std/sys/pipe.yo +1 -0
  162. package/std/sys/process.yo +5 -4
  163. package/std/sys/signal.yo +1 -0
  164. package/std/sys/socketpair.yo +1 -0
  165. package/std/sys/sockinfo.yo +1 -0
  166. package/std/sys/statfs.yo +2 -1
  167. package/std/sys/statx.yo +1 -0
  168. package/std/sys/sysinfo.yo +1 -0
  169. package/std/sys/tcp.yo +15 -14
  170. package/std/sys/temp.yo +1 -0
  171. package/std/sys/time.yo +2 -1
  172. package/std/sys/timer.yo +6 -6
  173. package/std/sys/tty.yo +2 -1
  174. package/std/sys/udp.yo +13 -12
  175. package/std/sys/unix.yo +12 -11
  176. package/std/testing/bench.yo +4 -3
  177. package/std/thread.yo +7 -6
  178. package/std/time/datetime.yo +18 -15
  179. package/std/time/duration.yo +11 -10
  180. package/std/time/instant.yo +4 -4
  181. package/std/time/sleep.yo +1 -0
  182. package/std/url/index.yo +5 -5
  183. package/std/worker.yo +4 -3
package/std/thread.yo CHANGED
@@ -1,4 +1,5 @@
1
- //! OS thread creation and management with per-thread IO event loops.
1
+ //! OS thread creation and management with per-thread Io event loops.
2
+ pragma(Pragma.AllowUnsafe);
2
3
  extern(
3
4
  "Yo",
4
5
  __yo_thread_get_hardware_threads : (fn() -> usize),
@@ -8,23 +9,23 @@ extern(
8
9
  extern(
9
10
  "Yo",
10
11
  __yo_thread_t : Type,
11
- __yo_thread_spawn : (fn(cb : Impl(Fn(using(io : IO)) -> unit, Send)) -> __yo_thread_t),
12
+ __yo_thread_spawn : (fn(cb : Impl(Fn(io : Io) -> unit, Send)) -> __yo_thread_t),
12
13
  __yo_thread_join : (fn(t : __yo_thread_t) -> unit)
13
14
  );
14
- /// OS thread handle. Each spawned thread gets its own IO event loop.
15
+ /// OS thread handle. Each spawned thread gets its own Io event loop.
15
16
  Thread :: struct(
16
17
  handle : __yo_thread_t
17
18
  );
18
19
  impl(
19
20
  Thread,
20
21
  /// Spawn a new OS thread running the given closure.
21
- /// The closure receives its own per-thread IO event loop.
22
- spawn : (fn(cb : Impl(Fn(using(io : IO)) -> unit, Send)) -> Self)({
22
+ /// The closure receives its own per-thread Io event loop.
23
+ spawn : (fn(cb : Impl(Fn(io : Io) -> unit, Send)) -> Self)({
23
24
  raw := __yo_thread_spawn(cb);
24
25
  Self(raw)
25
26
  }),
26
27
  /// Block the current thread until this thread completes.
27
- join : (fn(self : *(Self)) -> unit)(
28
+ join : (fn(ref(self) : Self) -> unit)(
28
29
  __yo_thread_join(self.handle)
29
30
  )
30
31
  );
@@ -8,6 +8,7 @@
8
8
  //! now := DateTime.now_utc();
9
9
  //! println(now.to_string()); // "2026-02-26T17:41:24Z"
10
10
  //! ```
11
+ pragma(Pragma.AllowUnsafe);
11
12
  { String } :: import("../string");
12
13
  { ToString } :: import("../fmt");
13
14
  { CLOCK_REALTIME, clock_gettime } :: import("../sys/clock");
@@ -111,7 +112,7 @@ impl(
111
112
  _from_unix_secs(secs, nanos)
112
113
  ),
113
114
  // Convert back to a Unix timestamp (seconds since epoch).
114
- to_unix : (fn(self : *(Self)) -> i64)({
115
+ to_unix : (fn(ref(self) : Self) -> i64)({
115
116
  // Compute days since epoch using the inverse Gregorian algorithm
116
117
  y := i64(self.year);
117
118
  m := i64(self.month);
@@ -136,11 +137,11 @@ impl(
136
137
  (days * i64(86400)) + time_secs
137
138
  }),
138
139
  // True if this year is a leap year.
139
- is_leap_year : (fn(self : *(Self)) -> bool)(
140
+ is_leap_year : (fn(ref(self) : Self) -> bool)(
140
141
  _is_leap_year(self.year)
141
142
  ),
142
143
  // Day of week: 0 = Monday, 6 = Sunday (ISO 8601).
143
- day_of_week : (fn(self : *(Self)) -> u8)({
144
+ day_of_week : (fn(ref(self) : Self) -> u8)({
144
145
  // Tomohiko Sakamoto's algorithm
145
146
  t := Array(i32, usize(12))(
146
147
  i32(0),
@@ -171,7 +172,7 @@ impl(
171
172
  )
172
173
  }),
173
174
  // Day of year (1-based).
174
- day_of_year : (fn(self : *(Self)) -> u16)({
175
+ day_of_year : (fn(ref(self) : Self) -> u16)({
175
176
  m := i32(self.month);
176
177
  d := i32(self.day);
177
178
  // Sum days in preceding months
@@ -194,19 +195,21 @@ impl(
194
195
  impl(
195
196
  DateTime,
196
197
  ToString(
197
- to_string : (fn(self : *(Self)) -> String)({
198
+ to_string : (fn(ref(self) : Self) -> String)({
198
199
  buf := Array(u8, usize(32)).fill(u8(0));
199
200
  buf_ptr := &(buf(usize(0)));
200
- snprintf(
201
- *(char)(buf_ptr),
202
- usize(32),
203
- "%04d-%02u-%02uT%02u:%02u:%02uZ",
204
- self.year,
205
- self.month,
206
- self.day,
207
- self.hour,
208
- self.minute,
209
- self.second
201
+ unsafe(
202
+ snprintf(
203
+ *(char)(buf_ptr),
204
+ usize(32),
205
+ "%04d-%02u-%02uT%02u:%02u:%02uZ",
206
+ self.year,
207
+ self.month,
208
+ self.day,
209
+ self.hour,
210
+ self.minute,
211
+ self.second
212
+ )
210
213
  );
211
214
  String.from_cstr(buf_ptr).unwrap()
212
215
  })
@@ -9,6 +9,7 @@
9
9
  //! println(d.as_secs()); // 0
10
10
  //! println(d.as_millis()); // 500
11
11
  //! ```
12
+ pragma(Pragma.AllowUnsafe);
12
13
  { String } :: import("../string");
13
14
  { ToString } :: import("../fmt");
14
15
  { snprintf } :: import("../libc/stdio");
@@ -40,27 +41,27 @@ impl(
40
41
  Self(secs : (nanos / i64(1000000000)), nanos : (nanos % i64(1000000000)))
41
42
  ),
42
43
  // Total whole seconds in the duration.
43
- as_secs : (fn(self : *(Self)) -> i64)(
44
+ as_secs : (fn(ref(self) : Self) -> i64)(
44
45
  self.secs
45
46
  ),
46
47
  // Total milliseconds (truncated).
47
- as_millis : (fn(self : *(Self)) -> i64)(
48
+ as_millis : (fn(ref(self) : Self) -> i64)(
48
49
  (self.secs * i64(1000)) + (self.nanos / i64(1000000))
49
50
  ),
50
51
  // Total microseconds (truncated).
51
- as_micros : (fn(self : *(Self)) -> i64)(
52
+ as_micros : (fn(ref(self) : Self) -> i64)(
52
53
  (self.secs * i64(1000000)) + (self.nanos / i64(1000))
53
54
  ),
54
55
  // Total nanoseconds.
55
- as_nanos : (fn(self : *(Self)) -> i64)(
56
+ as_nanos : (fn(ref(self) : Self) -> i64)(
56
57
  (self.secs * i64(1000000000)) + self.nanos
57
58
  ),
58
59
  // Total seconds as a floating-point number.
59
- as_secs_f64 : (fn(self : *(Self)) -> f64)(
60
+ as_secs_f64 : (fn(ref(self) : Self) -> f64)(
60
61
  f64(self.secs) + (f64(self.nanos) / f64(1000000000.0))
61
62
  ),
62
63
  // Add two durations together.
63
- add : (fn(self : *(Self), other : Duration) -> Duration)({
64
+ add : (fn(ref(self) : Self, other : Duration) -> Duration)({
64
65
  total_nanos := (self.nanos + other.nanos);
65
66
  carry := (total_nanos / i64(1000000000));
66
67
  Duration(
@@ -69,7 +70,7 @@ impl(
69
70
  )
70
71
  }),
71
72
  // Subtract another duration (saturates to zero if negative).
72
- sub : (fn(self : *(Self), other : Duration) -> Duration)({
73
+ sub : (fn(ref(self) : Self, other : Duration) -> Duration)({
73
74
  self_ns := self.as_nanos();
74
75
  other_ns := other.as_nanos();
75
76
  cond(
@@ -78,17 +79,17 @@ impl(
78
79
  )
79
80
  }),
80
81
  // Return true if this duration is zero.
81
- is_zero : (fn(self : *(Self)) -> bool)(
82
+ is_zero : (fn(ref(self) : Self) -> bool)(
82
83
  (self.secs == i64(0)) && (self.nanos == i64(0))
83
84
  )
84
85
  );
85
86
  impl(
86
87
  Duration,
87
88
  ToString(
88
- to_string : (fn(self : *(Self)) -> String)({
89
+ to_string : (fn(ref(self) : Self) -> String)({
89
90
  buf := Array(u8, usize(64)).fill(u8(0));
90
91
  buf_ptr := &(buf(usize(0)));
91
- snprintf(*(char)(buf_ptr), usize(64), "%llds %lldns", self.secs, self.nanos);
92
+ unsafe(snprintf(*(char)(buf_ptr), usize(64), "%llds %lldns", self.secs, self.nanos));
92
93
  String.from_cstr(buf_ptr).unwrap()
93
94
  })
94
95
  )
@@ -10,6 +10,7 @@
10
10
  //! elapsed := start.elapsed();
11
11
  //! println(elapsed.as_millis());
12
12
  //! ```
13
+ pragma(Pragma.AllowUnsafe);
13
14
  { Duration } :: import("./duration");
14
15
  { CLOCK_MONOTONIC, clock_gettime } :: import("../sys/clock");
15
16
  /// Snapshot from the monotonic clock. Use `elapsed` to measure durations.
@@ -29,7 +30,7 @@ impl(
29
30
  }),
30
31
  // Duration between this instant and an earlier one.
31
32
  // Returns Duration.zero() if `earlier` is actually later.
32
- duration_since : (fn(self : *(Self), earlier : Instant) -> Duration)({
33
+ duration_since : (fn(ref(self) : Self, earlier : Instant) -> Duration)({
33
34
  self_ns := ((self.secs * i64(1000000000)) + self.nanos);
34
35
  earlier_ns := ((earlier.secs * i64(1000000000)) + earlier.nanos);
35
36
  cond(
@@ -38,10 +39,9 @@ impl(
38
39
  )
39
40
  }),
40
41
  // Duration elapsed since this instant was created.
41
- elapsed : (fn(self : *(Self)) -> Duration)({
42
+ elapsed : (fn(ref(self) : Self) -> Duration)({
42
43
  current := Instant.now();
43
- cur_ptr := (&(current));
44
- cur_ptr.duration_since(self.*)
44
+ current.duration_since(self)
45
45
  })
46
46
  );
47
47
  export(Instant);
package/std/time/sleep.yo CHANGED
@@ -6,6 +6,7 @@
6
6
  //! { sleep } :: import "std/time/sleep";
7
7
  //! sleep(usize(100)); // sleep 100ms
8
8
  //! ```
9
+ pragma(Pragma.AllowUnsafe);
9
10
  extern(
10
11
  "Yo",
11
12
  __yo_ms_sleep : (fn(ms : usize) -> unit)
package/std/url/index.yo CHANGED
@@ -51,7 +51,7 @@ _DOT :: u8(46); // '.'
51
51
  // ============================================================================
52
52
  // Helper: parse port number from bytes
53
53
  // ============================================================================
54
- _parse_port :: (fn(s : str, start : usize, end : usize, using(exn : Exception)) -> u16)({
54
+ _parse_port :: (fn(s : str, start : usize, end : usize, exn : Exception) -> u16)({
55
55
  cond(
56
56
  (start >= end) => {
57
57
  exn.throw(dyn(UrlError.InvalidPort));
@@ -95,7 +95,7 @@ impl(
95
95
  // Parse a URL string.
96
96
  // Supports: scheme://[userinfo@]host[:port]/path[?query][#fragment]
97
97
  // Also supports scheme:path (opaque URIs like mailto:user@example.com)
98
- parse : (fn(s : str, using(exn : Exception)) -> Url)({
98
+ parse : (fn(s : str, exn : Exception) -> Url)({
99
99
  cond(
100
100
  (s.len() == usize(0)) => {
101
101
  exn.throw(dyn(UrlError.EmptyInput));
@@ -234,7 +234,7 @@ impl(
234
234
  after_bracket := (bracket_end + usize(1));
235
235
  cond(
236
236
  ((after_bracket < auth_end) && (s.bytes(after_bracket) == _COLON)) => {
237
- port =.Some(_parse_port(s, after_bracket + usize(1), auth_end));
237
+ port =.Some(_parse_port(s, after_bracket + usize(1), auth_end, exn));
238
238
  },
239
239
  true => ()
240
240
  );
@@ -264,7 +264,7 @@ impl(
264
264
  hh2 = (hh2 + usize(1));
265
265
  });
266
266
  host =.Some(String.from_bytes(host_b));
267
- port =.Some(_parse_port(s, cp_val + usize(1), auth_end));
267
+ port =.Some(_parse_port(s, cp_val + usize(1), auth_end, exn));
268
268
  },
269
269
  .None => {
270
270
  // No port, entire range is host
@@ -363,7 +363,7 @@ impl(
363
363
  );
364
364
  // Ensure authority-based URLs have a path starting with "/" or empty
365
365
  cond(
366
- (has_authority && ((!(path_str.is_empty())) && (path_str.as_bytes().get(usize(0)).unwrap() != _SLASH))) => {
366
+ (has_authority && ((!(path_str.is_empty())) && (path_str.as_bytes()(usize(0)) != _SLASH))) => {
367
367
  exn.throw(dyn(UrlError.Other(`authority path must start with '/'`)));
368
368
  },
369
369
  true => ()
package/std/worker.yo CHANGED
@@ -1,16 +1,17 @@
1
1
  //! Thread pool with per-core thread affinity and round-robin task distribution.
2
2
  //!
3
3
  //! Each task is pinned to a worker thread (no work stealing).
4
- //! Each worker thread has its own GC heap and async IO event loop.
4
+ //! Each worker thread has its own GC heap and async Io event loop.
5
+ pragma(Pragma.AllowUnsafe);
5
6
  extern(
6
7
  "Yo",
7
- __yo_worker_spawn : (fn(cb : Impl(Fn(using(io : IO)) -> unit, Send)) -> unit),
8
+ __yo_worker_spawn : (fn(cb : Impl(Fn(io : Io) -> unit, Send)) -> unit),
8
9
  __yo_worker_get_num_threads : (fn() -> usize),
9
10
  __yo_worker_set_num_threads : (fn(num : usize) -> unit)
10
11
  );
11
12
  /// Spawn a task on the thread pool. Returns immediately; the task runs in the background.
12
13
  /// Tasks are distributed round-robin to worker threads.
13
- spawn :: (fn(cb : Impl(Fn(using(io : IO)) -> unit, Send)) -> unit)({
14
+ spawn :: (fn(cb : Impl(Fn(io : Io) -> unit, Send)) -> unit)({
14
15
  __yo_worker_spawn(cb);
15
16
  });
16
17
  /// Get the number of worker threads in the pool.