[Mod] Lua Computers [datamine]

Byakuren
Member
 
Posts: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

[Mod] Lua Computers [datamine]

by Byakuren » Sun Nov 13, 2016 10:18

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.
Last edited by Byakuren on Sun Nov 13, 2016 21:38, edited 1 time in total.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
DS-minetest
Member
 
Posts: 1022
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Lua Computers [datamine]

by DS-minetest » Sun Nov 13, 2016 19:17

sound interesting
screenshots?
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

Byakuren
Member
 
Posts: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Lua Computers [datamine]

by Byakuren » Sun Nov 13, 2016 21:37

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.
Attachments
screenshot_20161113_132946.png
(228.25 KiB) Not downloaded yet
Every time a mod API is left undocumented, a koala dies.
 

User avatar
Wuzzy
Member
 
Posts: 3241
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Lua Computers [datamine]

by Wuzzy » Mon Nov 14, 2016 01:03

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 …
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
bigfoot
Member
 
Posts: 203
Joined: Fri Sep 02, 2016 23:31
Location: Somewhere between polar bears and penguins.
GitHub: bigfoot547
IRC: bigfoot547 or bigfoot
In-game: bigfoot547 or bigfoot

Re: [Mod] Lua Computers [datamine]

by bigfoot » Thu Nov 17, 2016 20:38

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.
God's not dead, He's surely alive!
My Stuff | My User Page | Check out my website!
<bigfoot547> I major in existing. | <RedPanda246> Not every day is good, but there is good in every day.
Stay elusive ⓐⓝⓓ ⓣⓐⓛⓚ ⓘⓝ ⓒⓘⓡⓒⓛⓔⓢ!
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests