https://github.com/jason-gao/luausing
lua practice
https://github.com/jason-gao/luausing
ffi lua luajit
Last synced: 11 months ago
JSON representation
lua practice
- Host: GitHub
- URL: https://github.com/jason-gao/luausing
- Owner: jason-gao
- Created: 2019-06-18T07:17:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T08:25:43.000Z (almost 7 years ago)
- Last Synced: 2025-06-10T08:41:25.743Z (about 1 year ago)
- Topics: ffi, lua, luajit
- Language: Lua
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# env
- macos mojave 10.14.4 (18E226)
- vs code 版本 1.35.1 (1.35.1)
- vs code 默认不是自动保存,file-auto save 打开,否则 lua xx.lua 啥也不输出,别被坑哭~~
- lua version 5.3.5
- luajit 2.0.5 兼容lua5.1
# install
brew install lua
# doc
- https://moonbingbing.gitbooks.io/openresty-best-practices/lua/for.html
- https://www.kancloud.cn/thinkphp/lua-guide/43810
- https://wiki.jikexueyuan.com/project/lua/overview.html
- https://aillieo.cn/post/2018-06-24-lua-notes-02/
- https://luarocks.org/
- http://luajit.org/ext_ffi_api.html
- lua-resty开头的库是跑在nginx里的,lua-*开头的是通用的,像lua-cjson这种只要是lua就能跑
- 单独用的话要用ffi.load手动加载openssl库
- luajit自带ffi
# luaUsing
- lua demo.lua
# kong 插件开发
- https://ms2008.github.io/2018/06/19/kong-plugin-development/
# 兼容性
```lua
-- Provide unpack for Lua 5.3+ built without LUA_COMPAT_UNPACK
local unpack = unpack
if table.unpack then unpack = table.unpack end
```
- luarocks
- brew install luarocks
- luarocks install luacrypto OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2r
```text
brew upgrade openssl
If you need to have curl-openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/curl-openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find curl-openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/curl-openssl/lib"
export CPPFLAGS="-I/usr/local/opt/curl-openssl/include"
For pkg-config to find curl-openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/curl-openssl/lib/pkgconfig"
```