[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: C helloworld from inside Ravi
- From: Dibyendu Majumdar <mobile@...>
- Date: Tue, 20 Jun 2017 01:02:36 +0100
Hi,
Early days but have a look at this example snippet:
local testfunc = [[
struct lua_State;
extern int puts(const char *);
extern int TestFunc(struct lua_State *L);
int TestFunc(struct lua_State *L)
{
puts("hello world!\n");
return 0;
}
]]
local ctx = llvm.context()
local m = ctx:newmodule()
m:compileC(testfunc)
local f = m:getfunction("TestFunc")
local callable = f:compile()
callable()