Sanko Robinson

Human.

/
· ·

2026

sanko/Affix.pmAffix::Build and Affix::Wrap
Based on infix v0.1.3
Chapter 34: The Zero-Dependency Image Processor

For our next trick, we'll tackle the most common headache in the C ecosystem: Dependency Hell. Usually, if you want to manipulate images, you need libpng, libjpeg, zlib, and headers for all of them installed on your system. If your user is on a different OS, your script fails. To avoid that, let's use Affix::Build to compile the famous stb single-header libraries.

sanko/Alien-xmake0.06
**Full Changelog**: https://github.com/sanko/Alien-Xmake/compare/0.05...0.06
Chapter 33: SIMD Vectors for Number Crunching

Standard Perl scalars are designed for flexibility, not raw math throughput. When you need to process millions of coordinates, pixels, or audio samples, you want SIMD (Single Instruction, Multiple Data).

Chapter 31: Wrapping C++ Classes by Hacking Vtables

In Chapter 30, we wrapped C++ classes using extern "C" helper functions in a shim. That is the 'Right Way.' But what if you are stuck with a pre-compiled C++ library and can't recompile it? What if you're just super bored? Let's say you have an object pointer, but no C functions to pass it to.

Chapter 30: Wrapping C++ Classes with C Shims

C++ libraries are notoriously difficult for FFI systems to bind. Unlike C, which uses standard symbol names, C++ "mangles" function names (for example, turning Warrior::attack() into _ZN7Warrior6attackEv) to support features like overloading. Furthermore, C++ methods require a hidden this pointer to know which object instance they are acting upon.

Chapter 29: An Affix Module Factory

While runtime wrapping is convenient, it has a startup cost (parsing headers every time). For a distributable CPAN module, you want the parsing to happen once (on your machine), generating a pure Perl module that users can load instantly.

Chapter 28: Instant Runtime Wrappers

The fastest way to use Affix::Wrap is Runtime Wrapping. In this workflow, you parse the headers and bind the functions immediately when your script starts. This is ideal for rapid prototyping, internal scripts, or testing, as you don't need to generate a separate .pm file.

Chapter 27: Automated Introspection with Affix::Wrap

Writing affix signatures manually is great for control, but it becomes tedious when wrapping a library with hundreds of functions and structs. Instead of staring at a .h file and manually translating C types to Affix types, let Affix::Wrap automate it!

2025

Chapter 26: The "Kitchen Sink" Polyglot Library

Sometimes, the best tool for the job involves three different tools. You might have legacy math models in Fortran, performance-critical loops in Assembly, and a clean C API to orchestrate them.

Chapter 24: The Instant C++ Library

Throughout this cookbook, you've seen me use Affix::Build to generate shared libraries on the fly from C. However, building shared libraries isn't a concept limited to just C so neither are the capabilities of Affix::Build.

Chapter 21: Perl Callbacks in C Structs (vtables)

In C, OOP is often simulated using structs containing function pointers. This pattern is commonly known as a vtable and allows a library to call different implementations of a function depending on the object it's holding. With Affix, you can populate these fields with Perl subroutines, effectively creating a Perl class that C can call into.

Chapter 19: Troubleshooting & Debugging

When things go wrong in Perl, you probably get an error message. When they go wrong in C, you get a segfault, a frozen terminal, or data corruption that only shows up three hours later. This chapter provides a survival kit for when things go very wrong and it's your job to figure it all out.

Chapter 18: Error Handling

System calls fail. In C, you check the global errno variable (or GetLastError() on Windows). In Affix, we expose this via errno().

Chapter 17: Advanced File Handling

Bridging I/O between languages is historically one of the most fragile aspects of FFI. While handling file descriptors manually as opaque pointers may be effective on POSIX systems, that approach is a minefield on Windows. Affix solves this by introducing two smart types: File and PerlIO. These types handle the extraction, translation, and lifecycle management of file handles automatically.

Chapter 16: Direct Marshalling Trampolines

Speed is the reason I wrote infix and Affix and I think I've achieved a good balance of features vs. speed. I've done a lot of work to reduce overhead on the hot path but what if we could go... faster?

sanko/infixv0.1.3
This release contains real-world usage fixes since I'm using it in Affix.pm and not just experime...
Perl-SDL3/SDL3.pmInitial public release
This is the first public release of SDL3.pm, a pure Perl wrapper for SDL3.
sanko/Affix.pmUnion and lvalue pointer fixes
**Full Changelog**: https://github.com/sanko/Affix.pm/compare/v1.0.0...v1.0.1
sanko/Affix.pmStable enough
**Full Changelog**: https://github.com/sanko/Affix.pm/compare/v0.12.0...v1.0.0
sanko/Affix.pmUnstable total rewrite
First version based on infix. This will eventually be 1.0.x.
Packed Trampolines

We have nearly reached the end of the current roadmap. infix is fast, secure, and portable. But optimization is an addiction, and I am already looking at the next bottleneck. The new direct marshalling API wins the benchmark races because it removes the intermediate step of packing C values into a buffer. Double indirection is slower than pulling them straight from the source SV*s.

Language Specific Trampolines

This is an explanation and expansion of discussion #26 now that I've started actually implemented and designed my idea.

sanko/infixPolish
Really sanding down the rough edges this time around. This release includes significant ergonomic...
System calls via FFI

I've had this idea for a while now and might put effort into it next. I understand that this would be a massive task but the first 30% of it is already accomplished by infix existing in its current state.

sanko/infixInitial Public Release
## [0.1.0] - 2025-10-27
Coercion of arguments into a solid block of memory
1

Shower thought time... Internally, would it be faster to coerce args that would end up on the stack into a single block of malloc'd memory? Currently, our trampolines must perform a double-indirection to put data on the stack:

2023