Replies: 2 comments
-
|
register-based VM? leddoo - are stack based vms really slower? Rust Foundation - Rain: "Cancelling Async Rust" | RustConf 2025 TigerBeetle - Building a Distributed Protocol by Dominik Tornow or just use raw java vm idk |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
if the game shuts down part way and then sfm updates and the intermediate representation of the program changes that will suck |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal:
My understanding is that Rust turns async functions into state machines where each resume point becomes a part of the program
gets turned into
Right now, SFM builds an AST and executes it.
If we instead created a SFM virtual machine, it would be easier to distribute the execution of a program over multiple ticks.
This would make
sleepand a line-by-line debugger easier to implement.Cancellation safety / what happens if the chunk is unloaded before the program finishes?
if there is a reload between 2 and 3, we would need to store the tracker information that tells us how much src has moved already.
Additionally, if 3 is the next statement to be executed, the program would have to reconstruct the input statement which is a memory of limited input slots, not itemstacks themselves.
If the "src" chest has slot 0 changed from 64x stick to 64x stone, when executing 3 after a reload it would complete the actions using the same slots and stuff.
Considering that we care about performance, having the option to pick either execution method and A/B test for speed would be nice.
Direct AST execution may be faster than calling
program.tick() until returns doneIf we have the SFM-VM break up complex operations into a simple instruction set, we could have a max instructions-executed-without-yielding config to prevent abuse of SFM to consume server resources.
Stack based VM?
Beta Was this translation helpful? Give feedback.
All reactions