@amritk/nish-x86_64-linux 0.20.0 → 0.21.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.
- package/INSTALL.md +22 -10
- package/bin/nish +0 -0
- package/docs/AI.md +2759 -0
- package/package.json +2 -1
- package/runtime/browser.d.ts +14 -0
- package/runtime/browser.mjs +88 -0
- package/runtime/core/arrays.d.ts +18 -0
- package/runtime/core/arrays.mjs +125 -0
- package/runtime/core/checks.mjs +20 -0
- package/runtime/core/host.d.ts +70 -0
- package/runtime/core/host.mjs +311 -0
- package/runtime/core/numbers.d.ts +53 -0
- package/runtime/core/numbers.mjs +316 -0
- package/runtime/core/result.d.ts +41 -0
- package/runtime/core/result.mjs +127 -0
- package/runtime/core/strings.d.ts +14 -0
- package/runtime/core/strings.mjs +169 -0
- package/runtime/core.d.ts +9 -0
- package/runtime/core.mjs +55 -0
- package/runtime/host.d.ts +6 -0
- package/runtime/nish.d.ts +44 -0
- package/runtime/nish.h +75 -2
- package/runtime/nish.mjs +23 -3
- package/runtime/node.mjs +383 -0
- package/runtime/runtime-bytes.c +401 -0
- package/runtime/runtime-cross.c +1 -1
- package/runtime/runtime-host.c +1 -1
- package/runtime/runtime-os.c +1 -1
- package/runtime/runtime-parallel.c +1 -1
- package/runtime/runtime-simd.c +231 -7
- package/runtime/runtime-term.c +504 -0
- package/runtime/runtime-wasm.c +0 -11
- package/runtime/runtime.c +190 -6
- package/runtime/shim.mjs +6 -985
- package/runtime/sqlite/LICENSE.md +85 -0
- package/runtime/sqlite/README.md +45 -0
- package/runtime/sqlite/nish-sqlite.c +359 -0
- package/runtime/sqlite/sqlite3.c +271131 -0
- package/runtime/sqlite/sqlite3.h +14447 -0
- package/scripts/build.sh +261 -53
- package/std/LICENSE-fast-float +23 -0
- package/std/LICENSE-fdlibm +8 -0
- package/std/README.md +31 -11
- package/std/base64.ts +116 -0
- package/std/bytes.ts +256 -0
- package/std/cli.ts +328 -0
- package/std/collections.ts +6 -5
- package/std/crypto/LICENSE-crypt_blowfish +26 -0
- package/std/crypto/base64url.ts +125 -0
- package/std/crypto/bcrypt.ts +760 -0
- package/std/crypto/hmac.ts +138 -2
- package/std/crypto/x509.ts +11 -122
- package/std/json-tokenizer.ts +2998 -57
- package/std/json-value.ts +22 -3
- package/std/json.ts +83 -1
- package/std/math.ts +608 -0
- package/std/net/http1-server.ts +85 -8
- package/std/net/http3-server.ts +50 -12
- package/std/net/postgres.ts +1875 -0
- package/std/net/quic-listener.ts +20 -4
- package/std/regex.ts +4274 -0
- package/std/sqlite.ts +391 -0
- package/std/term-io.ts +978 -0
- package/std/term-pixels.ts +874 -0
- package/std/term-probe.ts +459 -0
- package/std/term-rate.ts +993 -0
- package/std/term.ts +2453 -0
- package/std/text.ts +90 -7
- package/std/yaml-lines.ts +141 -0
- package/std/yaml.ts +4675 -0
package/INSTALL.md
CHANGED
|
@@ -224,7 +224,7 @@ routes are
|
|
|
224
224
|
# on the musl host, with its own clang and the runtime from this repository
|
|
225
225
|
clang app.ll runtime/runtime.c runtime/runtime-os.c runtime/runtime-parallel.c \
|
|
226
226
|
runtime/runtime-cross.c runtime/runtime-host.c runtime/runtime-net.c \
|
|
227
|
-
runtime/runtime-simd.c runtime/runtime-aes.c -lm -o app
|
|
227
|
+
runtime/runtime-simd.c runtime/runtime-aes.c runtime/runtime-term.c runtime/runtime-bytes.c -lm -o app
|
|
228
228
|
```
|
|
229
229
|
|
|
230
230
|
`--link`ing inside the container is the mistake to avoid: it shells out to the
|
|
@@ -360,22 +360,25 @@ it into `build/seed/`; `NISH_BOOTSTRAP=<path>` names one you already have and
|
|
|
360
360
|
skips the download. §2a has what the build does with it.
|
|
361
361
|
|
|
362
362
|
The published package ships `bin/` (the `nish` command, which is a launcher),
|
|
363
|
-
`runtime/` (the C runtime —
|
|
364
|
-
|
|
363
|
+
`runtime/` (the C runtime — ten translation units, the wasm subset and their
|
|
364
|
+
header — and `runtime/sqlite/`, SQLite's vendored source),
|
|
365
|
+
`scripts/build.sh` (the link pipeline), `std/` (the standard library) and
|
|
366
|
+
`docs/AI.md` (the rules card). The
|
|
365
367
|
compiler itself is not in it: it arrives as one prebuilt
|
|
366
368
|
`@amritk/nish-<asset>` package per platform, and `bin/nish` hands over to
|
|
367
|
-
whichever one npm installed.
|
|
369
|
+
whichever one npm installed. That package carries its own copy of all of
|
|
370
|
+
these, and its `docs/AI.md` is the one an agent's `nish --help` names. `nish` locates the runtime, the script and `std/`
|
|
368
371
|
relative to its own install directory, so a global install works from any
|
|
369
372
|
working directory — and the binary runs from inside its own platform package
|
|
370
373
|
for exactly that reason.
|
|
371
374
|
|
|
372
375
|
Building the IR yourself rather than through `--link` means naming the runtime
|
|
373
|
-
on the `clang` line, and it is
|
|
376
|
+
on the `clang` line, and it is ten files:
|
|
374
377
|
|
|
375
378
|
```bash
|
|
376
379
|
clang app.ll runtime/runtime.c runtime/runtime-os.c runtime/runtime-parallel.c \
|
|
377
380
|
runtime/runtime-cross.c runtime/runtime-host.c runtime/runtime-net.c \
|
|
378
|
-
runtime/runtime-simd.c runtime/runtime-aes.c -lm -o app
|
|
381
|
+
runtime/runtime-simd.c runtime/runtime-aes.c runtime/runtime-term.c runtime/runtime-bytes.c -lm -o app
|
|
379
382
|
```
|
|
380
383
|
|
|
381
384
|
`runtime.c` is the part every program touches — the arena, strings, arrays,
|
|
@@ -387,15 +390,24 @@ needs `-DNISH_THREADS=1 -pthread` on the line), `runtime-cross.c` copies
|
|
|
387
390
|
the strings and arrays a task answers, a channel sends or a `Mutex` keeps out
|
|
388
391
|
of the arena they were made in, `runtime-host.c` holds the wall clock,
|
|
389
392
|
entropy, file times and signals, `runtime-net.c` the sockets of `nish:net`,
|
|
390
|
-
|
|
393
|
+
`runtime-simd.c` and `runtime-aes.c` the vector text search and AES-GCM,
|
|
394
|
+
`runtime-term.c` the stdin reads and terminal calls of `nish:term`, and
|
|
395
|
+
`runtime-bytes.c` the byte-class runs of `nish/bytes`, which `nish/json` steps
|
|
396
|
+
over.
|
|
391
397
|
They are separate so that each carries its own measured size ceiling
|
|
392
398
|
([docs/wp7-runtime.md](wp7-runtime.md)); nothing in the core calls into the
|
|
393
399
|
others, so a line that names only `runtime.c` and `runtime-os.c` still links a
|
|
394
|
-
program that uses none of the other
|
|
395
|
-
|
|
400
|
+
program that uses none of the other eight. `scripts/build.sh` compiles the other
|
|
401
|
+
eight beside any
|
|
396
402
|
`runtime.c` it is handed, so a build that goes through it — every `--link`,
|
|
397
403
|
and every `--profile` recipe in these documents — needs to name only the one.
|
|
398
404
|
|
|
405
|
+
A program whose IR declares an `sqlite3_*` function also needs SQLite on a
|
|
406
|
+
hand-written line. `scripts/build.sh` adds it by itself; by hand, append
|
|
407
|
+
`runtime/sqlite/sqlite3.c` with the options `scripts/build.sh` lists under
|
|
408
|
+
"SQLite's compile-time options" (at least `-DSQLITE_THREADSAFE=0`, or `=2`
|
|
409
|
+
beside `-DNISH_THREADS=1`).
|
|
410
|
+
|
|
399
411
|
## 2a. What `npm run build` does
|
|
400
412
|
|
|
401
413
|
`src/` is the compiler, written in Nish, and it compiles itself
|
|
@@ -506,7 +518,7 @@ Removing the directory is always safe.
|
|
|
506
518
|
| 2 | usage error: unknown flag, missing argument, no input files |
|
|
507
519
|
| 3 | toolchain error: `--link` found no `clang` (`CC` overrides), or `scripts/build.sh` failed (its output is shown; the `.ll` files are still written) — or the `nish` command found no prebuilt compiler for this platform, or one that would not start. Under `--json` all of these are one `NL0002` object |
|
|
508
520
|
| | `nish run` answers these codes until the program starts, and the program's own exit status (`128 + n` for a signal) after that. With neither `HOME` nor `XDG_CACHE_HOME` set to an absolute path it answers 3 |
|
|
509
|
-
| 70 | internal compiler error:
|
|
521
|
+
| 70 | internal compiler error: a broken invariant in the compiler. Please report it at <https://github.com/amritk/nish/issues> with the input and command line; the compiler is self-hosted and has no stack trace to print, so the message it prints is the whole report |
|
|
510
522
|
|
|
511
523
|
## Troubleshooting
|
|
512
524
|
|
package/bin/nish
CHANGED
|
Binary file
|