fauria has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks!

Id like to know what the differences between DynaLoader and XSLoader are.

Module descriptions says:

DynaLoader: "This document defines a standard generic interface to the dynamic linking mechanisms available on many platforms. Its primary purpose is to implement automatic dynamic loading of Perl modules."

XSLoader: "This module defines a standard simplified interface to the dynamic linking mechanisms available on many platforms. Its primary purpose is to implement cheap automatic dynamic loading of Perl modules.
For a more complicated interface, see DynaLoader."


It seems that XSLoader is easier to use than DynaLoader, but i would like to know what features XSLoader lacks, when compared to DynaLoader.

Thank you!

Replies are listed 'Best First'.
Re: DynaLoader and XSLoader
by PodMaster (Abbot) on Jan 30, 2005 at 14:35 UTC
    It seems that XSLoader is easier to use than DynaLoader...
    XSLoader is admittedly simpler(dumber), but that doesn't translate into easier to use (its not). I doubt anyone who uses DynaLoader (in my experience the majority of users, very few use XSLoader) actually had to write any code to use DynaLoader, as h2xs will do it for you. I also doubt any of them ever read the DynaLoader documentation and/or are aware of how "complicated" it is (its not).
    ...i would like to know what features XSLoader lacks, when compared to DynaLoader.
    If you read the documentation for both modules, that is easily apparent.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: DynaLoader and XSLoader
by Anonymous Monk on Jan 31, 2005 at 06:38 UTC
    1. there are plans on p5p to join these
    2. indeed, those functions do similar things, but dynaloader does more and has deeper searching logic.
    3. XSLoader usually calls DynaLoader after bit preparing

    Courage