Hacker GitHub

← All repos

protocolbuffers/protobuf

View on GitHub ↗ ★ 72,148 C++

Protocol Buffers - Google's data interchange format

124 mentions on Hacker News by 89 people: 11 stories, 113 comments · first 2014-12-15 · latest 2026-10-09

Mentions per year 124 mentions · busiest year 2025 (15)
20082026
  1. …that these APIs are necessary to implement the weak-valued caches we've always used in the past: https://github.com/protocolbuffers/protobuf/blob/6559a9f9622...
    comment by haberman · 2026-10-09 · in Python 3.15
  2. https://github.com/protocolbuffers/protobuf/commit/50f9ac3ba... On a sufficiently anemic CPU doing enough fast allocation you can get measurable improvements from that kind of thing, but for a superscalar CPU and a general purpose…
    comment by charleslmunger · 2026-09-18 · in Size-Specialized Memory Allocation
  3. …is deprecated anyway [2]? (I think this is roughly where I got to before when I gave up.) [1] https://github.com/protocolbuffers/protobuf/blob/main/python... [2] https://github.com/protocolbuffers/protobuf/issues/9464
    comment by quietbritishjim · 2026-07-13 · in Protobuf-py: Protobuf for Python, without compromises
  4. …compiler, but you can control its behavior more reliably with __builtin_expect_with_probability https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...
    comment by charleslmunger · 2026-07-05 · in Trust your compiler: Modern C++
  5. I've spent some brainpower on binary search and have not been able to beat this: https://github.com/protocolbuffers/protobuf/blob/44025909eb7... 1. Check for dense list O(1) 2. Check upper bound 3. Constant trip count binary search The…
    comment by charleslmunger · 2026-04-30 · in You can beat the binary search
  6. You're saying we choose Protobufs [1] because Google maintains it but not FlatBuffers [2]? [1] - https://github.com/protocolbuffers/protobuf : Google's data interchange format [2] - https://github.com/google/flatbuffers : Also maintained…
    comment by nindalf · 2026-01-23 · in Replacing Protobuf with Rust
  7. …chains, no weirdly looking code - everything just works. You can see real life example here: https://github.com/protocolbuffers/protobuf/blob/bd7fe97e8c1... Again, even inside Google there were docs that considered those macroses bad and…
    comment by galkk · 2026-01-06 · in Monads in C# (Part 2): Result
  8. …path is still available if the application owner set a flag to turn it back on if they want to: https://github.com/protocolbuffers/protobuf/issues/20760 Java Protobuf also logs a warning now if you can tell you are using gencode old enough…
  9. …of conditional moves (usually inserting them) with __builtin_expect_with_probability(..., 0.5) https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...
    comment by charleslmunger · 2025-11-02 · in When O3 is 2x slower than O2
  10. …arguments without costing extra lines of code. The library I had in mind is Google's RPC callbacks: https://github.com/protocolbuffers/protobuf/blob/main/src/go... This library was written in the C++98 era. It might seem silly now because…
    comment by omoikane · 2025-09-30 · in `std::flip`
  11. …can’t be used as a map key. I filed an issue requesting this and it was denied with an explanation: https://github.com/protocolbuffers/protobuf/issues/7791#issu...
    comment by sgammon · 2025-09-06 · in Protobuffers Are Wrong (2018)
  12. Out of curiosity, does this idiom work in fil-c? https://github.com/protocolbuffers/protobuf/blob/cb873c8987d... // This somewhat silly looking add-and-subtract behavior provides provenance // from the original input buffer's pointer.…
    comment by charleslmunger · 2025-09-05 · in Fil's Unbelievable Garbage Collector
  13. …table taking advantage of arm's fixed instruction width to calculate the jump target with a shift. https://github.com/protocolbuffers/protobuf/commit/b039dfe26... This results in one branch for 1 byte varints, plus one additional branch…
  14. …in C++ used to check for the expected next field before falling back to the switch() (example here: https://github.com/protocolbuffers/protobuf/blob/460e7dd7c47... ) but this was removed in 2016 when load tests found that it hurt more than…
    comment by haberman · 2025-07-23 · in Parsing Protobuf like never before
  15. …use the schema's field numbers as the case labels. You can see an example of that here (in C++): https://github.com/protocolbuffers/protobuf/blob/f763a2a8608... More recently, we've moved towards making Protobuf parsing more data-driven,…
    comment by haberman · 2025-07-23 · in Parsing Protobuf like never before
  16. I wrote a portable abstraction for this that works across Linux, MacOS, and Windows: https://github.com/protocolbuffers/protobuf/blob/4917ec250d3... I call them "linker arrays". They are great when you need to globally register a set of…
    comment by haberman · 2025-07-19 · in C++: Zero-cost static initialization
  17. …for the purposes I needed. [0]: https://github.com/keith-bennett-airmap/grpc-stacksmash [1]: https://github.com/protocolbuffers/protobuf/issues/12732 > I can see various fuzzers in the code base so that claim is also unsubstantiated…
  18. This is doable via this trick: https://github.com/protocolbuffers/protobuf/blob/ae0129fcd01...
    comment by charleslmunger · 2025-07-01 · in The provenance memory model for C
  19. …it's unreasonable for us to ask our users to not be able to use the official Protobuf library). 0 - https://github.com/protocolbuffers/protobuf/issues/19321
  20. …unless something has changed recently. Goes to show that even the behemoths can get this wrong. https://github.com/protocolbuffers/protobuf/blob/6aefdde9736...
  21. …Here's a few somewhat small, contained changes of mine, so we can talk about something concrete: https://github.com/protocolbuffers/protobuf/pull/19893/files This change alters a lock-free data structure to add a monotonicity invariant,…
    comment by charleslmunger · 2025-02-17 · in The Big TDD Misunderstanding (2022)
  22. ▲ 2
    Μpb: Small, Fast C Protobufs
    story by nateb2022 · 2025-01-06 · 0 comments
  23. Best bet is likely https://github.com/protocolbuffers/protobuf/blob/main/docs/f... , which predates editions.
    comment by akshayshah · 2024-12-17 · in Go Protobuf: The New Opaque API
  24. …to power other languages without a from-scratch implementation - and now powers python protos. https://github.com/protocolbuffers/protobuf/tree/main/upb
    comment by charleslmunger · 2024-12-17 · in Go Protobuf: The New Opaque API
  25. …Edition 2023? The closest docs I've found are https://buf.build/blog/protobuf-editions-are-here and https://github.com/protocolbuffers/protobuf/tree/main/docs/d... .
    comment by sa46 · 2024-12-16 · in Go Protobuf: The New Opaque API
  26. This optional field issue seems to have been fixed in 3.15 [0], and seems documented [1]. [0]: https://github.com/protocolbuffers/protobuf/releases/tag/v3.... [1]: https://protobuf.dev/programming-guides/proto3/#field-labels
  27. …and MSVC support is WIP. [1] https://github.com/google/dawn/blob/40cf7fd7bc06f871fc5e4823... [2] https://github.com/protocolbuffers/protobuf/blob/c964e143d97... [3] https://github.com/facebook/react-native/blob/77b3a8bdd6164b... [4]…
    comment by Calavar · 2024-09-07 · in What's new in C++26 (part 1)
  28. …for a project of its age, has several different varint parsing strategies. One is described at https://github.com/protocolbuffers/protobuf/blob/main/src/go... and another at https://github.com/protocolbuffers/protobuf/blob/main/src/go...
  29. See protobuf field presence: https://github.com/protocolbuffers/protobuf/blob/main/docs/f...
  30. …"The protocol compiler can output a FileDescriptorSet containing the .proto files it parses." ( https://github.com/protocolbuffers/protobuf/blob/main/src/go... ) I don't understand the point of using tree-sitter to repeat that work (almost…
    comment by pcj-github · 2024-08-03 · in Parsing Protobuf Definitions with Tree-sitter
  31. ▲ 3
    Show HN: Protobuf Editions now available in v27.0
    story by perezd · 2024-05-24 · 2 comments
  32. It's because they changed the versioning format: https://github.com/protocolbuffers/protobuf/releases?page=5 / https://protobuf.dev/news/2022-05-06/ But I suppose old version still receive bugfixes.
    comment by maeln · 2024-04-30 · in Hitting every branch on the way down
  33. Reminds me of https://github.com/protocolbuffers/protobuf/issues/1491 , which has effectively been WONTFIX (why does github not have this useful distinction?) because Google are happy with how it works and it's really difficult to make…
    comment by pjc50 · 2024-04-30 · in Hitting every branch on the way down
  34. …pushing out a release of the other two that don't contain any changes would be pretty strange. [0]: https://github.com/protocolbuffers/protobuf/tags
    comment by saghm · 2024-04-30 · in Hitting every branch on the way down
  35. …has had decent support for self-describing messages (very similar to avro) as well as reflection https://github.com/protocolbuffers/protobuf/blob/main/src/go... Xgooglers trying to make do on the cheap will just create a Union of all their…
  36. ▲ 3
    Show HN: AuthWin – Authenticator App for Windows
    story by yashg · 2024-03-03 · 10 comments
  37. …but I know of 2 standards for doing this: - SerializeDelimited* is part of the protobuf library: https://github.com/protocolbuffers/protobuf/blob/main/src/go... - Riegeli is "a file format for storing a sequence of string records,…
  38. It looks like Protobuf actually has a test suite to ensure compliance with the protocol: https://github.com/protocolbuffers/protobuf/tree/main/confor... Seems like a good idea for protocols in general to have an official test suite, as a…
  39. …simple framing format [5], instead of claiming that protobuf has no obligation to define one. [1] https://github.com/protocolbuffers/protobuf/blob/main/docs/t... [2] https://github.com/tafia/quick-protobuf/issues/130 [3]…
  40. …looking for bytes that are plausibly the beginning of a FileDescriptorProto message defined here: https://github.com/protocolbuffers/protobuf/blob/main/src/go... This takes advantage of the fact that such descriptors are commonly compiled…
  41. ▲ 3
    How to learn to use protoc in 21 easily infuriating steps
    story by zigzag312 · 2023-08-12 · 0 comments
  42. …discriminating zero value from unset value (aka options), they're back in proto3 (experimental) https://github.com/protocolbuffers/protobuf/blob/main/docs/i...
    comment by ithkuil · 2023-07-22 · in How Turborepo is porting from Go to Rust
  43. On optional.. this was a regression in proto that is somewhat helped by https://github.com/protocolbuffers/protobuf/blob/main/docs/f... ; I have no idea whether protobuf for rust has started taking advantage of this. JSON is awful in every…
    comment by foobiekr · 2023-07-21 · in How Turborepo is porting from Go to Rust
  44. recent versions of proto3 have added back the “optional” keyword that can be used on any field. see: https://github.com/protocolbuffers/protobuf/blob/main/docs/f...
  45. I thought proto3 has support for optional scalar fields now ( https://github.com/protocolbuffers/protobuf/releases/tag/v3.... ), and proto2 always had it
  46. …appearing before and after the declaration which appear to be > attached to the declaration. https://github.com/protocolbuffers/protobuf/blob/v21.5/src/g... After re-reading with this caveat in mind -- that comments are only preserved…
    comment by jhumphries131 · 2022-09-13 · in The Protobuf Language Specification
  47. It appears Google has released a spec as of 11 days ago: https://github.com/protocolbuffers/protobuf/issues/6188#issu...
    comment by season2episode3 · 2022-09-12 · in The Protobuf Language Specification
  48. …since I wrote this so I don't remember exactly, but I think it's just an implementation quirk. See: https://github.com/protocolbuffers/protobuf/blob/main/src/go... The parser consumes a "-", then consumes a number. The number can be any…
    comment by kentonv · 2022-09-12 · in The Protobuf Language Specification
  49. Google actually requested that the community contribute to a real specification. https://github.com/protocolbuffers/protobuf/issues/6188#issu... So we've taken the initiative. No rent-seeking.
    comment by jhumphries131 · 2022-09-12 · in The Protobuf Language Specification
  50. …already has many language bindings, for example: - Protocol Buffer Third-party language bindings: https://github.com/protocolbuffers/protobuf/blob/master/docs... - Apache Thrift language support: https://github.com/apache/thrift/blob/master…
    comment by minhmeoke · 2022-01-02 · in Ask HN: Who wants to collaborate?