[Tarantool-patches] [PATCH 2.X 4/7] module api: luaL_register_module & luaL_register_type

Timur Safin tsafin at tarantool.org
Fri Oct 2 19:14:19 MSK 2020


: From: Igor Munkin <imun at tarantool.org>
: Subject: Re: [Tarantool-patches] [PATCH 2.X 4/7] module api:
: luaL_register_module & luaL_register_type
: 
: Vlad,
: 
: I glanced the patch and doubt these functions need to be exported by
: Tarantool. These functions neither wrap internals nor provide any
: performance benefits (e.g. reduce numbers of excess allocations). It
: would be nice to have such auxiliary interfaces in so called "modulekit"
: to make third party modules development easier, but I see no problem to
: borrow this code to merger/key_def as is for now.

Ok, let me put it another way:
- we are agreed that this is necessary useful functionality which might 
  be part of some static library, as part of modulekit?
- we are not ok to put those symbols to Tarantool, and use Tarantool 
  executable(s) for linking against those symbols, because it's looking
  too much intimate.

- I'd hardly imagine situation that for such modulekit code reuse we 
  would prefer to introduce yet another repository, compile it as static
  library and then add to the linking dependencies of an external module?
  (or do we?)
- as for me it's still looking part of module api (some headers, and some 
  Helpers in library), and I'd prefer to simply export them from executable...

But.. if we prefer "modulekit" then yes, I'd copy-paste this code to 
my module and to the GitHub template for Tarantool c modules (yet to be 
created). Looks redundant, but will save a couple of external symbols.

Regards,
Timur

: 
: On 29.09.20, Vladislav Shpilevoy wrote:
: > Thanks for the patch!
: >
: > See 2 comments below.
: >
: > On 24.09.2020 19:00, Timur Safin wrote:
: > > Exporting `luaL_register_module` & `luaL_register_type`
: > > functions as they needed for external merger
: > >
: > > diff --git a/src/lua/utils.h b/src/lua/utils.h
: > > index 7639cd64a..9b1fe7e57 100644
: > > --- a/src/lua/utils.h
: > > +++ b/src/lua/utils.h
: > > @@ -78,6 +78,8 @@ luaL_pushuuid(struct lua_State *L);
: > >
: > >  /** \cond public */
: > >
: > > +struct luaL_Reg;
: >
: > 1. It does not seem to be public. How are users supposed to work with
: that?
: > Igor, could you please take a look at this?
: 
: It's public[1] and is provided by <lauxlib.h> Lua standard header as
: Sasha already mentioned it in the thread.
: 
: >
: 
: <snipped>
: 
: [1]: https://www.lua.org/manual/5.1/manual.html#luaL_Reg
: 
: --
: Best regards,
: IM



More information about the Tarantool-patches mailing list