Commit e5bc33a
feat(openkal-emscripten): the first implementation written above a C library (#393)
Every other implementation in this ecosystem is written on a kernel's own
interface: a register discipline, a trap instruction, a table of numbers.
Emscripten has no kernel to issue a call to; it has a C library over a
JavaScript host, and clause 2 of the specification permits exactly this
arrangement in as many words -- "an implementation may be built upon a C
library, beneath one, or without one".
TWELVE OF THE FIFTEEN INTERFACES, AND THE ABSENCE IS THE REPORT.
`openkal.process`, `openkal.exec` and `openkal.space` are not there: no fork,
no exec, no writable-then-executable memory, no second address space. A program
that uses one of those seventeen names fails at LINK naming the symbol, which is
clause 6.2's second time. Measured:
wasm-ld: error: obj/main.o: undefined symbol: kal_process_spawn
Providing them so that they returned an error would be the shape the
specification forbids -- present and always failing, which the caller cannot
tell from a condition.
`openkal.task` is behind a feature, because `-pthread` selects a different C
library build, memory model and loader contract on this platform. Without it
the translation unit is empty and the eight symbols do not exist, which is the
same treatment the three absent interfaces get and for the same reason.
CONFORMANCE, measured with emsdk 6.0.9 under node: 86 held, 0 did not hold, 13
not observed. The exported surface is 86 names, twelve complete groups, three
absent groups, and nothing beginning with `kal_` the specification does not
name. The package's own CI asserts all four, plus the task gate in both
directions.
Both mirrors GET-verified byte for byte against the upstream tag archive:
GLOBAL github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.1.0.tar.gz
CN gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.1.0/...
sha256 9c5ca4ae4c3bb22b127e2fbf6ca5bd4ecbdd80eac4a28018e3deb0c7ebd07b6d
bytes 39383, and `cmp` of the two downloads is silent
Listed for every platform because a platform table describes availability
rather than applicability. A project selects it with a conditional dependency
on `cfg(os = "emscripten")`, and one that selects it elsewhere fails at compile
time.
Co-authored-by: speak-agent <x.d2learn.org@gmail.com>1 parent 9ea3271 commit e5bc33a
1 file changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments