Protocol Buffers: An Amateur Disaster?

2025-09-05

This article criticizes the design flaws of Protocol Buffers (protobuf), arguing that its type system is poor, its design is ad-hoc, and that it leads to a series of problems that permeate the code. The many restrictions of protobuf stem from its poor solutions to already-solved problems, lacking compositionality. Examples include the inability to repeat oneof fields, and various map field limitations. The article also criticizes protobuf's claims of hassle-free backwards and forwards compatibility, and how it pollutes codebases, making code difficult to write and maintain. The author argues that protobuf is only suitable for large companies like Google, not for most companies, and advises developers to abandon the use of protobuf.

Read more
Development

From One Year to Weeks: Optimizing Program Graph Sharing in a Compiler

2025-05-13

The author spent over a year tackling a compiler's program graph serialization problem. The initial solution was messy and unmaintainable. By collaborating with others and reframing the problem as finding the Lowest Single Common Ancestor (LSCA) in the graph, they leveraged existing LCA algorithm libraries and clever lazy programming techniques. The result is an elegant, linear-time solution, a third the length of the original, effectively resolving performance bottlenecks.

Read more
Development program graph sharing