# 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_version - [x] lua_atpanic - [x] lua_newstate - [x] lua_pushnil - [x] lua_gettop - [x] lua_type - [x] lua_typename - [x] lua_pushboolean - [x] lua_pushinteger - [x] lua_pushnumber - [x] lua_pushlstring - [x] lua_pushstring - [x] lua_pushvalue - [x] lua_tointeger - [x] lua_tointegerx - [x] lua_tolstring - [x] lua_tonumber - [x] lua_tonumberx - [x] lua_toboolean - [x] lua_pushjsclosure (lua_pushcclosure) - [x] lua_pushjsfunction (lua_pushcfunction) - [x] lua_pop - [x] lua_load - [x] lua_call - [x] lua_callk - [x] lua_pcall - [x] lua_setglobal - [x] lua_upvalueindex - [x] lua_createtable - [x] lua_newtable - [x] lua_gettable - [x] lua_settable - [ ] lua_absindex - [ ] lua_arith - [ ] lua_checkstack - [ ] lua_close - [ ] lua_compare - [ ] lua_concat - [ ] lua_copy - [ ] 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_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_newthread - [ ] lua_newuserdata - [ ] lua_next - [ ] lua_numbertointeger - [ ] lua_pcallk - [ ] lua_pushfstring - [ ] lua_pushglobaltable - [ ] lua_pushlightuserdata - [ ] lua_pushliteral - [ ] lua_pushthread - [ ] 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_sethook - [ ] lua_seti - [ ] lua_setlocal - [ ] lua_setmetatable - [ ] lua_settop - [ ] lua_setupvalue - [ ] lua_setuservalue - [ ] lua_status - [ ] lua_stringtonumber - [ ] lua_tocfunction - [ ] lua_topointer - [ ] lua_tostring - [ ] lua_tothread - [ ] lua_touserdata - [ ] lua_upvalueid - [ ] lua_upvaluejoin - [ ] lua_xmove - [ ] lua_yield - [ ] lua_yieldk - [ ] Auxiliary library - [x] luaL_newstate - [x] luaL_typename - [ ] 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_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)