@amritk/nish-aarch64-linux 0.37.0 → 0.39.0

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 (73) hide show
  1. package/INSTALL.md +28 -16
  2. package/bin/nish +0 -0
  3. package/docs/AI.md +380 -47
  4. package/package.json +1 -1
  5. package/runtime/core/arrays.d.ts +4 -0
  6. package/runtime/core/arrays.mjs +33 -0
  7. package/runtime/core/host.d.ts +11 -0
  8. package/runtime/core/host.mjs +35 -0
  9. package/runtime/nish.d.ts +645 -66
  10. package/runtime/nish.h +101 -15
  11. package/runtime/nish.mjs +69 -6
  12. package/runtime/node.mjs +117 -0
  13. package/runtime/runtime-aes.c +12 -4
  14. package/runtime/runtime-async.c +267 -51
  15. package/runtime/runtime-checksum.c +207 -15
  16. package/runtime/runtime-cross.c +2 -1
  17. package/runtime/runtime-net.c +32 -3
  18. package/runtime/runtime-os.c +174 -27
  19. package/runtime/runtime-region.c +170 -8
  20. package/runtime/runtime-sandbox.c +377 -17
  21. package/runtime/runtime-sha256.c +11 -4
  22. package/runtime/runtime-text.c +1068 -0
  23. package/runtime/runtime-wasm.c +18 -3
  24. package/runtime/runtime.c +55 -961
  25. package/runtime/vite.mjs +48 -11
  26. package/scripts/build.sh +113 -36
  27. package/std/LICENSE-fdlibm +8 -0
  28. package/std/README.md +7 -4
  29. package/std/array.ts +266 -0
  30. package/std/compress/checksum.ts +13 -0
  31. package/std/compress/deflate.ts +0 -2
  32. package/std/crypto/p256.ts +247 -74
  33. package/std/crypto/p384.ts +3 -1
  34. package/std/crypto/pki.ts +35 -9
  35. package/std/crypto/x25519.ts +153 -64
  36. package/std/crypto/x509.ts +113 -10
  37. package/std/host/text.ts +86 -0
  38. package/std/json-tokenizer.ts +20 -0
  39. package/std/json-typed.ts +217 -8
  40. package/std/math.ts +743 -41
  41. package/std/net/dns-resolver.ts +46 -6
  42. package/std/net/dns.ts +50 -13
  43. package/std/net/fetch.ts +691 -129
  44. package/std/net/handler.ts +142 -16
  45. package/std/net/http-compress.ts +17 -9
  46. package/std/net/http-fields.ts +19 -4
  47. package/std/net/http1-codec.ts +517 -154
  48. package/std/net/http1-server.ts +508 -25
  49. package/std/net/http2-cleartext.ts +526 -0
  50. package/std/net/http2-tls.ts +48 -0
  51. package/std/net/http2.ts +84 -0
  52. package/std/net/postgres-async.ts +2223 -0
  53. package/std/net/postgres-carrier.ts +343 -10
  54. package/std/net/postgres.ts +129 -11
  55. package/std/net/prefork.ts +195 -11
  56. package/std/net/quic-datagram.ts +30 -0
  57. package/std/net/quic-listener.ts +38 -12
  58. package/std/net/quic-packet.ts +19 -6
  59. package/std/net/quic-recovery.ts +134 -19
  60. package/std/net/quic-stream.ts +174 -36
  61. package/std/net/quic.ts +418 -18
  62. package/std/net/router.ts +39 -17
  63. package/std/net/serve.ts +867 -0
  64. package/std/net/tls/codec.ts +110 -32
  65. package/std/net/tls/record-server.ts +37 -7
  66. package/std/net/tls-tcp.ts +56 -1
  67. package/std/net/tls.ts +196 -50
  68. package/std/net/websocket.ts +55 -18
  69. package/std/net/webtransport.ts +179 -1
  70. package/std/regex.ts +69 -47
  71. package/std/region.ts +62 -11
  72. package/std/secret.ts +26 -59
  73. package/std/text.ts +464 -5
@@ -10,9 +10,9 @@
10
10
  * pointers are 4 bytes, and the inlined fast path in every compiled function
11
11
  * bumps the 64-bit `off` field directly. Panics are `unreachable` (a JS
12
12
  * RuntimeError); there is no stderr to write a message to, so under
13
- * wasm-host the page is told first (NISH_DIE). Strings and I/O
14
- * need a WASI runtime and are not provided here, so `--emit-dts` lists
15
- * string functions as not exported. */
13
+ * wasm-host the page is told first (NISH_DIE). Strings are
14
+ * runtime-text.c's, which build.sh links beside this file when the IR builds
15
+ * one; I/O needs a WASI runtime and is not provided. */
16
16
  #include <stddef.h>
17
17
  #include <stdint.h>
18
18
 
@@ -182,6 +182,21 @@ void nish_exit(int32_t code) { (void)code; __builtin_trap(); }
182
182
  * link; the loader throws a RangeError before the call reaches it. */
183
183
  void nish_panic(const void *s) { (void)s; __builtin_trap(); }
184
184
  #endif
185
+ /* ---- Streaming reads (WP44 §9 Q7): the checker refuses `fileOpen`,
186
+ * `fileReadAt`, `fileSize` and `fileClose` on a freestanding wasm32 target
187
+ * (NL2718), but `--profile wasm` links IR compiled for the host, which no
188
+ * check sees. There is no file system to read, so each answers -38 (`ENOSYS`)
189
+ * and the link never fails on their names. The path is `const void *`, as
190
+ * `nish_panic`'s string is: this file has no `nish_str`, and the ABI is the
191
+ * same pointer. tests/run.js's wasm profile section links all four. */
192
+ int32_t nish_file_open(const void *path) { (void)path; return -38; }
193
+ int32_t nish_file_read_at(int32_t fd, nish_array *buf, int64_t off, int64_t len, int64_t pos) {
194
+ (void)fd; (void)buf; (void)off; (void)len; (void)pos;
195
+ return -38;
196
+ }
197
+ int64_t nish_file_size(int32_t fd) { (void)fd; return -38; }
198
+ int32_t nish_file_close(int32_t fd) { (void)fd; return -38; }
199
+
185
200
  /* Output has nowhere to go either. */
186
201
  void nish_write(const void *s, int32_t fd, _Bool newline) { (void)s; (void)fd; (void)newline; }
187
202