My son took a simple "Coding with Minecraft" class at the public library. It used scriptcraft mod for minecraft. We don't have minecraft at home so I was thinking of modifying minetest to run some scriptcraft code.
(Why do this? Wouldn't it be easier to teach your son lua? Yes it probably would. It could probably build equivalent lua functions that he used very easily. Mapping minecraft block IDs would minetest values would be annoying but would need to be done if javascript is implemented. Alternatively I could modify the api to use minetest values which would be easier but even less compatible with scriptcraft. So in other words, this idea is much harder than it needs to be. Now we return to original discussion where I'm trying to do this despite it being harder.)
I found instructions for calling a C shared library very easily for lua. I tried the code in minetest and it failed. Minetest uses luajit not lua. Luajit has ffi to easily call a C function but I don't see anything to call back into luajit. Ideally I want to run C function for example which run javascript. When javascript hits box('5'), it calls back to C which calls back to luajit to place a block. Is it possible to do this in luajit?
EDIT: Found how to do it. It has the same api that lua has you just need to include/link to the luajit-devel files not lua-devel files. It also looks for the shared library in the current directory or a few other places. So I can't simply put the file in the mod directory. If the shared library is found it works.