Oh, okay, you got stuck on the receiving side of things. Sure, there is a way. When a program is loaded from a file, the content of the file is passed to the standard Lua function
load (or
loadstring, depending on which version of Lua is used).
load returns a function, which then can be called and thus the program can be run.
The second argument to both
load and
loadstring is the so called
chunkname. This is what you see in an error message before the line number.
local program_string = ... -- receive the string through rednet, whatever
local program_function, load_error = load(program_string, "came-through-rednet") -- you could also send the chunkname over rednet
-- beware, program_function might be nil, which means that program_string wasn't a valid Lua source;
-- in that case load_error will hold the error message
program_function()
You could even send the arguments to the program over rednet. You'd have to pass them to
program_function.