Skip to content

Name and origin


Why the name

Paternitas is Latin for "fatherhood".

Paternitas is about finding the Parent of an unknown Node.

Latin law has two terms for it:

  • Affirmatio paternitatis: the affirmation of paternity.
  • Investigatio paternitatis: the investigation of paternity.

Paternitas does both.

Affirmatio paternitatis: a Parent gets its type.

var message: Message = .{ .text = "hello" };
TypedMessage.setTypeId(&message);

Investigatio paternitatis: an erased Node is checked, to find its Parent.

var list: std.DoublyLinkedList = .{};
list.append(TypedMessage.node(&message));

const node: *std.DoublyLinkedList.Node = list.popFirst() orelse return error.ListEmpty;
const recovered: *Message = TypedMessage.parentFromNode(node) orelse return error.WrongParent;

The name is a small joke. The idea is literal.

The Node may be unknown.

Paternitas establishes its parentage.

A note. Both Latin terms were made up while the README was written.

  • We believe they are real Latin.
  • We did not check them in a law book.
  • A joke is a joke.

Where it came from

The trigger was the Ziggit post New LinkedList API footgun.

Paternitas grew out of Matryoshka, a toolkit for background processes.

The same problem appeared in each version:

The useful part turned out to be small enough to use by itself.

So Paternitas was extracted from the Zig version.

Matryoshka can use it as a package.

Your project can too.


Credits