@fraczak/k 6.2.1 → 6.2.3
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/CHANGELOG.md +11 -0
- package/DOCS/OBJECT_FILE_AND_PATTERN.md +6 -3
- package/README.md +5 -4
- package/a.klib +1 -0
- package/codecs/runtime/codec.mjs +135 -72
- package/codecs/runtime/prefix-codec.mjs +98 -64
- package/k.mjs +51 -15
- package/objects/README.md +7 -17
- package/objects/compile.mjs +213 -24
- package/package.json +1 -2
- package/scripts/benchmark-idempotency.mjs +3 -3
- package/scripts/run-tests.mjs +1 -0
- package/tests/integration.sh +18 -1
- package/tests/test-deep-wire-value.mjs +29 -0
- package/objects/compile-lib.mjs +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [6.2.3] — 2026-06-03 — Unified k compiler output
|
|
11
|
+
|
|
12
|
+
### Toolchain
|
|
13
|
+
|
|
14
|
+
- Unified `k-compile` so it can emit `.ko`, `.klib`, and `.kvm` output.
|
|
15
|
+
- Removed the separate `k-compile-lib` binary; use `k-compile ... .klib`.
|
|
16
|
+
- Added inline source snippet input to `k-compile`, matching the `k` CLI style.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
10
20
|
## [6.1.0] — 2026-05-20 — CLI aliases and help
|
|
11
21
|
|
|
12
22
|
### Toolchain
|
|
@@ -61,5 +71,6 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
61
71
|
|
|
62
72
|
---
|
|
63
73
|
|
|
74
|
+
[6.2.3]: https://github.com/fraczak/k/releases/tag/v6.2.3
|
|
64
75
|
[6.1.0]: https://github.com/fraczak/k/releases/tag/v6.1.0
|
|
65
76
|
[6.0.0]: https://github.com/fraczak/k/releases/tag/v6.0.0
|
|
@@ -144,14 +144,17 @@ Standalone helpers live in `objects/`:
|
|
|
144
144
|
|
|
145
145
|
```sh
|
|
146
146
|
k-compile path/to/program.k path/to/program.ko
|
|
147
|
-
k-compile
|
|
147
|
+
k-compile path/to/library.k path/to/library.klib
|
|
148
|
+
k-compile path/to/program.k path/to/program.kvm
|
|
148
149
|
k-decompile path/to/program.ko path/to/program.decompiled.k
|
|
149
150
|
k-extract-aliases path/to/library.klib path/to/aliases.k
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
With no arguments, the helpers
|
|
153
|
+
`k-compile` also accepts inline source snippets. With no arguments, the helpers
|
|
154
|
+
read from stdin and write to stdout:
|
|
153
155
|
|
|
154
156
|
```sh
|
|
157
|
+
k-compile 'x = |x; x x' > path/to/program.ko
|
|
155
158
|
cat path/to/program.k | k-compile > path/to/program.ko
|
|
156
159
|
cat path/to/program.ko | k-decompile > path/to/program.decompiled.k
|
|
157
160
|
```
|
|
@@ -259,7 +262,7 @@ succ = |succ;
|
|
|
259
262
|
compile it with:
|
|
260
263
|
|
|
261
264
|
```sh
|
|
262
|
-
k-compile
|
|
265
|
+
k-compile defs.k defs.klib
|
|
263
266
|
```
|
|
264
267
|
|
|
265
268
|
The output file is plain JSON and starts with `{`, not a binary prefix. Its
|
package/README.md
CHANGED
|
@@ -151,9 +151,11 @@ k programs can be compiled into:
|
|
|
151
151
|
|
|
152
152
|
- `.klib`: plain JSON library objects
|
|
153
153
|
- `.ko`: executable binary object containers
|
|
154
|
+
- `.kvm`: JSON kVM programs
|
|
154
155
|
|
|
155
|
-
|
|
156
|
-
type-derivation status.
|
|
156
|
+
Object and library files keep canonical code/relation definitions, aliases,
|
|
157
|
+
metadata, and type-derivation status. The `.kvm` output is a lowered JSON
|
|
158
|
+
program for backend inspection and execution experiments.
|
|
157
159
|
|
|
158
160
|
## CLI Tour
|
|
159
161
|
|
|
@@ -186,8 +188,7 @@ type-derivation status.
|
|
|
186
188
|
|
|
187
189
|
| Command | Purpose |
|
|
188
190
|
| --- | --- |
|
|
189
|
-
| `k-compile` | Compile `.k` source to
|
|
190
|
-
| `k-compile-lib` | Compile `.k` source to a `.klib` library |
|
|
191
|
+
| `k-compile` | Compile `.k` source to `.ko`, `.klib`, or `.kvm` output |
|
|
191
192
|
| `k-decompile` | Decompile `.ko` or `.klib` back to k source |
|
|
192
193
|
| `k-extract-aliases` | Recover metadata aliases as k source |
|
|
193
194
|
|