FANDOM


  • small embed purpose programming language
  • After Lua 5.0 they use semi-register based vm.
  • luajit is jit based Lua implementation
    • It's little buggy compared to the official implementation.
  • LuaDist repository
  • luvit

DocumentEdit

luvitEdit

luvEdit

luabindEdit

LuaBridgeEdit

luajit-lang-toolkitEdit

  • Lua bytecode compiler written in lua.
  • Can be used as luajit frontend.

Co-RoutineEdit

extern "C" {
#include <lua.h>
}
#include <cstdlib>

int lua_sleep(lua_State *L) {
  printf("lua_sleep called\n");
   return lua_yield(L,0);
}

int main() {
  lua_State* L = lua_open();
  luaL_openlibs(L);
  lua_register(L, "sleep", lua_sleep);

  lua_State* cL = lua_newthread(L);
  luaL_loadfile(cL, getenv("LUA_SCRIPT"));

  while (true) {
       int status = lua_resume(cL,0);
       if (status == LUA_YIELD) {
           printf("loop yielding\n");
       } else {
           if (status != 0 && lua_isstring(L, -1)) {
               printf("isstring: %s\n", lua_tostring(L, -1));
               lua_pop(cL, 1);
           }
           break;
       }
   }
   lua_close(L);
   return EXIT_SUCCESS;
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.