Re:MiniVM: A zero-dependency cross-language runtime on par w...
by 4984 on Saturday January 08, 2022 @08:42AM
(#29851596)
MiniVM uses coroutines already, every 1000 branches the vm will return to the scheduler. The Build system can accept CFLAGS+=-DVM_BRANCH_DEFER which makes MiniVM able to run part of bytecode up-to N instructions.
It is not exposed on the insruction level yet tho. Would be quite easy to add.
Re:MiniVM: A zero-dependency cross-language runtime on par w...
by samatman on Saturday January 08, 2022 @09:30AM
(#29851960)
Ah thank you, that's very promising! It was the kind of thing I wanted to hear, I write Lua every day and four data types didn't appear to support 'thread'.
I might just kick the tires on this over the weekend.
Re:MiniVM: A zero-dependency cross-language runtime on par w...
by rgrmrts on Saturday January 08, 2022 @10:16AM
(#29852412)
That’s cool. Have you played around with that number? I’m curious how you pick that constant and what the trade offs are
Re:MiniVM: A zero-dependency cross-language runtime on par w...
by exikyut on Saturday January 08, 2022 @11:59AM
(#29853517)
It might be interesting to be able to tell the VM to resume into code for exactly N instructions or branches. I can see instrumentation/debugging tooling using this with N=1 for example.
I like the philosophy and gumption shown by this project but coroutines aren't a feature I'd lightly give up.
Digging what I see so far!