logoalt Hacker News

MarceColl • today at 11:02 AM • 0 replies • view on HN

I did build something very similar[1] a few months ago.

For me the core idea was that I wanted two things:

* Simple persistence by default, not bolted on (files, sqlite, postgres). Each actor is an Elm-like init/update/view set of functions and a storage type. That storage type is saved after every update and can be offloaded to disk while the app doesn't receive new messages. So building durable state is very simple (there are some mechanisms for ephemeral state as well).

* Actor based capabilities, an actor has access to other actors that provide capabilities. Because actors can also be created ad-hoc with custom code (the language is a lisp-like language) you can narrow down capabilities as much as you'd like. For example if you have access to make arbitrary HTTP requests, you can create an ad-hoc actor that delegates making HTTP requests only to a certain domain and pass it. A capability is just the address of another actor.

With these two primitives (+ a content-addressable store underneath) a very capable and interesting system emerged IMO. You can have thousands and even millions of applications running, they hibernate automatically and only consume CPU when they receive a message. Clicks, typing, etc is all events on applications that receive it.

Most OS stuff can be hidden behind special actors, and you can give capabilities by providing those addresses.

THere's a pic and some more explanations at BlueSky[2]

[1] https://tangled.org/dzi-ban.bsky.social/KokoroOS/tree/master [2] https://bsky.app/profile/dzi-ban.bsky.social/post/3murg4lhmt...