So, hello everyone, I'm Jessica Talon, internally sometimes known as the goblin in
Chantras, because I work in Goblins a lot, I sort of live and breathe it.
I work at the Sprightly Institute, and I looked at this morning, it turns out we've been
working on the Sprightly Technologies in November 2021, so a while.
You may know me from being a co-author on activity pub, so my background is in developing
and standardizing federated social technologies.
So, who is Sprightly, I'm guessing you're all aware by now, but in case you missed it,
where a research institute, where a US registered nonprofit, and we're developing the next
generation of decentralized networking technologies, the two sort of headline projects
we develop, goblins, just talks about, and whoop, which you may have heard my colleague David
Thompson speak about earlier, it's a Giles scheme to WebAssembly compiler, and we are running
a donation campaign, we're a number of it, so if you think this works important, I'm
not spotters, please go to our website and donate.
What is this talk?
Well, I really like Goblins, it turns out, and I'm going to make a really bold claim, and
say you should use it for almost anything, your next project for sure, granted, I'm biased.
So, this is our cute Goblins character, but what is Goblins?
You've heard everyone throw this word around, or maybe you haven't, I'm going to, so it's
a Gile Library, it's based on the Acta model, it's employees object capability security,
which has really well with the Acta model, and sort of one comes out of the other, it's
O'Cappen, which is our distributed peer-to-peer networking technology, it has a time travel
debugger, which is as cool as it sounds, and it has a persistent system, and a bunch
of other things.
So what is this Acta model?
Leader Veets says these spritly folks are telling you all about the Acta model, and I'm a spritly
person, I'm going to tell you all about the Acta model.
So what are Actas that the kind of objects, they're not objects in the sense of inheritance
or anything like that, but they have some data usually, some data associated with them,
and then some behavior, and they may have methods and other things like that, and they tend
to communicate with each other by sending messages to one another, and in Goblins, these
messages tend to result in promises, that isn't necessarily a feature of the Acta model,
and I'm about to come on to this, we technically don't actually implement the Acta model,
we implement the VAT model, which is very heavily based on the Acta model, just with some
interesting other things associated with it, so what's this VAT thing I'm referring to?
VAT is essentially an event loop, and it's a message key.
So when you message an actor, you know, actually messaging the actor directly, you are messaging
the VAT at Livson, and it's going to join this queue of messages, and then the VAT is going
to process one message at a time, and dispatch it to the actor, and actors are spawned
within a particular VAT, spawning as the Goblins work for creating a new actor, and that's
also transaction, so if an error happens, when it's processing a message, it will not apply the
transaction. So what did these actors look like? I hope everyone can see it, I think this theme
isn't great, now I've seen it in screen, but actors are essentially, well we've got this
greeter actor here, and you can see it's got this sort of carrot, this hard-hacked character at
the beginning, that's Goblins Convention for it's the constructor, so it's the greeter constructor.
It has this become argument that Julie mentioned, and I'm going to mention in a little bit,
I'm going to ignore it for now, because this actor doesn't use it, and it takes a name,
then it returns, it doesn't do anything else in the constructor, it could, and then it returns
some behavior, which is, it will, when in VAT it will, with a name it will greet that person,
hello, Bob, my name is Alice, that kind of thing, and that's basically what an actor is,
and so how do you use these things, as I said, you can spawn them, and in this case we're
spawning Alice, and if you use this arrow it sends a message to Alice, and in this case you're
passing Bob in, so that will be their name, and you're getting this promised thing back,
but this is this dollar thing, that is an immediate invoke of the actor,
it's synchronous, and so it can only be used when you're in the same VAT as the actor,
but in this case you are, so you can see we just get this string, but you'd expect.
So this promised thing, how do you use it? You have this function called on, and in this case
we're, you know, we're creating a promise, and you can register a sort of call back like thing,
and in this case, PK, if you didn't know, is basically something to the screen,
and so it will print the greeting. Our actor won't ever really, it doesn't do much,
but if you, if you did want to handle that, you can catch errors like that. That's not the
only way to handle promises, there are mistakes in this code, I wish it fixed before coming
either way, it's the just you need to get. So in this case was wanting a builder,
and then you're sending a message to that builder, hey, build me a car factory, that's
bit contrived, and you know, that takes a bit of time, but you don't have to wait until it's built,
you can then just be like, make me a car, and then you don't even have to wait for the car,
all the factory to exist, you can also just say, hey I want to drive the car, and what's happening
here is called promised pipelining, you just send messages to a promise, and you can use it as if
it is the value, and eventually it should resolve, if an error happens, it will be passed back
up the chain, so you could catch the error when you're driving. And so this become the argument,
Julie mentioned it in her talk, what is it? How does it work? So this is the sale actor, it's basically
a box, you can put something in it, you can look up what's in the box, you can change the item in
the box, it's a sale, and it's based on, if you call it in their arguments, it will show you the
value, if you pass in a value, it will change to that new value, but we're not doing any sets or anything,
we're using this become thing, and you can notice that we are actually calling the constructor again,
passing in that become we had, and passing in the new value, and this is telling Goblins,
be this new value, and this is important because we don't want to mutate the actor for reasons
I'm going to get into, actually I should have gotten into them then, basically you want to be
able to go back in time and use this transactionality, and this is a neat game called terminal
face that my colleague Christine built, and this is this time travel in a really interesting way,
and actually exposes it to the user, and so you're going along, and you can see you can zoom back
in time, so when you die to these S-squigler things, you can just zoom and do that, and that's great.
We also have a debugger, a little bit also spoke about debugging these things, it can be tricky,
and so we have this debugger over here, I'm going to be very quick, you can stay in the editor,
it's built on top of the editor, you can get trees of events, you can travel back in time,
so again it's built on that, and it will even give you some diagrams, so here's a tree, several
vats, lots of messages, I'm not going to focus on that, it's just nice to be able to see this thing,
you can jump to a particular point in time and interrogate those actors at that time, it's not
the current buffer list here where you're asking it's HP, it's the buffer list at the point in time
from this list of events, so you can really play with your actors, and you can make diagrams,
so these are three vats, let's just between them, and it makes it really easy to see what's going on,
and start debugging things and makes sense if you're your code, oh, Captain, that's our distributed
network component, and this allows you to have actors live on different machines,
and it's transport mechanism agnostic, so we implement what we call net layers, there is the
torn net layer, live PTP, TCPTLS, and now web sockets, and that allows you to very easily
have your programs run over a different transport mechanisms, it includes third party handoffs
and distributed a cyclic garbage collection, and we're currently standardizing it,
I'm not going to focus too much on this code, but basically this is all the code you need to set up
our captain, and this is all the code you need to connect over our captain, and interestingly,
this is using the salad before, but if you wrote a huge program like a virtual world with lots
of actors and lots of players, it's still this amount of code, it doesn't really grow.
What are these handoffs? I'm not going to go through this too much, that would actually take
more than the whole map I've been a lot here, but basically if you have three machines and your
Alicia has a reference to Carol and Ben, and you want to share Carol with Ben, but you can see
the machine B and C here don't have a connection, handoffs will securely allow this to happen,
so you don't have to think about it, goblins it's care of it, and quite frankly you shouldn't
need to ever understand this diagram, that should be, so think only I and other O-CAPM implementers need
to focus on. It has this persistence thing, and this is a Q or E character, it should be easy to use
and automatic in most cases, it should persist, act of reference, not just your strings and
integers and things like that, and it should be stored in a storage diagnostics, so you shouldn't
be tied to SQLite databases or files on your files system, and it's designed to be really easy to
implement new ones, so we don't have a couple at the moment, we'll expand in time, but it should be
easy for you to write whatever storage thing you need, and upgrading actors, it turns out persistence
is a great time to do that. So if you were to remember the cell from before, what needs to change
for this to be persistable, you want to look at this defined here, that you change it to define
suddenly the cell can be persisted, and what do I mean by that? It's safe to disc, and you can
wake it back up, and it will look and behave the same, it will be the same actor, even after
a full process restar, and this will work for huge graphs of objects. This is how we go great,
I'm not going to walk through it, basically, so if I missed out, it started off with temperature
and Fahrenheit, I realized my mistake, Celsius is great, and so it's converting it to Celsius,
actors are always tagged with version zero if you don't say something, and then if you're
not great, you can say, hey, this is actually version one, and I'm going to do some kind of
logic there, to change it, and then spawn the final thing. Goblins works on the web, this is actually
Firefox here, and I'm going to skip that. This is Firefox, and this is actually Goblins working
in this Goblin Chat, and it's actually using Ocapen even in the browser, and you can see
you can chat to another, and so you can write your Goblins applications and bring them to the
browser, you don't have to write JavaScript or anything like that, it just works, thank you Dave,
Andrew Lee and Andy, and everyone that's worked on who, it's really easy to use, so I'm still in the
textbooks, I'm done, questions, yes, I actually have one, is the scope of this time traveling
back in time is a single version basically, right? So you can travel, repeat the question, sorry,
is a time travel limited to a single VAT, and no, it is not, that's the distributed part of
distributed debugging, you can jump between VATs, and actually my example I skipped over did that.
It doesn't work over a capping yet, we're thinking about it, it will, hopefully.
Because I've always used full of these stuff, because if you like stuff to distribute out,
the concept of global time and global ordering is going to break down, it's a big topic,
yeah, captures in the corridor will happily chat to you about that, yes?
No, yeah, sorry, I should repeat, after persisting to disk and reawakening do you have the option
to time travel the book? No, you don't, we're hoping to bring some diagnostics you can do,
after you shut your program down, there's a lot of the debugging stuff we could do,
did you want to add some of interesting? Except sort of yes, because you should be able to,
we have in the designs that you're able to save generations, so you could restore previous generation.
Yes, yes, let's true.
So do I know about what can you, that is doing with Sparkle's work?
I actually am not that familiar with Ganyu now, are you Christine?
If somebody could try to make a Ganyu net net layer if they wanted to,
and that's all we have time to talk about in this topic.