in reply to boot_DynaLoader: what, where, how

It appears to be constructed by ExtUtils::ParseXS, and weaves in the BOOT: section from the XS file. It is rather gnarly code, but in process_file() I think the work to emit it starts around the comment "# print initialization routine" (line 930 in my copy).

Replies are listed 'Best First'.
Re^2: boot_DynaLoader: what, where, how
by cavac (Prior) on Mar 25, 2024 at 12:08 UTC

    Ah, the classic "Perl code that writes C code that turns other C code into Perl functions". :-)

    I can hardly complain that "it's too convoluted". I spent the better part of a month writing code that takes a HTML Template Toolkit file, rips out the Javascript into it's own file, then rips any "onclick" (and similar) functions out of the remaining HTML and writes corresponding JQuery code into the new JS file, then throws both files through TT (including a DIY "translate and HTML quoting" plugin) and stuffs the results into an in-memory cache for future use...

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
      I'm pretty sure a PR implementing a compatible, less-"convoluted" way would be accepted!

      But I doubt such exists, because making a dynamic language out of C is quite complicated, especially when you want to allow people to interface eXternal Subroutines (XS for short), which Dynaloader is.