Skip to content

Announcing Getty 0.4.0

I am happy to announce a new version of Getty, 0.4.0. 🎉

Getty is a framework for building robust, optimal, and reusable serializers/deserializers in Zig. To install Getty, follow the instructions listed on the Installation page.

What's in 0.4.0

Despite 0.3.0 coming out less than a month ago, we already have a new major version! Apparently, living at the HEAD of Zig is quite an unstable life. Who would've thunk!

This release contains bug fixes, adds support for a handful of new types, and introduces a few breaking changes to the API and build process (the Zig package manager is alive!).

Allocators for SBs  

The getty.serialize function and the serialize function in SBs now take an optional allocator as a parameter.

This change allows SBs to allocate memory on the heap should they need to before they hand off serialization to a serializer. One example of where this change can be useful is the SB for std.SemanticVersion, which dynamically allocates space whenever formatting a version number since they can be arbitrarily long.

Packaging Getty  

Zig's new package manager is now capable of adding Getty to your projects!

The Installation page has been updated to reflect this and walks you through the new steps. The old, manual way of installing Getty will not work anymore, so be sure to update your build.zig (and build.zig.zon) accordingly!

Support for Gyro and Zigmod has been removed. All hail the Zig package manager!

Fixes

  • The rename attribute has been fixed so that it no longer acts as an alias. (a52ec21)
  • DBs now return error.MissingAllocator when allocation is required but no allocator is present. Before, they would simply panic after attempting to unwrap a null allocator. (644cfc5)
  • The blocks namespaces no longer group similar types together under a single declaration. That is, blocks.ArrayList and blocks.ArrayListAligned are now separate declaration. (5e366ca)
  • The test deserializer now properly checks the length of sequence tokens. (0ca32de)
  • Serialization examples now use the getty.ser.Error error set. (bba74b7)
  • README links and badges have been fixed. (94231c2)

Support

Some new types are now supported by Getty!

Serialization
Deserialization

Other Changes

There are other changes in the Getty 0.4.0 release. You can see the full changelog here.