Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I agree that data translations will be costly. But nothing stops using raw memory pointers typecasted (i.e. interpreted) to the appropriate data structure. In plain C that would be akeen to typecasting raw memory/void to a struct. In OOP, an SV could be any class implementing the SV interface with, say, slot(name, value). Since all these will be part of the same process, it wont be necessary to use shared memory etc.

It's true that any XS code using SV sv; sv.IV = 42; will break (is this the sort of tricks you mentioned doing?). But, perlguts's doc shows that the proper way is to use sv_setiv(&sv, 42) i.e. a setter macro/function which it is very easy for the suggested intermediate layer to hijack transparently. But perhaps it all leads to re-inventing a virtual machine, which you mentioned.

PS. I respond to this thread, and I am sorry if I waste your time with possible nonsense, as a means of throwing ideas/brain storming. I consider it fundamental that the "modernisation" process starts from the guts. Or equal attention be given to the guts too. And having a data-exchange framework as a when-all-else-fails option for the API when dealing with different Perl versions but also for when accessing external libraries with Platypus and also when accessing external environments (like R) and their native data structures (like R's data.frame) would be great and future-proof and make Perl a true polyglot.

refs: Parrot Overview and SO thread https://stackoverflow.com/questions/118141/what-exactly-is-parrot


In reply to Re^6: Modernizing the Postmodern Language? by bliako
in thread Modernizing the Postmodern Language? by WaywardCode

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found