You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how does lua call erlang? for example, lua want to send socket throuth erlang, or tell other node some info by erlang, how to do this? i don't know how to do it.
The text was updated successfully, but these errors were encountered:
You cannot directly call Erlang from the Lua inside luerl. To do this you need to define an interface module written in Erlang with functions you can call from Lua. There is a predefined way of building and loading such a module so it can be reached from Lua through a table like any other Lua function. There is also a predefined way of passing data in and out of these functions. If you look in the src directory all the modules luerl_lib_XXXX.erl are interface modules like this. If you check in the module luerl_emul.erl in the function load_lib/3 you can see how it is installed.
None of this is secret in any way but it just hasn't been documented.
One reason for having it this way is that it makes sandboxing very easy as Lua code cannot do this loading, it has to be done in the surrounding Erlang. Which makes it trivial to set up a limited environment.
how does lua call erlang? for example, lua want to send socket throuth erlang, or tell other node some info by erlang, how to do this? i don't know how to do it.
The text was updated successfully, but these errors were encountered: