• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ds84182/LuaVM: Lua Virtual Machine (and various tools) for Lua so you can Lua wh ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ds84182/LuaVM

开源软件地址(OpenSource Url):

https://github.com/ds84182/LuaVM

开源编程语言(OpenSource Language):

Lua 100.0%

开源软件介绍(OpenSource Introduction):

LuaVM

Lua Virtual Machine for Lua so you can Lua while you Lua

Usage

To use LuaVM, first you must meet all the requirements:

  • Lua 5.1 and 5.2 are the only versions supported. Unoffical versions of Lua (like LuaJIT, LuaJ, etc.) are not fully supported.
  • A way to generate Lua 5.1 valid bytecode (an ASM suite is in the works, a Lua to bytecode compiler is coming)

Then, you must require the modules you need (sorry for the global namespace injections):

require("luavm.bytecode")
require("luavm.vm[your version here, 51 or 52]")

After that, simply call vm.lua[your version here, like 51 or 52].run(bytecode.load([bytecode here]))

Documentation

bytecode.load(bytecode)

Loads valid Lua 5.1 or 5.2 bytecode (as a string). Returns a table.

bytecode.save(bytecode)

Redumps bytecode tables created from bytecode.new or bytecode.load. Returns a string.

vm.run(bytecode, arguments, upvalues, globals, hook)

Starts running bytecode. Arguments, Upvalues, Globals, and Hooks are optional. Returns whatever the emulated bytecode returns. Arguments, upvalues, and globals must be a table. Hook must be a function, it is called every single instruction.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap