This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ds84182's profile picture

Lets Talk Hibernation -- In Computercraft

Started by ds84182, 11 August 2013 - 09:33 AM
ds84182 #1
Posted 11 August 2013 - 11:33 AM
I was bored last night, didn't want to sleep, so I stayed awake a lot longer without sleep just to announce this:
Hibernation is Coming.

Yes, I said it. Hibernation. The very thing that people wanted from the start is now almost here.
I got immibis's Lua in Lua sourcecode from his VERY old forum post ( http://www.computercraft.info/forums2/index.php?/topic/1868-lil-completely-pointless-lua-interpreter-written-in-lua/ ) And now I am adding features, stability improvements, and even hibernation.

I already made it so that you can never go too long without yielding, so I'm going to tackle this challenge.


I'll update the forum post as I get more code done.
ds84182 #2
Posted 11 August 2013 - 12:21 PM
OK. More updates.
Here is some beta hibernation data for a program WHILE it was executing.
http://pastebin.com/GUz6ys52
Here is the program.
http://pastebin.com/trVjv4a4

Looking through the data, I found that the program stored it's state on the 3rd line, term.clear. It's pretty hard to observe so I might have to put the info into another file.

UPDATE:
I now have file loading working. It just resumed the program :D/>
http://i.imgur.com/c47D0W7.png
nutcase84 #3
Posted 11 August 2013 - 08:47 PM
Sweet! I was thinking of making some sort of Lua in Lua emulator myself, but now I don't have to. Thanks for that link! Also, what OS is that? :blink:/>
ds84182 #4
Posted 12 August 2013 - 06:12 PM
Ubuntu with the Gnome WM.
ds84182 #5
Posted 03 September 2013 - 10:07 PM
Ok, this isn't completely abandoned, but I am moving my code from Lua In Lua to Bytecode Emulation. That way it will be more accurate, and less of a hassle to fix bugs with generation of Abstract Syntax Trees, actually interpreting the code, ect. I do have a little less than half of Lua's Virtual Machine emulated, and I'm going to say this: Lua has a very umm… robust Virtual Machine… Yeah, sarcasm.
PixelToast #6
Posted 04 September 2013 - 12:11 AM
bytecode inturpreting is waaaaaaaaaaaaaaaaaaaaaaaaay easier than normal lua
and faster