This is a mod implementing computers that behave like real computers, maintaining their execution state. You do not need to save your values in a memory table or manually yield anywhere. For an example of what kind of code you can safely (hopefully) run in the computer, take a look at https://github.com/raymoo/datamine/blob/master/os.lua.
- Digilines support
- Preemptive scheduling - Doesn't hang the server over "while true do end".
- Concurrency - The computers support running multiple processes and scheduling between them.
- Text IO - Computers come with a line input and a console screen.
- Sandboxing - Programs executing in the computer (hopefully) do not have access to the mod environment. Memory use is also limited.
- Restart button - In case your computer is stuck.
- Boot drive - So you have something to run.
- A hard disk device of some kind
- Synchronization stuff
- Cloud computing??????? - Disembodied computer instances that aren't tied to a physical node, and which share execution shares with the instances of other players.
- More things in the programs' global environment.
There is no release yet. The mod uses a custom C module, so requires special building instructions (check the README on Github). Once you have built the module, you can use it like any other mod.
Use "/giveme datamine:computer" to give yourself a computer, and place it in the world somewhere. If you right-click it, you will see that it has booted up. Computers will shut down automatically and forcefully when they are unloaded, but they can be turned back on with the input button.
Currently, the computer runs a simple OS that only supports echoing the user's input back.