Page 1 of 1

[Mod] Lua Computers [datamine]

PostPosted: Sun Nov 13, 2016 10:18
by Byakuren
Datamine

Github: https://github.com/raymoo/datamine

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.

Features:
  • 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.

Planned Features (More question marks = more uncertainty):
  • 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
  • Internet??
  • 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.

Building/Installing
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
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.

Re: [Mod] Lua Computers [datamine]

PostPosted: Sun Nov 13, 2016 19:17
by DS-minetest
sound interesting
screenshots?

Re: [Mod] Lua Computers [datamine]

PostPosted: Sun Nov 13, 2016 21:37
by Byakuren
DS-minetest wrote:sound interesting
screenshots?


There isn't that much to show since currently the computer has no way to run anything but the test OS (which hasn't been programmed to load user-supplied programs). But here's a screen shot of me interacting with it:
+ Spoiler

The source code for this version of the OS is at https://github.com/raymoo/datamine/blob ... 552/os.lua. It uses a few of the mentioned features, including forking processes, text input/output, and digiline support.

Re: [Mod] Lua Computers [datamine]

PostPosted: Mon Nov 14, 2016 01:03
by Wuzzy
Great!
Now let's port Linux to those Lua computers, which we then use to reimplement Minetest, in which we use this mod again to port Linux, which we use to reimplement Minetest again in which we use even more Lua computers …

Re: [Mod] Lua Computers [datamine]

PostPosted: Thu Nov 17, 2016 20:38
by bigfoot
Wuzzy wrote:Great!
Now let's port Linux to those Lua computers, which we then use to reimplement Minetest, in which we use this mod again to port Linux, which we use to reimplement Minetest again in which we use even more Lua computers …


Or, we could write "recursive" or "circular reference" in the chat :-D.