Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^2: Refactoring Perl5 with XS++

by rje (Deacon)
on Apr 27, 2015 at 15:30 UTC ( [id://1124879] : note . print w/replies, xml ) Need Help??

in reply to Re: Refactoring Perl5 with XS++
in thread Refactoring Perl5 with XS++

Maybe so. Re-reading his post, though, it looks like he has wanted something that replaces XS, as well.

He lays out three steps. First, a minimal bootstrapping language which can replace XS. Second, Rakudo's intermediate structure to represent the language (or something better). Third, Rakudo's metaprogramming system (or something better).

To hammer the point home, he then says "Figuring out a replacement for XS is essential".

And in another place, he actually tried writing a little bytecode interpreter which granted the power of C, without having to write in C. I think that's one peep into his vision, in a way.

Replies are listed 'Best First'.
Re^3: Refactoring Perl5 with XS++
by ikegami (Patriarch) on Apr 27, 2015 at 15:44 UTC
    The fact that the document is about replacing XS doesn't change what I said. XS is no more a programming language than HTML is. The ops his bootstrapping language would have would have parallels in the Perl API, not XS.

      Ah! Yes, I think you're right.

Re^3: Refactoring Perl5 with XS++
by mr_mischief (Monsignor) on Apr 27, 2015 at 15:36 UTC

    I think a pertinent question, then, is replace XS how? In one sense, XS is easily replaced if one has a powerful enough foreign function interface (FFI). In another sense, syntax that allows (possibly inlined) C to be separately compiled and to call back into Perl easily is required. If one wants to fully replace XS, the language has to be able to do both or do equivalent things to both.

      Quite so! And that's pretty much where I'm at: "in what sense would XS be 'replaced'"? And of course it's probably more like robustifying the API so that XS is directly used less often, or never if possible.

      Note that I'm not assuming any of this is likely or easily doable. Hard things are possible, though.