Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endo daemon with rspace / rhovm storage #35

Open
dckc opened this issue Dec 21, 2022 · 8 comments
Open

endo daemon with rspace / rhovm storage #35

dckc opened this issue Dec 21, 2022 · 8 comments

Comments

@dckc
Copy link
Owner

dckc commented Dec 21, 2022

initial work on pet-named workers, storage, and values to the Endo Daemon and expose them with its CLI
endojs/endo#1413

w.r.t. storage... is it just bytes?
I wonder about rspace / rhovm integration... not all of rholang, but just the 3-opcode rhoVM

also seems related to the way I'd like to see SOLID pods evolve:

I wonder what would happen if we mixed the Agoric platform's ability to scale down to clusters and single machines with the notion of a SOLID pod. -- https://www.madmode.com/2021/next-gig-agoric.html

cc @kriskowal @jimscarver @timbl

@kriskowal
Copy link

kriskowal commented Dec 21, 2022 via email

@dckc
Copy link
Owner Author

dckc commented Dec 21, 2022

@leithaus 's Boulder 2018 talk, to wit:

cited from: my notes on RChain Devcon Boulder

which is just a couple hops from:

I'm beginning to see reflection (the R in RChain) as a possible solution to the quoting and diagonalization issues TimBL and I struggled with in the Semantic Web. -- MadMode: dreaming big at the RChain Governance Forum

@dckc
Copy link
Owner Author

dckc commented Dec 21, 2022

For Endo-as-Docker-but-JavaScript-but-actually-confined, in the first cut, I’m raking my cues from early Git. .git/refs are pet names. .git/objects is a merkelized CAS.

you can certainly do worse than .git ... fully groking merkelized stores is an achievement I have not yet unlocked, but I've been playing with bup lately, and it seems like an answer to much of my angst about storage. Plus, .git stores seem to make their way into all sorts of places like keybase, s3, etc.

@dckc
Copy link
Owner Author

dckc commented Dec 22, 2022

endo store BYTES petname is like rholang new petname in { petname!(BYTES) }, which corresponds to a rhoVM put of BYTES at some new key, and then binding petname to that key.

@dckc
Copy link
Owner Author

dckc commented Dec 22, 2022

Now how do endo spawn and endo eval relate to rhoVM? Let's see...

The rhoVM get (aka consume) instruction includes a key and a continuation. If there's a value waiting at the key, a new process is added to the process pool in which the continuation is applied to the value.

If not, the continuation goes into the store at that key, standing by...

A wrinkle: get and put (aka consume and produce) are duals: if, when we put x at k, there's already a continuation f waiting at k, that also adds a process to the pool running f(x)

In rholang, get shows up as a for comprehension: for (@petname <- key) { ...petname... }. Another wrinkle: the @petname there is a destructuring pattern. If I skip the @ there and write for (x <- key) { ... x ... }, x is bound to a quote of the value. If I want the value back, I write *x aka "evaluate x". (In rholang, the evaluate operator is applied to something closer to an AST than to the source text string. I suppose it's largely irrelevant, except that it makes for more powerful matching / destructuring in rholang.)

So endo spawn w1 seems pretty close to new w1 in { for (expr <- w1) { *expr } }.
And endo eval w1 expr seems pretty close to w1 ! (expr).

To do endo eval w1 expr --name b, we need to get the results of *expr back:

new ch in {
  for (@b <- ch) {
    w1 ! (expr, *ch)
  }
}

and refine endo spawn w1 to support that: new w1 in { for (expr, ret <- w1) { ret!(*expr) } }

Also, we should use the <<- persistent receive operator, since otherwise the for comprehension is a one-shot (goes away after firing), and endo workers are more like persistent receives:

new w1 in { for (expr, ret <<- w1) { ret!(*expr) } }

@dckc
Copy link
Owner Author

dckc commented Jan 28, 2023

hm... running in cloudflare workers?

Do the storage APIs line up?

@leithaus
Copy link

leithaus commented Jan 28, 2023 via email

@dckc
Copy link
Owner Author

dckc commented Jan 30, 2023

hm... running in cloudflare workers?

@zarutian has some related work: durableVats.mjs and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants