Git Product home page Git Product logo

lua.go's Introduction

#Lua.go

特性

  1. 完美支持Lua原生所有特性(当前lua版本5.4.3)

  2. 打通Lua-Go之间的调用,通过反射支持导出Go struct给Lua无缝调用

    · 支持直接访问 Go struct 的字段

    · 支持直接调用 Go struct 的函数

  3. 内建 protobuf/msgpack/cjson/serialize 4种序列化库(需调用OpenLibsExt())

非常 重要

  1. goroutine并发, 需额外加锁!!

关于性能

以我的iMac为例

Go内部调用无敌 45亿次/秒

Lua调用内部函数是最快的 260w次/秒

Lua调用Go导出的全局函数 60w次/秒

Lua调用Go导出的struct 15w次/秒

示例

L := lua.NewState(nil)
L.OpenLibs()
L.OpenLibsExt()
if err := L.DoFile("examples/test.lua"); err != nil {
    log.Println(err)
}
L.WaitClose()

lua.go's People

Contributors

dgheroin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.