Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Releases: getty-zig/json

0.4.0

01 Mar 15:20

Choose a tag to compare

0.4.0 Pre-release
Pre-release

Release Notes

What's in 0.4.0

This release is a small one, intended to keep the library up-to-date with Getty 0.4.0.

Improvements

  • The MapKeyDeserializer now implements deserializeIgnored, allowing map keys to be ignored. (c786403)
  • Getty JSON can now be installed via Zig's package manager. (1dd5a2f)

Other Changes

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

0.3.0

27 Jan 04:58

Choose a tag to compare

0.3.0 Pre-release
Pre-release

Release Notes

What's in 0.3.0

Features

  • With a new MapKeyDeserializer, maps with keys that are not strings (e.g., std.AutoHashMap(i32, i32)) can now be deserialized into. (1f533ef, 086dcf4)
  • deserializeAny has been implemented by Deserializer, allowing users to deserialize from multiple possible data types. (cec8be4)

Improvements

  • The custom integer formatting and math code we had has largely been replaced by std equivalents, which we were able to merge in. (03285fe, ca625fe)
  • StructAccess properly unescapes keys now. (487163a)
  • StructAccess now overrides isKeyAllocated, allowing it to specify to the visitor, on a key-by-key basis, whether or not a deserialized key was allocated. (487163a)
  • Elements and entries are no longer serialized once they're specified length is reached. (c9e7a5b).

Bug Fixes

  • The std.ArrayList used in toSliceWith and toPrettySliceWith are now properly freed. Before, they were only freed when an error arose. 7e8314b
  • Ending tokens are now properly parsed. Before, they didn't account for characters such as whitespace. (6f25a28)
    • Thank you to @LordMZTE for bringing this issue up!
  • deserializeIgnored now calls visitVoid instead of just returning a void value. (c9e7a5b).

Other Changes

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

0.2.0

27 Nov 16:16

Choose a tag to compare

0.2.0 Pre-release
Pre-release

Release Notes

WE'RE FASTER THAN std.json NOW LETS GOOOOOOOOOOOOOOOOOOO!

We were already faster for some things, like serializing large integers and long strings, but now we're faster than (or as fast as) std.json for pretty much everything! At least, I think we are. I'm planning on doing some formal benchmarks later on. For now, I've just been using hyperfine and (de)serializing different kinds of values a bunch of times. I have ran this benchmark though, and both Getty JSON and std.json came up even with each other. So woohoo!

I'm really happy with the optimizations I was able to get in this release. I've never really done serious performance optimization work before so it felt good whenever I found a small little thing I could change that gave the library a little boost. It's like a little adrenaline kick each time!

Aside from optimizations, most of the changes this release has been bug fixes and updates to keep up with changes in Getty. This release also contains the first contribution from someone other than me: @LordMZTE! They helped fixed a few important bugs and we've had some great discussions about the library and Getty, so shout out to them!

Changelog

General

  • Added Zigmod support.

Serialization

  • Update union serialization to use the externally tagged representation.
  • Added an internal map key serializer to ensure that keys are properly serialized as strings.
  • Properly escape struct fields during serialization.
  • Integer formatting code has been generalized to all integer types.
  • Optimizations:
    • Validate struct field names at compile-time instead of at run-time.
    • Use a lookup table instead of a switch to see whether 1-byte characters need escaping.
    • Remove unnecessary fixed buffer write during float serialization.

Deserialization

  • Added support for unions (tagged and untagged).
  • Unescape deserialized strings (@LordMZTE , c4ab5b5).
  • Optimizations:
    • Ensure that if an f16, f32, or f64 is being deserialized into, the optimized parsing algorithm will be used.

v0.1.0

23 Mar 18:04

Choose a tag to compare

v0.1.0 Pre-release
Pre-release

Features

  • Core (de)serialization capabilities.
  • Customization of (de)serialization via Blocks and Tuples.
  • Serialization support for the following types:
    • Array
    • Bool
    • Enum
    • Error set
    • Floating-point
    • Integer
    • Null
    • Optional
    • One pointer
    • Slice
    • Struct
    • Tuple
    • Union
    • Vector
    • Void
    • std.ArrayListAligned, std.ArrayListAlignedUnmanaged
    • std.HashMap, std.HashMapUnmanaged
    • std.SinglyLinkedList, std.TailQueue
  • Deserialization support for the following types:
    • Array
    • Bool
    • Enum (non-literal)
    • Floating-point
    • Integer
    • Optional
    • One pointer
    • Slice
    • Struct
    • Tuple
    • Union
    • Void
    • std.ArrayListAligned, std.ArrayListAlignedUnmanaged
    • std.HashMap, std.HashMapUnmanaged
    • std.SinglyLinkedList, std.TailQueue