fengari icon indicating copy to clipboard operation
fengari copied to clipboard

Loading an external C lib into the fengari initialization

Open Orfen-0 opened this issue 4 years ago • 3 comments

Hello, I'm trying to make lua_cmsgpack.c be available for lua operations through fengari. I was wondering if you could provide any pointers on how to achieve this as I'm not very familiar with lua & C. Basically some external lua operations that run through fengari that I depend on have as a prerequisite on the above library and I'm having trouble figuring out on how to add this.

Thank you

Orfen-0 avatar Mar 22 '21 23:03 Orfen-0

fengari can't magically convert C code to work in the browser.

You'd be better off finding a msgpack library written in either pure Lua or Javascript.

daurnimator avatar Mar 23 '21 04:03 daurnimator

Try https://fperrad.frama.io/lua-MessagePack/, it is by far the best maintained msgpack library for Lua and last time I check it worked in Fengari.

catwell avatar Mar 23 '21 13:03 catwell

Thank you both for the answers. How would I go to making this usable to lua functions outside of fengari to be interpreted correctly when the functions pass through fengari?

Orfen-0 avatar Mar 24 '21 02:03 Orfen-0