add runtime: host-driven single-threaded actor interpreter #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
piamh/chatter!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "runtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Executes parsed programs under a deterministic scheduler: FIFO mailboxes, round-robin delivery in spawn order. Load-time validation (duplicate names, unknown behaviors, arity, unbound identifiers) keeps execution nearly infallible; unmatched patterns and sends to non-address atoms are recorded as soft events per the spec.
Atom is opaque with private Value/Address variants, so addresses are unforgeable capabilities: a source literal spelling :actor_addr_0 never equals a runtime-minted address.
Host API: Runtime::load/spawn/spawn_probe/send/step/run, observed via probe actors and the event log. End-to-end tests cover the four LANGUAGE_DESIGN.md examples plus a golden event-log determinism test.
@ -0,0 +1,69 @@use std::collections::HashMap;should be called
get_behaviour/find_behaviour@ -0,0 +1,69 @@use std::collections::HashMap;should be called
get_actor/find_actor@ -0,0 +40,4 @@message_param,body,} => Ok(instantiate_inline(message_param, body)),}this is a rather large function, let's split it to submethod, maybe on for each case of the
matchclause@ -0,0 +1,207 @@use std::rc::Rc;these are 4 lines that could be one method, called
find_matching_case@ -0,0 +1,207 @@use std::rc::Rc;could be a single method called
push_unmatched_message_event@ -0,0 +1,207 @@use std::rc::Rc;this should be
execute_statement@ -0,0 +1,207 @@use std::rc::Rc;this could be
match self.find_target_address(target)@ -0,0 +1,621 @@mod actor;@ -0,0 +172,4 @@RunOutcome::Quiescent { deliveries }} else {RunOutcome::BudgetExhausted { deliveries }}this method is too long, and seems to do 2 things, execute until out of budget/quoscient, check which case and return it, extract each of those things to their own method and refactor the functions to perform those steps.
@ -0,0 +258,4 @@if let Some(next) = self.execute(id, &instance, message)? {self.actors[id.0].behavior = next;}Ok(())this method is too long and does multiple things, break it to sub functions to make it easier to understand what it does.
@ -0,0 +1,621 @@mod actor;@ -0,0 +1,621 @@mod actor;View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.