Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^15: Modernizing the Postmodern Language?

by chromatic (Archbishop)
on Jul 08, 2020 at 19:13 UTC ( #11119040=note: print w/replies, xml ) Need Help??


in reply to Re^14: Modernizing the Postmodern Language?
in thread Modernizing the Postmodern Language?

Well my first idea was, why not write a wrapper macro/class which applies the accessor macros in form of "virtual methods in well-defined slots"?

It's been a long time since I thought about such a thing, but I don't know how much work it would be to write lvalue macros that could call set_ methods appropriately.

Why would we need to gradually migrate away from XS then?

CPAN/DarkPAN authors who want to support multiple language versions with a single release.

Replies are listed 'Best First'.
Re^16: Modernizing the Postmodern Language?
by LanX (Cardinal) on Jul 08, 2020 at 19:24 UTC
    > CPAN/DarkPAN authors who want to support multiple language versions with a single release.

    Maybe a misunderstanding:

    Are you talking about migrating away from the

    • XS API or
    • XS implementation?

    If such a wrapper was implemented as linkable library in XS, why would one need to write differently for various Perl versions?

    (Disclaimer my $XS_know_how ~~ 0

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

    °) dumbmatch operator ;-)

      I think it's both, but that may not be entirely true.

      XS is a series of macros, yes, but it's also a sort of preprocessor template system for C, so it's theoretically possible to emit different code for different versions of Perl.

      In practice, that sounds really difficult to implement.

        My take on this is that it depends on the objective.

        If the goal is to simplify accessing Perl internals for module authors, creating a wrapper macro/class ( XSS = XS-Simple ? ) for a new API seems the way to go. Preferably in a modular/ linkable way. Since this would rely on standardized XS it should also be backwards compatible.

        Changing the XS implementation is another beast, while this might benefit core devs I doubt there is a mid-term return of investment justifying the risk.

        Again, theoretical thoughts. If I'm wrong about the details, please enlighten me. :)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119040]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2020-09-18 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I don’t succeed, I …










    Results (113 votes). Check out past polls.

    Notices?