nwhitehead / vida Goto Github PK
View Code? Open in Web Editor NEWInclude C code right in your Lua code
License: MIT License
Include C code right in your Lua code
License: MIT License
Running on LuaJIT I had this problem:
$ luarocks install vida Installing https://luarocks.org/vida-v1-8.src.rock... Using https://luarocks.org/vida-v1-8.src.rock... switching to 'build' mode Updating manifest for /usr/local/lib/luarocks/rocks vida v1-8 is now built and installed in /usr/local (license: MIT ) $ cat > vida-example.lua local vida = require('vida') local fast = vida.compile( vida.interface [[ // C interface int func(int, int); ]], vida.code [[ // C implementation EXPORT int func(int a, int b) { return a + b; } ]]) print(fast.func(3, 5)) -- prints out 8 $ luajit vida-example.lua luajit: /usr/local/share/lua/5.1/vida.lua:197: module 'inspect' not found: no field package.preload['inspect'] no file './inspect.lua' no file '/usr/local/share/luajit-2.1.0-alpha/inspect.lua' no file '/usr/local/share/lua/5.1/inspect.lua' no file '/usr/local/share/lua/5.1/inspect/init.lua' no file './inspect.so' no file '/usr/local/lib/lua/5.1/inspect.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' /usr/local/share/lua/5.1/vida.lua:197: in function [C]: in function 'require' vida:1: in main chunk [C]: at 0x10006284
I solved it with:
$ luarocks install inspect Installing https://luarocks.org/inspect-3.0-1.rockspec... Using https://luarocks.org/inspect-3.0-1.rockspec... switching to 'build' mode Updating manifest for /usr/local/lib/luarocks/rocks inspect 3.0-1 is now built and installed in /usr/local (license: MIT ) $ luajit vida-example.lua 8
Therefore I'd add inspect
as a dependency.
System Info: luarocks also running LuaJIT on PPC64le machine (POWER8)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.