I'm Luvin It
Introduction to Luvit and Virgo project
Tomaz Muraus
[email protected]
FOSDEM 2013, Brussels, Belgium
Introduction to Luvit and Virgo project
Tomaz Muraus
[email protected]
FOSDEM 2013, Brussels, Belgium
local http = require('http')
http.createServer(function (req, res)
local body = 'Hello FOSDEM\n'
res:writeHead(200, {
['Content-Type'] = 'text/plain',
['Content-Length'] = #body
})
res:finish(body)
end):listen(8080)
print('Server listening at http://localhost:8080/')
#include
#include
#include
#include
int main()
{
lua_State *L = luaL_newstate();
if (luaL_dostring(L, "function foo (x,y) return x+y end")) exit(1);
lua_getglobal(L, "foo");
lua_pushinteger(L, 5);
lua_pushinteger(L, 3);
lua_call(L, 2, 1);
printf("Result: %d\n", lua_tointeger(L, -1));
lua_close(L);
return 0;
}
{
"v": "1",
"id": 0,
"source": "agentA",
"target": "endpoint",
"method": "heartbeat.post",
"params": {
"timestamp": 1325645515246
}
}
{
"v": "1",
"id": 1,
"source": "endpoint",
"target": "agentA",
"result": {
"timestamp": 1325645515246
}
}