On Sun, May 31, 2026 at 7:18 PM William ML Leslie
<
william.l...@gmail.com> wrote:
>
> There are a few details about my process that I should probably let you (and the rest of the capabilities mafia) in on, and I think this email is the motivation for me to talk about that publicly. I'll do that in my next email, here I'll just address points directly.
>
> On Mon, 1 Jun 2026 at 06:27, Matt Rice <
rat...@gmail.com> wrote:
>>
>> On Sun, May 31, 2026 at 4:02 AM William ML Leslie
>> <
william.l...@gmail.com> wrote:
>> >
>> > On Sun, 31 May 2026 at 18:36, Matt Rice <
rat...@gmail.com> wrote:
>> >>
>> >> Anyhow just trying to think that adding disjointedness checking on
>> >> closed numeric enums would mirror much of the benefits of the whole c
>> >> style open enum numeric representation,
>> >> but with additional checking and principles... because then you could
>> >> tell them apart by their bit repr, certain that they do not overlap.
>> >> *shrug*
>> >
>> >
>> > It's only one line for me to add this, and it was always the plan.
>> >
>> > CapnProto unions are disjoint, but I'm working around the native mechanism here so it's all on me. I'm just reflecting that CapIDL represented these as u64.
>> >
>>
>> Makes sense, but I suppose I am a little bit queasy about changing the
>> semantics of the cap'n proto c++ serialization,
>> mostly because of it differing from what the cap'n'proto official
>> docs/generators. I suppose as long as nobody tries to
>> combine the kernel interface generator and the cap'n proto c++ serializer?
>
>
> I'm not changing the encoding of unions everywhere, I'm doing a different encoding of method return values that happen to have unions.
>
> I would have liked to get this closer to rpc.capnp (which I guess is what you mean by "the official docs/generators") because I could then use any capnproto implementation in any language with rpc support to implement components. But since the aim is to make each method call literally a system call on an already well-defined interface, the specific encoding used for parameters in rpc.capnp had to change.
>
By "the official docs/generators I meant specifically the "C++
serialization' page, I was talking about earlier which had open enum
semantics.
> An adapter between an rpc.capnp message and the coytos kernel interface would be possible, too, but it seems a significant burden for small-space programs.
>
> Note that the official documentation explicitly calls out that variation on this theme might make sense, almost as if Kenton had my exact use case in mind:
https://capnproto.org/encoding.html#capabilities-interfaces
>
>> I guess I should also say I'm kind of skeptical of external build time
>> dependencies including interpreters like python.
>
>
> According to my git history, the port of the Coyotos cross-environment from GCC 4.5 to GCC 10 took me from October 2020 to February 2022. If there's any dependency we should be skeptical of at this point, it's the C toolchain. Now, to be fair, I didn't have a lot of GNU toolchain knowledge when I started out (if you want to learn what I didn't know, the Linux From Scratch tutorial covers pretty much everything I was missing), but I'd just rather something that I have the depth of knowledge on that I could port it even if the entire internet went down, and given my history, that is Python.
>
>
https://gitlab.com/william-ml-leslie/ccs-xenv/-/commits/master?ref_type=HEADS
>
https://gitlab.com/william-ml-leslie/gnu-guix/-/commits/capos?ref_type=heads
>
> This doesn't preclude anyone rewriting it in some other language at some point. Rewrites are trivial, getting the semantics nailed down is the tricky part.
>
> Ideally, the only build dependency you'd need today is guix or nix and the software archive, which is totally achievable as far as I can tell.
>
Indeed the portability of c compilers to capability systems (without
posix emulation) is the major problem, I'm *well* aware of a good
number of pitfalls in *all* the gnu toolchain tools including make,
gas, gcc, and ld which make porting them to capability systems a
nightmare. The llvm tools are a bit better than the gnu ones, since at
least they were designed to be used as a library, and generally has
mechanisms in place where you can pass a filename as a string, along
with a file descriptor. The ability to compile c to webassembly is
another boon to freestanding bootstrap environments.
>>
>> I can't imagine the python interpreter running natively on a
>> capability system, allowing the kernel interface generator to run on
>> the target system.
>
>
> Why? The first languages I'll be porting are the ones I want to use interactively. So while Monte, Idris, Pony and a scheme might beat out Python, I don't think it's far behind. I feel a lot more comfortable porting Python than I do GHC or GraalVM, valuable as they might be. I guess I'd better port a WASM runtime, too.
>
As to why, there are a few reasons, i'll try and make a list
#1 I can't imagine python being successfully ported without posix emulation
Python's entire module system to me feels like it is reliant on
ambient authority and finding source files by filename "__init__.py" I
just can't imagine a port of it being successful without posix
emulation.
It just feels like it's accrued to much posix nonsense, since it's
predecessor/inspiration abc actually ran on the amoeba capability
system.
#2 If we're developing and cross-building on posix systems, tools we
write to make our lives easier as developers will more often target
posix systems.
My general feeling has been that systems like eros, coyotos, capros,
sel4 have not benefited from the tools that developers write to make
their own lives easier.
While the end product is a capability system, the majority of the
interaction is still with legacy tools.
#3 It complicates/bloats the bootstrap environment
Python is kind of a batteries included language, it was built under
the assumption it was running on an already bootstrapped system.
That makes a minimal bootstrap environment way bigger than it needs to be.
#4 Reliance on the host system tools and their release cadence.
The spread of python versions in use is very large, some distros
release stuff that is shockingly old with 10 year release cycles,
other systems are shockingly eager to drop support for non-latest
versions. There are really only a couple of sane ways to handle it,
(such as picking one host system you like for instance guix as you say).
I view another sane way is to make the bootstrap environment as
freestanding as possible so that it can run on basically any host
system or a host system with minimal requirements.
Inverting the build process, instead of using build tools that emulate
posix when porting to capability systems. Emulating capability apis
when running on posix within the bootstrap environment.
It probably doesn't matter until you start shipping, and people have
classrooms with students, and companies with teams running your
bootstrap environment.
With them running some combination of your bootstrap code along with
the output of their own teams/students the ability to fiddle with the
bootstrap environments seems to grind to a halt.
Because they'll only want to update ubuntu LTS once every 10 years so
everything ends up stuck in the mud.
But it always seems like linux distributions are one of the two
extremes of either hard to keep up with, or glacially slow.
Freestanding environments at least have the benefit of changing at
their own pace, so the host systems release cadence matters much less.
You can just change utilities within the build tree as they improve,
my hope is that some future capability systems will try to bootstrap
using this inverted capability APi method or make it a priority.
#5 It's entirely possible I'm both wrong and an idiot and python is
super easy to port, I don't know because I've avoided it primarily
because its module seems like a nightmare of ambient authority.
>> But I don't think there is anything inherent to cap'n proto that would
>> make a native port difficult though.
>>
>> I guess the other concern with forking is probably not large enough
>> change to worry about keeping up with upstream cap'n proto (I don't
>> know as far as breaking changes how difficult it would be to keep up
>> with, I doubt it is a concern with this small of change, and cap'n
>> proto itself seems a pretty stable target)
>
>
> So, this project does work with upstream capnpy, which is the capnproto implementation written by Antonio Cuni to have better performance than the wrapped C++ version. I once tried to add RPC support to it, but apparently never managed to get those changes integrated. So, I picked it because it's something I already know well. I don't imagine it has a lot of users, considering it was not installable when I tried. I vendored this project and its dependencies for your convenience, and deleted the stuff I wasn't using. It's really just used to interpret the output of the capnp compiler.
>
makes sense, especially for prototyping to pick something you're
familiar with. Sorry I don't mean to take like a decade of frustration
out upon you specifically,
But that has pretty much always been my focus, making these systems
bootstrap themselves. So those inclined can abandon posix bootstrap
environments.
> --
> William ML Leslie
> Omelette Factory Safety Advisory: It has been 0 days without a broken egg.
>
> --
> You received this message because you are subscribed to the Google Groups "cap-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
cap-talk+u...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/cap-talk/CAHgd1hFV-e2xva081nW86NZ3a_RpnivEh3k1VQqtzHVw0j2xcQ%40mail.gmail.com.