From d3a23e9adc307e1a58a026e857252611c76599fd Mon Sep 17 00:00:00 2001 From: speak-agent Date: Thu, 20 Aug 2026 04:36:15 +0800 Subject: [PATCH] feat: openkal 0.3.0, with implementations for Linux and macOS and a C library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The specification now covers eight interfaces rather than three. The five added are derived from resource kinds, and each carries the evidence that it was derived rather than borrowed. * openkal.fs is relative to a directory throughout and has no global namespace of paths, because a global namespace is unavailable on a capability-based kernel and an implementation upon one would have to construct it. * openkal.process starts a program rather than duplicating the caller, because duplication cannot be performed faithfully on every environment. A large portable program corroborates the choice: it spawns and calls neither of the duplicating operations. * openkal.task exposes the primitive that suspends a context upon a word. Mutexes and condition variables are constructions above it, which is observable in any C library that implements them. Two implementations are registered rather than one, and the second is what turns the specification from a description of one system into a portable one. Four divergences are recorded in it, and each is a place where an interface could have assumed a mechanism: the monotonic clock continues during suspension where the other stops, names are compared without regard to case, the spawn has no attribute setting the working directory, and there is no suspension primitive a program may use. openkal-libc tests the claim the specification makes. It performs the two adaptations the specification deliberately places outside itself — resolving a global name against the supplied directories, and constructing synchronisation objects from the suspension primitive — and an ordinary program above it reads a file by global path, consults a variable, measures an interval and starts another program without containing any of that. Earlier versions of the two openkal packages are replaced rather than retained: a specification whose clauses have changed is a different specification, and two of them under one name would be worse than the absence of the earlier. --- pkgs/o/openkal-libc.lua | 47 ++++++++++++++++++++++++++++++++++++ pkgs/o/openkal-linux.lua | 24 +++++++++---------- pkgs/o/openkal-macos.lua | 52 ++++++++++++++++++++++++++++++++++++++++ pkgs/o/openkal.lua | 24 +++++++++---------- 4 files changed, 123 insertions(+), 24 deletions(-) create mode 100644 pkgs/o/openkal-libc.lua create mode 100644 pkgs/o/openkal-macos.lua diff --git a/pkgs/o/openkal-libc.lua b/pkgs/o/openkal-libc.lua new file mode 100644 index 0000000..e484ee1 --- /dev/null +++ b/pkgs/o/openkal-libc.lua @@ -0,0 +1,47 @@ +-- openkal-libc --- a C library above openkal. +-- +-- No `deps`. The package needs nothing beyond the specification it is written +-- against; the implementation that supplies the definitions is chosen by the +-- consuming project as a conditional dependency. +package = { + spec = "1", + namespace = "mcpplibs", + name = "openkal-libc", + description = "A C library above openkal rather than above a kernel, written to test the claim that porting one library suffices", + licenses = {"Apache-2.0"}, + repo = "https://github.com/mcpplibs/openkal-libc", + type = "package", + + xpm = { + linux = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-libc/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-libc/releases/download/0.1.0/openkal-libc-0.1.0.tar.gz", + }, + sha256 = "721bfa8ef8bbacadb2a17991a14cd6fd1248f8b20b30ab782dafd23f966a2084", + }, + }, + macosx = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-libc/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-libc/releases/download/0.1.0/openkal-libc-0.1.0.tar.gz", + }, + sha256 = "721bfa8ef8bbacadb2a17991a14cd6fd1248f8b20b30ab782dafd23f966a2084", + }, + }, + windows = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-libc/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-libc/releases/download/0.1.0/openkal-libc-0.1.0.tar.gz", + }, + sha256 = "721bfa8ef8bbacadb2a17991a14cd6fd1248f8b20b30ab782dafd23f966a2084", + }, + }, + }, + + -- The package's own manifest, inside the tarball's wrap directory. + mcpp = "*/mcpp.toml", +} diff --git a/pkgs/o/openkal-linux.lua b/pkgs/o/openkal-linux.lua index 300ef83..86b412f 100644 --- a/pkgs/o/openkal-linux.lua +++ b/pkgs/o/openkal-linux.lua @@ -19,30 +19,30 @@ package = { xpm = { linux = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.2.0/openkal-linux-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.3.0/openkal-linux-0.3.0.tar.gz", }, - sha256 = "0007231fa59852f13ac3a0048033c9efbe6772c39545bbfb36f230c6ffd8a654", + sha256 = "a88f7c60330dd8f6b6778e478574a022a744893db1a2e338e0a42fb4eb949679", }, }, macosx = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.2.0/openkal-linux-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.3.0/openkal-linux-0.3.0.tar.gz", }, - sha256 = "0007231fa59852f13ac3a0048033c9efbe6772c39545bbfb36f230c6ffd8a654", + sha256 = "a88f7c60330dd8f6b6778e478574a022a744893db1a2e338e0a42fb4eb949679", }, }, windows = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.2.0/openkal-linux-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.3.0/openkal-linux-0.3.0.tar.gz", }, - sha256 = "0007231fa59852f13ac3a0048033c9efbe6772c39545bbfb36f230c6ffd8a654", + sha256 = "a88f7c60330dd8f6b6778e478574a022a744893db1a2e338e0a42fb4eb949679", }, }, }, diff --git a/pkgs/o/openkal-macos.lua b/pkgs/o/openkal-macos.lua new file mode 100644 index 0000000..87c662f --- /dev/null +++ b/pkgs/o/openkal-macos.lua @@ -0,0 +1,52 @@ +-- openkal-macos --- a second implementation. +-- +-- Its purpose is as much to test the specification as to be used. A +-- specification satisfied only by the system it was written against has not +-- been shown to be portable, however many programs that system hosts. +-- +-- Listed for every platform because a platform table describes availability +-- rather than applicability. A project selects this implementation with a +-- conditional dependency on cfg(os = "macos"); one that selects it elsewhere +-- fails at compile time, which is the correct place for that failure. +package = { + spec = "1", + namespace = "mcpplibs", + name = "openkal-macos", + description = "An implementation of openkal for macOS, which exists as much to test the specification as to be used", + licenses = {"Apache-2.0"}, + repo = "https://github.com/mcpplibs/openkal-macos", + type = "package", + + xpm = { + linux = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.1.0/openkal-macos-0.1.0.tar.gz", + }, + sha256 = "b546fd73c074abfb8a55c06c34e8e2184d6ba5bc953ef60e3bd50d08f1b79c1e", + }, + }, + macosx = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.1.0/openkal-macos-0.1.0.tar.gz", + }, + sha256 = "b546fd73c074abfb8a55c06c34e8e2184d6ba5bc953ef60e3bd50d08f1b79c1e", + }, + }, + windows = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.1.0/openkal-macos-0.1.0.tar.gz", + }, + sha256 = "b546fd73c074abfb8a55c06c34e8e2184d6ba5bc953ef60e3bd50d08f1b79c1e", + }, + }, + }, + + -- The package's own manifest, inside the tarball's wrap directory. + mcpp = "*/mcpp.toml", +} diff --git a/pkgs/o/openkal.lua b/pkgs/o/openkal.lua index be23ea2..32ffe6a 100644 --- a/pkgs/o/openkal.lua +++ b/pkgs/o/openkal.lua @@ -22,30 +22,30 @@ package = { xpm = { linux = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.2.0/openkal-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.3.0/openkal-0.3.0.tar.gz", }, - sha256 = "461865b784dbb2eb70f757e11889428e1551e297878877c424d429ff3a55281b", + sha256 = "919a13bb2a012f268c09591586e0c622f7ccab51bfa46cd36206576851d8945f", }, }, macosx = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.2.0/openkal-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.3.0/openkal-0.3.0.tar.gz", }, - sha256 = "461865b784dbb2eb70f757e11889428e1551e297878877c424d429ff3a55281b", + sha256 = "919a13bb2a012f268c09591586e0c622f7ccab51bfa46cd36206576851d8945f", }, }, windows = { - ["0.2.0"] = { + ["0.3.0"] = { url = { - GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.2.0.tar.gz", - CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.2.0/openkal-0.2.0.tar.gz", + GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.3.0/openkal-0.3.0.tar.gz", }, - sha256 = "461865b784dbb2eb70f757e11889428e1551e297878877c424d429ff3a55281b", + sha256 = "919a13bb2a012f268c09591586e0c622f7ccab51bfa46cd36206576851d8945f", }, }, },