Make PDL be a C library with a Perl interface so it can be used from other C (or dynamic language) code
Open
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 105
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
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.
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.
Assessment
- Tech stack
- c, perl
- Domain
- backend-api-design, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100