{"id":2177,"date":"2026-11-24T19:18:46","date_gmt":"2026-11-25T03:18:46","guid":{"rendered":"https:\/\/wp.c9h.org\/cj\/?p=2177"},"modified":"2026-11-24T19:18:47","modified_gmt":"2026-11-25T03:18:47","slug":"bringing-modern-ml-columnar-io-and-rag-to-perl-data-language-pdlporters","status":"publish","type":"post","link":"https:\/\/wp.c9h.org\/cj\/2026\/11\/bringing-modern-ml-columnar-io-and-rag-to-perl-data-language-pdlporters\/","title":{"rendered":"Bringing Modern ML, Columnar I\/O, and RAG to Perl Data Language (PDLPorters)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Disclaimer: The opinions stated here are my own, not those of my employer.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my <a href=\"https:\/\/wp.c9h.org\/cj\/2026\/11\/why-perl-lost-the-cloud-era-and-how-native-grpc-protobuf-and-genai-sdks-can-bring-it-back\/\">previous post<\/a> on bringing native Protocol Buffers, gRPC, and Cloud\/GenAI client libraries to Perl, I noted an important split in modern AI and data engineering: remote LLM orchestration happens over RPC, while local machine learning and columnar analytics rely on in-process C, C++, and Rust tensor libraries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Naturally, the next question was: <em>what about the local side of that equation?<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What started as a pair of data-interchange prototypes (<code>PDL::IO::Arrow<\/code> and <code>PDL::IO::Protobuf<\/code>) developed alongside <code>google-auth-library-perl<\/code> (<a href=\"https:\/\/github.com\/GoogleCloudPlatform\/google-auth-library-perl\/pull\/35\">#35<\/a> and <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/google-auth-library-perl\/pull\/37\">#37<\/a>) quickly grew once we invited review from the <a href=\"https:\/\/github.com\/PDLPorters\"><strong>PDLPorters<\/strong><\/a> community, in particular Ed J (<code>mohawk2<\/code> \/ <code>ETJ<\/code> on <code>#pdl<\/code>) and Zakariyya Mughal (<code>ZMUGHAL<\/code>). That collaboration reshaped both the architecture and the governance of the project: 16 distributions (14 <code>PDL::*<\/code> modules at <code>0.011<\/code> and 2 <code>Alien::*<\/code> wrappers at <code>0.001<\/code>) have now been migrated into dedicated repositories under <code>PDLPorters<\/code>, hardened across Linux, macOS, and Windows, and submitted as 16 pull requests built directly on <a href=\"https:\/\/metacpan.org\/pod\/PDL\">Perl Data Language (<code>PDL<\/code>)<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-pdl-and-three-layer-architecture\">1. Eliminating the Two-Language Problem with a Clean 3-Layer PDL Architecture<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In pure Perl, a list of one million floating-point numbers is an array of one million boxed scalar structures (<code>SV<\/code>s). Historically, serializing data into and out of Perl scalars or shelling out to external Python scripts and CLI wrappers created a painful &#8220;two-language problem&#8221; for engineering teams already running Perl for systems automation, log analysis, text processing, and service orchestration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For nearly three decades, <strong><code>PDL<\/code><\/strong> has provided typed, contiguous C-level N-dimensional arrays (<code>ndarray<\/code>s) with vectorized broadcasting and affine slicing. What PDL lacked until now were zero-copy-friendly bridges to modern columnar file formats, deep-learning weight files, subword tokenizers, dense vector indexes, and hardware-accelerated inference runtimes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Guided by <code>PDLPorters<\/code> conventions and PAUSE community stewardship (relinquishing 11 deprecated prototype namespaces and transferring primary maintainership on the active namespaces to <code>ETJ<\/code> while retaining co-maintainership alongside <code>ZMUGHAL<\/code>), the stack is organized into three clean layers:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>Alien::*<\/code> Native Runtime Layer (<code>Alien::GGML<\/code>, <code>Alien::LibTorch<\/code>):<\/strong> Locates system-installed C\/C++ libraries via <code>pkg-config<\/code> or builds low-level HPC tensor runtimes cleanly without coupling complex native build logic to thin Perl XS wrappers.<\/li>\n\n\n\n<li><strong>Focused Engine &amp; Zero-Copy I\/O Layer (<code>PDL::IO::*<\/code>, <code>PDL::ML::Engine::*<\/code>, <code>PDL::ML::Vector::*<\/code>, <code>PDL::ML::Token::*<\/code>):<\/strong> Converts directly between native memory buffers (including the Apache Arrow C Data Interface and memory-mapped <code>.safetensors<\/code> \/ <code>.gguf<\/code> model weights) and contiguous PDL <code>ndarray<\/code> pointers.<\/li>\n\n\n\n<li><strong>PDL Broadcastloop &amp; Workflow Layer (<code>PDL::ML::Preprocess<\/code>, <code>PDL::ML::Metrics<\/code>, <code>PDL::ML::RAG<\/code>):<\/strong> Pure-PDL feature scaling, imputation, evaluation metrics, and retrieval-augmented generation workflows that compose naturally with PDL&#8217;s broadcasting engine.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">In practice, Perl services using traditional lexical search (<code>TF-IDF<\/code>, <code>BM25<\/code>, or regex log scanning) can now add subword tokenization, local ONNX or GGML embeddings, FAISS similarity search, and analytical DuckDB SQL completely in-process over shared C pointers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"upstream-binding-discipline-pdl-562\">2. Lessons Learned &amp; Upstream XS Discipline (<code>PDL#562<\/code> and <code>PDL#563<\/code>)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As the modules took shape, <code>mohawk2<\/code> opened <a href=\"https:\/\/github.com\/PDLPorters\/pdl\/issues\/562\"><code>PDLPorters\/pdl#562<\/code><\/a> (<em>&#8220;Notes on binding libraries to PDL&#8221;<\/em>), where we also contributed back a consolidated <a href=\"https:\/\/github.com\/PDLPorters\/pdl\/issues\/562#issuecomment-7144102610\">PDL Binding Cookbook<\/a>. Several concrete engineering idioms shaped all 16 pull requests:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use <code>PDL-&gt;new_around_datasv<\/code> for runtime-typed buffers:<\/strong> Rather than hand-rolling <code>pdlnew()<\/code>, <code>setdims()<\/code>, <code>allocdata()<\/code>, and <code>memcpy<\/code> boilerplate in C when wrapping raw byte buffers whose element type is determined dynamically at runtime, <code>new_around_datasv<\/code> wraps the buffer cleanly and idiomatically.<\/li>\n\n\n\n<li><strong>Fail hard on missing native libraries:<\/strong> Every <code>Makefile.PL<\/code> replaces silent <code>exit 0<\/code> stubs with explicit <code>die<\/code> diagnostics when required C\/C++ libraries are missing, ensuring CPAN Testers, <code>cpanm<\/code>, and distro build daemons accurately distinguish missing native prerequisites from passing builds.<\/li>\n\n\n\n<li><strong>Modern <code>Makefile.PL<\/code> &amp; C++ hygiene:<\/strong> Pure-XS distributions enable <code>XSMULTI =&gt; 1<\/code>, C++ bindings unconditionally use <a href=\"https:\/\/metacpan.org\/pod\/ExtUtils::CppGuess\"><code>ExtUtils::CppGuess<\/code><\/a> (<code>makemaker_options()-&gt;{CCFLAGS}<\/code>), quotes in <code>PDL::Core::Dev::PDL_INCLUDE()<\/code> are preserved so paths containing spaces never break, all <code>PDL-*<\/code> modules use 3-decimal versions (<code>0.011<\/code>) with <code>META_MERGE<\/code> pointing to <code>PDLPorters\/*<\/code>, and every module ships a dedicated <code>=head1 TYPES<\/code> POD section documenting supported PDL types.<\/li>\n\n\n\n<li><strong>Cross-platform CI &amp; local quality hooks:<\/strong> Every repository runs <code>PDLPorters<\/code> satellite GitHub Actions workflows (<code>PDLPorters\/devops\/github-actions\/ci-dist@master<\/code> plus IRC notifications) across Linux, macOS (using dynamic <code>brew --prefix<\/code> + <code>rpath<\/code>), and native Windows (<code>5.32<\/code>), achieving 100% green CI across all 14 <code>PDL-*<\/code> distributions and <code>Alien-GGML<\/code> (with <code>Alien-LibTorch<\/code> CI underway). Local <code>dot-git\/hooks\/pre-commit<\/code> and <code>pre-push<\/code> scripts enforce syntax checks, <code>Test::CPAN::Changes<\/code>, <code>Test::Pod<\/code>, parallel <code>prove -j<\/code>, and <a href=\"https:\/\/metacpan.org\/pod\/Test::Kwalitee\"><code>Test::Kwalitee<\/code><\/a> before code ever leaves a workstation.<\/li>\n\n\n\n<li><strong>Cross-distro &amp; Perl 5.40 portability catches:<\/strong> Testing across Debian, Ubuntu, Rocky Linux 9, macOS, Windows, and Perl 5.40 surfaced subtle real-world traps early: for example, avoiding exporting <code>connect<\/code> by default in <code>PDL::IO::DuckDB<\/code> so it does not shadow Perl&#8217;s built-in socket <code>connect<\/code>, and isolating a C99 <code>complex<\/code> macro collision in <code>pdl.h<\/code> under strict C++17\/C++20 mode into a minimal 3-file reproducer tracked upstream at <a href=\"https:\/\/github.com\/PDLPorters\/pdl\/issues\/563\"><code>PDLPorters\/pdl#563<\/code><\/a>.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-pdlporters-ml-and-io-stack\">3. Inside the 16 <code>PDLPorters<\/code> Distributions &amp; Pull Requests<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1320\" src=\"https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?resize=1600%2C1320&#038;ssl=1\" alt=\"Architecture diagram of the PDLPorters C\/C++ columnar I\/O, vector search, inference, and RAG stack over Perl Data Language (PDL).\" class=\"wp-image-2176\" srcset=\"https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?w=1600&amp;ssl=1 1600w, https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?resize=300%2C248&amp;ssl=1 300w, https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?resize=1024%2C845&amp;ssl=1 1024w, https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?resize=768%2C634&amp;ssl=1 768w, https:\/\/i0.wp.com\/wp.c9h.org\/cj\/wp-content\/uploads\/2026\/11\/pdlporters-ml-stack.png?resize=1536%2C1267&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><figcaption class=\"wp-element-caption\">Figure 1: Modular C\/C++ columnar I\/O, vector search, inference, and RAG stack over Perl Data Language (PDL).<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All 16 repositories under <code>PDLPorters<\/code> now have open pull requests spanning columnar and model-weight I\/O, C\/C++ ML and inference engines, dense vector search, tokenization, workflows, and <code>Alien::*<\/code> native library wrappers:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Distribution (Version)<\/th><th>Pull Request<\/th><th>Native Backend \/ Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>PDL::IO::Arrow<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-IO-Arrow\/pull\/1\">PDL-IO-Arrow#1<\/a><\/td><td>Apache Arrow C Data Interface IPC &amp; Apache Parquet columnar read\/write<\/td><\/tr><tr><td><code>PDL::IO::DuckDB<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-IO-DuckDB\/pull\/1\">PDL-IO-DuckDB#1<\/a><\/td><td>In-process analytical SQL queries materialized directly into PDL ndarrays<\/td><\/tr><tr><td><code>PDL::IO::Protobuf<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-IO-Protobuf\/pull\/1\">PDL-IO-Protobuf#1<\/a><\/td><td>Binary wire serialization between Protocol Buffer payloads and PDL ndarrays<\/td><\/tr><tr><td><code>PDL::IO::Safetensors<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-IO-Safetensors\/pull\/1\">PDL-IO-Safetensors#1<\/a><\/td><td>Memory-mapped (<code>mmap<\/code>), zero-arbitrary-code Hugging Face <code>.safetensors<\/code> weight I\/O<\/td><\/tr><tr><td><code>PDL::IO::GGUF<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-IO-GGUF\/pull\/1\">PDL-IO-GGUF#1<\/a><\/td><td>Memory-mapped quantized LLM tensor and metadata inspection for <code>.gguf<\/code> files<\/td><\/tr><tr><td><code>PDL::ML::Engine::ONNX<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Engine-ONNX\/pull\/1\">PDL-ML-Engine-ONNX#1<\/a><\/td><td>Hardware-accelerated PyTorch\/JAX\/TF model inference via ONNX Runtime&#8217;s C API<\/td><\/tr><tr><td><code>PDL::ML::Engine::XGBoost<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Engine-XGBoost\/pull\/1\">PDL-ML-Engine-XGBoost#1<\/a><\/td><td>Gradient-boosted decision tree training and scoring via <code>libxgboost<\/code><\/td><\/tr><tr><td><code>PDL::ML::Engine::MLPack<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Engine-MLPack\/pull\/1\">PDL-ML-Engine-MLPack#1<\/a><\/td><td>Fast C++ classical ML clustering, classification, and nearest-neighbor routines<\/td><\/tr><tr><td><code>PDL::ML::Vector::FAISS<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Vector-FAISS\/pull\/1\">PDL-ML-Vector-FAISS#1<\/a><\/td><td>High-dimensional dense vector similarity search (L2, inner product, HNSW\/IVF)<\/td><\/tr><tr><td><code>PDL::ML::Token::SentencePiece<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Token-SentencePiece\/pull\/1\">PDL-ML-Token-SentencePiece#1<\/a><\/td><td>C++ SentencePiece BPE and Unigram subword tokenization into integer ndarrays<\/td><\/tr><tr><td><code>PDL::ML::Token::Tokenisers<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Token-Tokenisers\/pull\/1\">PDL-ML-Token-Tokenisers#1<\/a><\/td><td>Fast BPE and WordPiece subword vocabulary encoding\/decoding<\/td><\/tr><tr><td><code>PDL::ML::Preprocess<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Preprocess\/pull\/1\">PDL-ML-Preprocess#1<\/a><\/td><td>PDL-broadcasted feature scaling, encoding, imputation, and train\/test splitting<\/td><\/tr><tr><td><code>PDL::ML::Metrics<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-Metrics\/pull\/1\">PDL-ML-Metrics#1<\/a><\/td><td>Vectorized accuracy, ROC\/AUC, F1, RMSE, and ranking evaluation metrics<\/td><\/tr><tr><td><code>PDL::ML::RAG<\/code> (<code>0.011<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/PDL-ML-RAG\/pull\/1\">PDL-ML-RAG#1<\/a><\/td><td>Chunking, normalized vector storage, prompt rendering, and hybrid local\/cloud RAG<\/td><\/tr><tr><td><code>Alien::GGML<\/code> (<code>0.001<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/Alien-GGML\/pull\/1\">Alien-GGML#1<\/a><\/td><td><code>Alien::Build<\/code> package for the <code>ggml<\/code> C\/C++ quantized LLM tensor library<\/td><\/tr><tr><td><code>Alien::LibTorch<\/code> (<code>0.001<\/code>)<\/td><td><a href=\"https:\/\/github.com\/PDLPorters\/Alien-LibTorch\/pull\/1\">Alien-LibTorch#1<\/a><\/td><td><code>Alien::Build<\/code> package for C++ <code>libtorch<\/code> tensor and inference runtimes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ergonomic-examples-arrow-faiss-onnx-rag\">What It Looks Like in Practice<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Reading and writing Apache Parquet or Arrow IPC files directly as named <code>PDL<\/code> columns (which also bridges cleanly to BigQuery&#8217;s Arrow-based <a href=\"https:\/\/metacpan.org\/dist\/Google-Cloud-Bigquery-Storage-V1\"><code>Google::Cloud::Bigquery::Storage::V1<\/code><\/a> API) takes a single call:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use PDL;\nuse PDL::IO::Arrow qw(rarrow warrow rparquet wparquet);\n\n# Read Parquet columnar data directly into typed PDL ndarrays\nmy $cols   = rparquet('events.parquet');\nmy $scores = $cols-&gt;{score};\n\n# Write named PDL columns back out to Parquet or Arrow IPC\nwparquet({ id =&gt; long([1, 2, 3]), val =&gt; double([0.5, 1.5, 2.5]) }, 'out.parquet');\nwarrow({ id =&gt; long([1, 2, 3]), val =&gt; double([0.5, 1.5, 2.5]) }, 'out.arrow');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Indexing embedding vectors in FAISS and running local ONNX Runtime inference stay equally concise:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use PDL;\nuse PDL::ML::Vector::FAISS qw(flat_l2);\nuse PDL::ML::Engine::ONNX qw(load_session);\n\n# 1. k-NN similarity search in FAISS\nmy $index = flat_l2(4);\n$index-&gt;add(float([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]]));\nmy ($distances, $indices) = $index-&gt;search(float([[0, 1, 0, 0]]), 2);\n\n# 2. Local model inspection &amp; inference via ONNX Runtime C API\nmy $sess    = load_session('model.onnx');\nmy @inputs  = $sess-&gt;input_names();\nmy @outputs = $sess-&gt;output_names();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And <code>PDL::ML::RAG<\/code> ties local vector retrieval together with either a local ONNX\/GGML backend or a remote gRPC call via <a href=\"https:\/\/metacpan.org\/dist\/Google-Ai-Generativelanguage-V1\"><code>Google::Ai::Generativelanguage::V1<\/code><\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use PDL;\nuse PDL::ML::RAG qw(chunk_text render_prompt);\n\nmy $rag = PDL::ML::RAG::Pipeline-&gt;new(\n    embedder  =&gt; sub ($text) { ... },          # returns 1D PDL float vector\n    generator =&gt; sub ($prompt, $hits) { ... }, # local ONNX\/GGML or Gemini gRPC\n);\n\n$rag-&gt;ingest([\n    { text =&gt; 'PDL provides fast n-dimensional arrays for Perl.', metadata =&gt; { src =&gt; 'pdl' } },\n    { text =&gt; 'DuckDB runs vectorized SQL queries in-process.',   metadata =&gt; { src =&gt; 'duckdb' } },\n]);\n\nmy $res = $rag-&gt;query('How do I run SQL?', k =&gt; 1);\nprint $res-&gt;{answer}, \"\\n\";<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"capability-assessment-perl-vs-python\">4. Honest Capability Assessment: Where Perl Reaches Parity (and Where Python Still Leads)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">High-level languages achieve modern ML throughput by orchestrating compiled C, C++, CUDA, and Rust engines over contiguous memory buffers. Distinguishing between <strong>analytics, tabular ML, inference, and RAG<\/strong> versus <strong>frontier foundation-model training<\/strong> clarifies what this expansion actually changes for Perl:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Workload Category<\/th><th>Perl (<code>PDL<\/code> + <code>PDL::ML<\/code> \/ <code>PDL::IO<\/code>)<\/th><th>Python (<code>NumPy<\/code> \/ <code>PyTorch<\/code> \/ <code>JAX<\/code>)<\/th><th>Assessment<\/th><\/tr><\/thead><tbody><tr><td><strong>Columnar Analytics &amp; ETL<\/strong><\/td><td><code>PDL::IO::Arrow<\/code>, <code>PDL::IO::DuckDB<\/code>, <code>PDL::IO::Protobuf<\/code><\/td><td><code>pyarrow<\/code>, <code>duckdb<\/code>, <code>polars<\/code>, <code>pandas<\/code><\/td><td><strong>Near Parity:<\/strong> Both wrap the same C++ Arrow and DuckDB engines over contiguous buffers.<\/td><\/tr><tr><td><strong>Classical &amp; Tabular ML<\/strong><\/td><td><code>PDL::ML::Engine::XGBoost<\/code>, <code>MLPack<\/code>, <code>Preprocess<\/code>, <code>Metrics<\/code><\/td><td><code>xgboost<\/code>, <code>scikit-learn<\/code>, <code>lightgbm<\/code><\/td><td><strong>Near Parity:<\/strong> Execution time is dominated by <code>libxgboost<\/code> and C++ routines.<\/td><\/tr><tr><td><strong>Model Inference &amp; Quantized LLMs<\/strong><\/td><td><code>PDL::ML::Engine::ONNX<\/code>, <code>Alien::GGML<\/code>, <code>Safetensors<\/code>, <code>GGUF<\/code><\/td><td><code>onnxruntime<\/code>, <code>llama-cpp-python<\/code>, <code>safetensors<\/code><\/td><td><strong>Near Parity:<\/strong> Native C\/C++ execution once tensors and weights are memory-mapped.<\/td><\/tr><tr><td><strong>Dense Vector Search &amp; RAG<\/strong><\/td><td><code>SentencePiece<\/code>, <code>Tokenisers<\/code>, <code>FAISS<\/code>, <code>PDL::ML::RAG<\/code><\/td><td><code>sentencepiece<\/code>, <code>tokenizers<\/code>, <code>faiss<\/code>, <code>langchain<\/code><\/td><td><strong>Near Parity:<\/strong> Tokenization, embedding, and FAISS indexing all run in native C++ memory.<\/td><\/tr><tr><td><strong>Frontier Model Training &amp; Autodiff<\/strong><\/td><td>Limited (no native compiler-level autodiff or XLA\/Triton stack)<\/td><td><code>PyTorch<\/code>, <code>JAX<\/code>, <code>TensorFlow<\/code>, <code>Triton<\/code><\/td><td><strong>Python \/ C++ Lead:<\/strong> Multi-node GPU\/TPU training, reverse-mode autodiff, and kernel fusion (<code>torch.compile<\/code>, XLA) remain Python\/Julia\/C++-centric.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once data is resident in PDL <code>ndarray<\/code>s, chaining <code>PDL::IO::DuckDB<\/code> &rarr; <code>PDL::ML::Preprocess<\/code> &rarr; <code>PDL::ML::Engine::XGBoost<\/code> for tabular scoring, or <code>PDL::ML::Token::SentencePiece<\/code> &rarr; <code>PDL::ML::Engine::ONNX<\/code> &rarr; <code>PDL::ML::Vector::FAISS<\/code> &rarr; <code>PDL::ML::RAG<\/code> for dense retrieval, executes inside the exact same C and C++ libraries powering Python and Rust services.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-this-means-for-debian\">5. Linux Distro Readiness: Debian <code>trixie<\/code> (and Enterprise Linux EPEL 9)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For Debian Developers and systems administrators, the best surprise is how much of the heavy C and C++ lifting is <em>already<\/em> packaged in Debian <code>main<\/code> thanks to the Debian Science and Debian Deep Learning teams. On a standard Debian 13 (<code>trixie<\/code>) machine today, <code>apt<\/code> already provides DFSG-compliant shared libraries and headers for the core numerical and ML runtimes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>pdl<\/code> (<code>1:2.100-1<\/code>)<\/li>\n\n\n\n<li><code>libonnxruntime-dev<\/code> (<code>1.21.0+dfsg-1<\/code>)<\/li>\n\n\n\n<li><code>libxgboost-dev<\/code> (<code>3.0.0-1<\/code>)<\/li>\n\n\n\n<li><code>libfaiss-dev<\/code> (<code>1.11.0-3<\/code>)<\/li>\n\n\n\n<li><code>libmlpack-dev<\/code> (<code>4.6.0-1<\/code>)<\/li>\n\n\n\n<li><code>libsentencepiece-dev<\/code> (<code>0.2.0-1+b3<\/code>)<\/li>\n\n\n\n<li><code>libprotobuf-dev<\/code> (<code>3.21.12-11+deb13u1<\/code>)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">(Enterprise Linux users benefit similarly: on Rocky Linux 9 and AlmaLinux 9, <code>perl-PDL<\/code> is available straight from EPEL 9.) Where an upstream C\/C++ runtime is not yet packaged by the OS, <a href=\"https:\/\/github.com\/PDLPorters\/Alien-GGML\/pull\/1\"><code>Alien::GGML<\/code><\/a> and <a href=\"https:\/\/github.com\/PDLPorters\/Alien-LibTorch\/pull\/1\"><code>Alien::LibTorch<\/code><\/a> use <a href=\"https:\/\/metacpan.org\/pod\/Alien::Build\"><code>Alien::Build<\/code><\/a>&#8216;s standard system-first probe: honoring <code>pkg-config<\/code> distro libraries automatically whenever present (as Debian&#8217;s <code>pkg-perl<\/code> policy expects) and falling back to an isolated build only when needed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps-and-getting-involved\">6. What&#8217;s Next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Paired with the <a href=\"https:\/\/wp.c9h.org\/cj\/2026\/11\/why-perl-lost-the-cloud-era-and-how-native-grpc-protobuf-and-genai-sdks-can-bring-it-back\/\">Cloud gRPC, Protobuf, and Gemini SDK stack<\/a>, Perl now has a cohesive story across both remote cloud AI orchestration and local C\/C++ columnar analytics, vector search, and model inference. Over the coming weeks, our focus is on four concrete milestones:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Upstream review &amp; C++ header cleanup:<\/strong> Working through maintainer feedback across all 16 <code>PDLPorters<\/code> pull requests (including <code>Alien::GGML<\/code> and <code>Alien::LibTorch<\/code>) and resolving the C++ <code>complex<\/code> header collision in <a href=\"https:\/\/github.com\/PDLPorters\/pdl\/issues\/563\"><code>PDLPorters\/pdl#563<\/code><\/a>.<\/li>\n\n\n\n<li><strong>Tutorial-driven executable tests:<\/strong> Shipping end-to-end machine learning tutorials as executable <code>.t<\/code> test suites, including classic bioinformatics tabular classification benchmarks on the UCI <em>E. coli<\/em> and <em>Yeast<\/em> protein subcellular localization datasets and weighted <em>k<\/em>-NN pipelines inspired by PSORT and WoLF PSORT.<\/li>\n\n\n\n<li><strong>Initial CPAN releases under <code>PDLPorters<\/code>:<\/strong> Cutting initial CPAN releases once <code>PDLPorters<\/code> co-maintainers sign off on the public APIs and type contracts.<\/li>\n\n\n\n<li><strong>Debian <code>pkg-perl<\/code> packaging:<\/strong> Packaging the stack for Debian starting with <code>libpdl-io-arrow-perl<\/code> and <code>libpdl-io-protobuf-perl<\/code> alongside the existing <code>trixie<\/code>\/<code>forky<\/code> C++ libraries.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you use <code>PDL<\/code>, work on bioinformatics or scientific computing in Perl, or help maintain numerical packages in Debian, feedback on <a href=\"https:\/\/github.com\/PDLPorters\/pdl\/issues\/562\"><code>PDLPorters\/pdl#562<\/code><\/a> and the 16 satellite pull requests is very welcome.<\/p>\n\n\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=cjamescollier\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Following up on the Cloud gRPC and Protobuf stack for Perl, a look at 16 new PDLPorters repositories and 16 cross-platform pull requests bringing Apache Arrow, Parquet, DuckDB, GGUF, Safetensors, ONNX Runtime, XGBoost, MLPack, FAISS, SentencePiece, GGML, LibTorch, and RAG pipelines to PDL.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[337,322,17,79,47,102,18,166,335],"tags":[355,365,280,357,360,361,364,363,358,356,354,342,351,362,350,359],"class_list":["post-2177","post","type-post","status-publish","format-standard","hentry","category-337","category-bookworm","category-debian","category-free-software","category-linux","category-open-source","category-perl","category-software","category-trixie","tag-arrow","tag-bioinformatics","tag-debian","tag-duckdb","tag-faiss","tag-ggml","tag-libtorch","tag-machine-learning","tag-onnx","tag-parquet","tag-pdl","tag-perl","tag-pkg-perl","tag-rag","tag-trixie","tag-xgboost"],"jetpack_shortlink":"https:\/\/wp.me\/p1YDIB-z7","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/posts\/2177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/comments?post=2177"}],"version-history":[{"count":10,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/posts\/2177\/revisions"}],"predecessor-version":[{"id":2187,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/posts\/2177\/revisions\/2187"}],"wp:attachment":[{"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/media?parent=2177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/categories?post=2177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/wp-json\/wp\/v2\/tags?post=2177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}