print "I'm here..."
print "...and now I'm here!"
by Stefan Reich, Nov 3rd 2012. >> [quick download link, version 6.6]
Let's make Lua scripts mobile!
What do I mean by mobile? I am not referring to mobile devices (not specifically anyway). Rather, the idea is that a script is frozen on one machine, sent through the network and then unfrozen and continued on another machine.
This process is usually called "migration". (See also: "Migrating threads".)
The applications for this ability are numerous and very interesting. For example, you could turn the installation process for a script into little more than a simple migration.
As always, I encourage collaboration from each and all motivated Luaistas out there. I want to see some Mobile Lua scripts!
Another note: This project is related to Lua OS in spirit - and an important precursor to Lua OS Next-Gen - but it doesn't build on or require any part of Lua OS. This is just plain Lua on any standard OS.
We have set up two public computation servers to showcase the Mobile Lua concept! (You can also run your own server if you download the Mobile Lua sources.)
Then just add email@example.com to your contact list (btw, just to make sure: lua1@... is not a mail address, even though it looks like one).
Open a chat with firstname.lastname@example.org. Type help to see the available commands. You can basically execute any Lua code—within the boundaries of the Mobile Lua sandbox (it gives you a subset of the Lua libraries) and some time/memory constraints that we impose for now.
To see how script mobility works, type example 1. You will receive a PID (process ID). Type run <pid> to run the example. If you want to see the source code, type source <pid>.
You can enter step env() to see the contents of the sandbox.
Or how about this? step for i=90,99 do print(i,'bottles of beer') end
A lot of future improvements are planned. For larger scripts, we will want to support file upload and download. You can already run multi-line scripts btw (just paste them into your chat client with 'step' in front of it, it should work).
We will of course also develop automated clients that talk to the server for you.
The second Lua server, incidentally, has the address email@example.com.
- Distributed computing, with seamless, automatic distribution. Scripts just travel between machines and settle wherever they find that enough computing power is available. They could also split themselves into two or more copies (parts) automatically, each computing his thing and all parts joining again in the end.
- Automatic backup. Each script running on a machine forks itself, and all the copies travel to a backup server.
- Installation. A script on a server forks and the copy travels to user's machine.
- Trouble-shooting. A faulty script moves or copies itself to the developer's machine to be tested/fixed.
- Data transfer. Instead of sending a "dumb" file, send a script. Then communicate (negotiate if you will) with the script to query meta information and extract the contents in a way suitable to your needs.
(Enough to get you motivated already? :))
For the status of the framework and quick instructions, please see the README file.
For discussion, write to firstname.lastname@example.org or use the Lua-OS-List. (We DON'T recommend Lua-L - the old "official" Lua list. It has turned into a place where competition and innovation do not seem welcome.)
- Done (Nov 3 2011): Release Mobile Lua v02 (engine core)
- Done (Nov 4 2011): Announce public computation server
- Done (Nov 6 2011): Release Mobile Lua v03 (source to computation server)
- Done (Nov 10 2011): Release Mobile Lua 4 (persistent processes & script hosting)
- Done (Nov 16 2011): Release Mobile Lua 5 (mobility and auto-running)
- Done (Sep 17 2012): Put computation servers back online
- Done (Oct 9 2012): Release Mobile Lua 6 (script input)
- Done (Oct 13 2012): Release Mobile Lua 6.1 (forking, shell access)
- Done (Oct 17 2012): Release Mobile Lua 6.2 (custom shells in M-Lua)
- Done (Oct 19 2012): Release Mobile Lua 6.3 (fast mode, process comments)
- Done (Oct 23 2012): Release Mobile Lua 6.4 (better shell integration, load scripts from URLs, less verbosity)
- Done (Oct 27 2012): Release Mobile Lua 6.5 (aliases, IPC, math, pcall, temp processes, XMPP resources supported)
- ?: Make a list of people's computation servers
- ?: Make a web interface to computation server
- ?: Make clients
- ?: Extend API (allow more libraries, extend migration capabilities)