[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Let's make Lua mobile!
- From: Stefan Reich <stefan.reich.maker.of.eye@...>
- Date: Wed, 26 Oct 2011 14:32:37 +0000
Hi fellas. -
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
nothing more than a simple migration.
As always, I encourage collaboration from 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.
== The first step
As a first step, I say we should make a mobile script framework that
is as simple as possible—while getting the job done.
I have created an initial version of such a framework, you can
download it here:
http://luaos.net/download/download.php?file=mobilelua01.zip
Please discuss, improve and/or come up with a better framework yourself!
Also, if there is any previous work towards Lua and migrating threads,
I'll love to hear about it. (I'll freely admit I haven't found any so
far.)
The project on the web: http://luaos.net/pages/mobile-lua.php
Cheers, - Stefan
PS: Here's the header of mobile.lua:
-- mobile.lua
-- A minimal runner for mobile Lua 5.1 scripts
-- by Stefan Reich (info@luaos.net), Oct 26, 2011
--
-- Status
-- ------
--
-- Sandboxing: Currently runs scripts in sandbox with only "print" available
-- Persistence: Uses Pluto.
-- Developed on: Lua OS (Linux)
-- Should work on: Any platform.
-- Inter-platform script mobility: Unclear.
-- Safety:
-- Untrusted non-frozen scripts should be fine (b/c of sandboxing).
-- Untrusted frozen scripts should not be run.
-- (No protection against bad bytecode or malformed Pluto images)
-- Known deficiencies:
-- Global variables do not seem to survive freezing (see vars.mlua).
-- We're currently figuring out why that is.
--
-- Usage
-- -----
--
-- lua mobile.lua x.mlua (produces x.mlua.frozen)
-- Now you can send x.mlua.frozen to another machine. There, run:
-- lua mobile.lua x.mlua.frozen
--
-- Ideas for improvement
-- ---------------------
--
-- Add bytecode verification.
-- Check Pluto images for correctness.
-- Add inter-platform mobility.
-- Extend sandbox.