Devise new state/concurrency model #38

Closed
opened 2025-06-28 21:52:36 +00:00 by scott · 1 comment
Owner

The two bits of state that we have in prelude are turtle commands and the console. How do we want to handle these?

On the one hand, using boxes means everything works nice and simple synchronously. We want to keep that, in any event: a flat script with no spawn!s still just works.

One way to do this might be to make turtle graphics calls and print! synchronous calls to other actors.

Also, if there are actors spawned in the prelude, we'll need to use the same vm for both prelude and a script. That's fine! I just need to refactor that.

There's more to think through here, but this will be the foundation of what comes later.

A few initial thoughts:

  • console is just a list of lines, each of which is a string. We can do a straight swap of an actor for the box.
  • turtle is a little more complicated; we will actually want to be able to have multiple turtles. The JSON protocol for turtle graphics will have to be updated. That's ok!
  • One thing I will need to do is to use tokio (fuck) to do the light-duty async stuff in rust to communicate with the now-asynchronous ludus.
The two bits of state that we have in prelude are turtle commands and the console. How do we want to handle these? On the one hand, using boxes means everything works nice and simple synchronously. We want to keep that, in any event: a flat script with no `spawn!`s still just works. One way to do this might be to make turtle graphics calls and print! synchronous calls to other actors. Also, if there are actors spawned in the prelude, we'll need to use the same vm for both prelude and a script. That's fine! I just need to refactor that. There's more to think through here, but this will be the foundation of what comes later. A few initial thoughts: * `console` is just a list of lines, each of which is a string. We can do a straight swap of an actor for the box. * `turtle` is a little more complicated; we will actually want to be able to have multiple turtles. The JSON protocol for turtle graphics will have to be updated. That's ok! * One thing I will need to do is to use tokio (fuck) to do the light-duty async stuff in rust to communicate with the now-asynchronous ludus.
Author
Owner

Done, and implemented.

Done, and implemented.
scott closed this issue 2025-07-02 16:36:15 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: twc/rudus#38
No description provided.