Add a way to store state between brush executions #76

Open
opened 2024-09-01 22:38:31 +02:00 by liquidev · 0 comments
liquidev commented 2024-09-01 22:38:31 +02:00 (Migrated from github.com)

Currently there's no way to remember something between executions of your brush. There should be a function that can initialize, store, and modify state. Something like

withState
  init : \() -> T
  draw : \T -> [scribble, T]
  • init gets called to initialize a state value T, which is remembered across invocations
  • draw returns a list with a scribble to be drawn, along with an updated T

Unsolved problems:

  • We don't have a GC. We're probably gonna need some way of snapshotting values and then restoring them in a VM execution later on, after ref slots and memory usage has been cleared.
Currently there's no way to remember something between executions of your brush. There should be a function that can initialize, store, and modify state. Something like ``` withState init : \() -> T draw : \T -> [scribble, T] ``` - `init` gets called to initialize a state value `T`, which is remembered across invocations - `draw` returns a list with a scribble to be drawn, along with an updated `T` Unsolved problems: - We don't have a GC. We're probably gonna need some way of snapshotting values and then restoring them in a VM execution later on, after ref slots and memory usage has been cleared.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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: liquidex/rkgk#76
No description provided.