bootstrap(3)

πŸ“¦
version 0.04 Β· 3 versions
, in epel 9

🌸 Bootstrapping the Lua API interface β€” bootstrap(3) 🌸

okay bestie, you've opened the bootstrap(3) page from the User Contributed Perl Documentation, and it's literally giving "behind the scenes of the Lua API interface" energy. πŸ’…

The file protos contains C prototypes for Lua routines which may throw errors via lua_error(). For those routines, the Perl interface code comes from templates, while every other Perl interface is hand crafted. ✨

no cap, Lua API routines which can throw errors have to be sandboxed so that the Perl runtime environment isn't corrupted. This is done by creating C wrappers designed to be invoked via Lua's protected call mechanism. If the API routine throws an error, it gets caught and translated into a Perl exception. 😭

The wrappers are generated in two steps, bestie:

  1. utils/pproto parses the C prototypes in protos and generates a YAML database containing the parsed result (protos.yml). It also adds any "hints" contained in proto_hints.yml. πŸŽ€
  2. utils/genxs reads protos.yml, wrap_xs.tpl, and xs_xs.tpl and generates wrap.h and xs.h, which are included by API.xs. wrap_xs.tpl and xs_xs.tpl are Template::Toolkit formatted code templates. xs.h contains the Perl XS interface code, and wrap.h contains the C wrappers for the Lua API routines. πŸ¦‹

At present the above scripts are invoked manually. 🫢


mwah πŸ’‹ β€” page brought to you by the bootstrap(3) manual, perl v5.32.1, dated 2022-10-14. slay. 🌈

πŸ“¦ where this page comes from