in reply to What's the "modern" way to talk to C libraries?
Personally, I like to start out with Inline::C, and then pull out the XS file that Inline generates. This gives me a quick start without needing to worry too much, but Inline::C still has me writing C and the interface doesn't really create perlish APIs. I usually wrap the C part then with more Perl to create a perlish API over the C API.
The ugly part IMO is handling structs that you get from C. I haven't found a good way to automatically generate a converter from a C-struct to a Perl hash (and be it a tied hash into the C data structure). Convert::Binary::C did this, but if it is failure-prone nowadays, that's no fun. I have enough to debug with the segfaults in my code, I don't want segfaults introduced by other code as well...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What's the "modern" way to talk to C libraries?
by haj (Vicar) on Nov 24, 2025 at 11:16 UTC | |
by cavac (Prior) on Nov 24, 2025 at 15:08 UTC |