Make PDL be a C library with a Perl interface so it can be used from other C (or dynamic language) code
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- backend-api-design, data
Research direction
Start by reading pdlcore.c, pdlcore.h, pdlperl.h, and pdl.h to map the existing Perl-dependent code and API declarations; pp_indterm and the related #349 broadcastloop-vtable ideas are also called out. Done means the unchecked architectural tasks are implemented, including a separated C API, a Perl implementation behind the vtable, and removal of the listed Perl-specific dependencies from the C API.
Written by the indexing model from the issue text.
Description
Tasks:
- segregate the Perl-using C code (mostly pdlcore.c) completely away from the "PDL API" code, separating
PDL_CORE_LISTintoPDL_PERL_LISTandPDL_API_LIST- for compatibility reasons this will need to remain called "pdlcore.h" so may as well still call the .c the same, and probably mergepdlperl.hback in; the C API stuff would need to move topdl.h - make macros that handle either allocating or using the default arrays such as
def_dims - separate out a
PDL_Valueunion type for thePDL_Anyval.value - use that to add a
pdl.valueentry to be used for ndarrays whosedatasegment is less than that number of bytes (which for small types could be several elements) obviously including scalar/single-value, using the alloc/default macro - switch PDL to just using
reallocrather thanpdl_grow/pdl_makescratchhash - have a
pdl_impl_vtable *pdl.implpointer, and void *pdl.impl_datathat would replace the currentdatasv,sv,hdrsv(probably with a struct for the Perl implementation to use), implementing a Perl version - segregate remaining
croak(etc)-using code into that vtable (especiallypp_indterm) - that vtable might also want memory-management entries (malloc, realloc, free) unless the "switch to realloc" item renders it moot
- eliminate the whole
pdl.hdrsvfrom the C code, make the Perl object routinely be a hashref with aPDLand ahdrelement so any copying could be done at Perl level - detection of POSIX threads could be de-Perl-ised
This is somewhat connected to the #349 ideas on making a broadcastloop vtable, but only somewhat.
- Dominant language
- Perl
- Stars
- 105
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PDLPorters/pdl
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
PDLPorters/pdl#561 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PDLPorters/pdl#560 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PDLPorters/pdl#557 · 5 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
PDLPorters/pdl#530 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
PDLPorters/pdl#506 · 2 comments ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
jimsalterjrs/sanoid#1116 · 1 reaction ·
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken @sadhana-s-codez claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
major/MySQLTuner-perl#1007 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100