EnzoXenon has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks ...

I have serialized data files in a format from zserio -> https://zserio.org/

I've read through the documentation for File::Serialize but there's no specific zserio serializer.

Is there a perl module which can read/write zserio blobs?

Humble thanks

Replies are listed 'Best First'.
Re: Serialize data in zserio format
by The_Dj (Scribe) on May 11, 2024 at 13:37 UTC
    If I understand your question, you only need Perl to decode file you already have?

    And as far as I can tell from some quick scanning of the docco, zsero "files" include some (compiled?) metadata about the structure,
    and a bit stream of the actual data.

    After having a quick look over the wire format at https://zserio.org/doc/ZserioEncodingGuide.html

    It looks like most of the actual work can be done by pack/unpack and a few %hash lookups.

    If there is need I could probably whip up a PP reader
    🤷‍♂️
Re: Serialize data in zserio format
by etj (Priest) on May 11, 2024 at 11:08 UTC
    My quick googling didn't show any. A quick read of the website shows it supports C++. To make a Perl module, you'd want to make an Alien package, see Alien::Build::Manual::AlienAuthor. Then make a separate Perl module that implements a Perl-idiomatic interface.
Re: Serialize data in zserio format
by The_Dj (Scribe) on May 14, 2024 at 05:56 UTC
    Alright; I feel motivated.

    Do you have both the defs.zs and the data.zsb files?

    If you do, let me know and I'll go ahead and build a Pure Perl* decoder. Looks like Data::BitStream can do the necessary reading.

    * Well, my code will be PP. No promises about Data::BitStream