# fengari 🐺 φεγγάρι - A Lua VM written in JS ES6 targeting the browser ## So far - [x] Parse bytecode - [x] Opcodes - [ ] Basic types representation: - [x] nil - [x] boolean - [x] table - [x] function - [ ] string (8-bit clean) - [ ] number (32-bit ?) - [ ] integer - [ ] float - [ ] userdata - [ ] thread - [ ] Tag Methods - [x] ... - [ ] `__tostring` - [ ] `__pairs` - [ ] C API - [x] lua_atpanic - [x] lua_newstate - [x] lua_pushnil - [ ] lua_absindex - [ ] lua_arith - [ ] lua_call - [ ] lua_callk - [ ] lua_checkstack - [ ] lua_close - [ ] lua_compare - [ ] lua_concat - [ ] lua_copy - [ ] lua_createtable - [ ] lua_dump - [ ] lua_error - [x] lua_gc (unvailable) - [x] lua_getallocf (unvailable) - [x] lua_getextraspace (unvailable) - [ ] lua_getfield - [ ] lua_getglobal - [ ] lua_gethook - [ ] lua_gethookcount - [ ] lua_gethookmask - [ ] lua_geti - [ ] lua_getinfo - [ ] lua_getlocal - [ ] lua_getmetatable - [ ] lua_getstack - [ ] lua_gettable - [ ] lua_gettop - [ ] lua_getupvalue - [ ] lua_getuservalue - [ ] lua_insert - [ ] lua_isboolean - [ ] lua_iscfunction - [ ] lua_isfunction - [ ] lua_isinteger - [ ] lua_islightuserdata - [ ] lua_isnil - [ ] lua_isnone - [ ] lua_isnoneornil - [ ] lua_isnumber - [ ] lua_isstring - [ ] lua_istable - [ ] lua_isthread - [ ] lua_isuserdata - [ ] lua_isyieldable - [ ] lua_len - [ ] lua_load - [ ] lua_newtable - [ ] lua_newthread - [ ] lua_newuserdata - [ ] lua_next - [ ] lua_numbertointeger - [ ] lua_pcall - [ ] lua_pcallk - [ ] lua_pop - [ ] lua_pushboolean - [ ] lua_pushcclosure - [ ] lua_pushcfunction - [ ] lua_pushfstring - [ ] lua_pushglobaltable - [ ] lua_pushinteger - [ ] lua_pushlightuserdata - [ ] lua_pushliteral - [ ] lua_pushlstring - [ ] lua_pushnumber - [ ] lua_pushstring - [ ] lua_pushthread - [ ] lua_pushvalue - [ ] lua_pushvfstring - [ ] lua_rawequal - [ ] lua_rawget - [ ] lua_rawgeti - [ ] lua_rawgetp - [ ] lua_rawlen - [ ] lua_rawset - [ ] lua_rawseti - [ ] lua_rawsetp - [ ] lua_register - [ ] lua_remove - [ ] lua_replace - [ ] lua_resume - [ ] lua_rotate - [ ] lua_setallocf - [ ] lua_setfield - [ ] lua_setglobal - [ ] lua_sethook - [ ] lua_seti - [ ] lua_setlocal - [ ] lua_setmetatable - [ ] lua_settable - [ ] lua_settop - [ ] lua_setupvalue - [ ] lua_setuservalue - [ ] lua_status - [ ] lua_stringtonumber - [ ] lua_toboolean - [ ] lua_tocfunction - [ ] lua_tointeger - [ ] lua_tointegerx - [ ] lua_tolstring - [ ] lua_tonumber - [ ] lua_tonumberx - [ ] lua_topointer - [ ] lua_tostring - [ ] lua_tothread - [ ] lua_touserdata - [ ] lua_type - [ ] lua_typename - [ ] lua_upvalueid - [ ] lua_upvalueindex - [ ] lua_upvaluejoin - [ ] lua_version - [ ] lua_xmove - [ ] lua_yield - [ ] lua_yieldk - [ ] Auxiliary library - [x] luaL_newstate - [ ] luaL_Buffer - [ ] luaL_Reg - [ ] luaL_Stream - [ ] luaL_addchar - [ ] luaL_addlstring - [ ] luaL_addsize - [ ] luaL_addstring - [ ] luaL_addvalue - [ ] luaL_argcheck - [ ] luaL_argerror - [ ] luaL_buffinit - [ ] luaL_buffinitsize - [ ] luaL_callmeta - [ ] luaL_checkany - [ ] luaL_checkinteger - [ ] luaL_checklstring - [ ] luaL_checknumber - [ ] luaL_checkoption - [ ] luaL_checkstack - [ ] luaL_checkstring - [ ] luaL_checktype - [ ] luaL_checkudata - [ ] luaL_checkversion - [ ] luaL_dofile - [ ] luaL_dostring - [ ] luaL_error - [ ] luaL_execresult - [ ] luaL_fileresult - [ ] luaL_getmetafield - [ ] luaL_getmetatable - [ ] luaL_getsubtable - [ ] luaL_gsub - [ ] luaL_len - [ ] luaL_loadbuffer - [ ] luaL_loadbufferx - [ ] luaL_loadfile - [ ] luaL_loadfilex - [ ] luaL_loadstring - [ ] luaL_newlib - [ ] luaL_newlibtable - [ ] luaL_newmetatable - [ ] luaL_openlibs - [ ] luaL_opt - [ ] luaL_optinteger - [ ] luaL_optlstring - [ ] luaL_optnumber - [ ] luaL_optstring - [ ] luaL_prepbuffer - [ ] luaL_prepbuffsize - [ ] luaL_pushresult - [ ] luaL_pushresultsize - [ ] luaL_ref - [ ] luaL_requiref - [ ] luaL_setfuncs - [ ] luaL_setmetatable - [ ] luaL_testudata - [ ] luaL_tolstring - [ ] luaL_traceback - [ ] luaL_typename - [ ] luaL_unref - [ ] luaL_where - [ ] Standard library - [ ] Debug (errors) - [ ] DOM API binding - [ ] Parse Lua - [ ] Generate bytecode ## References - [Source code for Lua 5.3](lua.org/source/5.3/) - [Lua 5.2 Bytecode and Virtual Machine](http://files.catwell.info/misc/mirror/lua-5.2-bytecode-vm-dirk-laurie/lua52vm.html) - [Lua 5.3 Bytecode Reference](http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html) - [A No-Frills Introduction to Lua 5.1 VM Instructions](http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf)