Summary
Port the CPAN meta distribution to PerlOnJava so Perl modules can inspect and modify package symbol tables without requiring its XS implementation.
Motivation
meta 0.015 provides a Perl metaprogramming API implemented through XS. PerlOnJava currently reports:
Can't load loadable object for module meta: no Java XS implementation available
This blocks Data::Faker::Colour through the dependency chain:
Data::Faker::Colour
-> Convert::Color::HSLuv
-> Convert::Color
-> meta
Convert::Color uses meta to dynamically install color-conversion methods such as as_RGB and as_HSL. The impact extends beyond this module: CPAN metadata currently identifies 21 unique distributions declaring meta as a dependency, including Full, Tangence, Tickit-Widgets, Future-IO-Resolver, Net::Prometheus, Net::Async::WebSocket, several Syntax::Operator::* distributions, and Convert::Color.
Upstream API surface
The port should investigate the complete public API, including:
meta::get_package
meta::get_this_package
meta::for_reference
meta::package objects for package inspection and mutation
- package, glob, symbol, and reference meta-objects
- symbol and method creation/removal, including
add_symbol and add_named_sub
- package and symbol enumeration
- class/package detection where supported by the Perl version
- warning and deprecation behavior, including the
meta::experimental category
The upstream module exposes low-level interpreter structures, so behavior should be defined carefully for both ordinary Perl packages and PerlOnJava's runtime representation.
Suggested implementation
- Inspect the upstream
meta.pm and meta.xs sources and preserve their license and attribution.
- Separate the Perl wrapper/API declarations from operations that access Perl's internal symbol tables.
- Add a Java-backed implementation using PerlOnJava's package, glob, symbol-table, and callable registration infrastructure.
- Preserve Perl calling context, return values, exceptions, warnings, and aliasing semantics.
- Keep unsupported low-level operations explicit; do not silently emulate them with copies when the Perl API requires aliases.
- Verify behavior on both JVM and interpreter backends.
Acceptance criteria
use meta loads without XS under both PerlOnJava backends.
meta::get_package and meta::get_this_package return usable package meta-objects.
- Package symbols and named subs can be inspected, enumerated, added, and removed with Perl-compatible behavior.
- Aliases and references retain the expected identity and mutation semantics.
Convert::Color loads and dynamically installs its color-space conversion methods.
Data::Faker::Colour passes its upstream tests without a native dependency failure.
- Tests cover missing symbols, invalid names, duplicate additions, package isolation, warnings, and both scalar/list/void contexts where applicable.
- The upstream
meta tests, or focused equivalents where an interpreter-internal test is not portable, pass under system Perl and both PerlOnJava backends.
Related compatibility work
This port would unblock Data::Faker::Colour 0.001, whose system-Perl tests pass but whose PerlOnJava test fails at module load because meta contains XS code. It may also reduce the number of CPAN distributions blocked by native metaprogramming dependencies.
References
Summary
Port the CPAN
metadistribution to PerlOnJava so Perl modules can inspect and modify package symbol tables without requiring its XS implementation.Motivation
meta0.015 provides a Perl metaprogramming API implemented through XS. PerlOnJava currently reports:This blocks
Data::Faker::Colourthrough the dependency chain:Convert::Colorusesmetato dynamically install color-conversion methods such asas_RGBandas_HSL. The impact extends beyond this module: CPAN metadata currently identifies 21 unique distributions declaringmetaas a dependency, includingFull,Tangence,Tickit-Widgets,Future-IO-Resolver,Net::Prometheus,Net::Async::WebSocket, severalSyntax::Operator::*distributions, andConvert::Color.Upstream API surface
The port should investigate the complete public API, including:
meta::get_packagemeta::get_this_packagemeta::for_referencemeta::packageobjects for package inspection and mutationadd_symbolandadd_named_submeta::experimentalcategoryThe upstream module exposes low-level interpreter structures, so behavior should be defined carefully for both ordinary Perl packages and PerlOnJava's runtime representation.
Suggested implementation
meta.pmandmeta.xssources and preserve their license and attribution.Acceptance criteria
use metaloads without XS under both PerlOnJava backends.meta::get_packageandmeta::get_this_packagereturn usable package meta-objects.Convert::Colorloads and dynamically installs its color-space conversion methods.Data::Faker::Colourpasses its upstream tests without a native dependency failure.metatests, or focused equivalents where an interpreter-internal test is not portable, pass under system Perl and both PerlOnJava backends.Related compatibility work
This port would unblock
Data::Faker::Colour0.001, whose system-Perl tests pass but whose PerlOnJava test fails at module load becausemetacontains XS code. It may also reduce the number of CPAN distributions blocked by native metaprogramming dependencies.References