#Protozoa :microbe: - A complete Protocol Buffers compiler and library for Gleam!

1 messages · Page 1 of 1 (latest)

elder gazelle
#

For now it's unreleased on hex but you can use it with git deps as I make it prod ready

#

Tbf I made it just for the funsies it's my first attempt at vibe coding and it shows hahaha

tired wadi
#

Dope! That's so cool! It always saddens me that Protobuf doesn't support tagged unions, though

elder gazelle
#

Yeah there are so many cool features and so many more missing ones in the protocol

thin schooner
#

There seems to be a pattern for code generation forming. that I like to see

flint musk
#

oh yes, I'm testing

green osprey
faint vale
#

i dont know much about protobuf, do you think it makes sense to follow squirrel's approach where

your-project/
├── gleam.toml
└── src/
    └── myapp/
        └── proto/
            ├── user.proto
            ├── message.proto
            └── user_service.proto

would generate myapp/proto.gleam, from the code that gets generated right now it looks like this would work nicely

elder gazelle
tired wadi
green osprey
tired wadi
#

Oh fair. Apologies!

green osprey
#

The protobuf docs are absolutely awful, so I probably wouldn't have known about it if I hadn't seen it in use. 🙂

faint vale
elder gazelle
#

Great reasoning, I'm working on it atm thanks to your suggerence

elder gazelle
#

🎉 Protozoa v2.0.2 - Major Architecture Overhaul!

11 commits of massive improvements since v1! 🚀

🔄 Revolutionary Architecture Change

  • 📄 Single File Generation - All proto files now combine into ONE proto.gleam file!
  • 🗂️ No more scattered files - Much cleaner project structure
  • 🧹 Unified imports - Everything in one place, no more complex dependencies

🏗️ Enhanced Google Protocol Buffers Support

  • ✅ Full google.protobuf.Struct & google.protobuf.StringValue integration
  • 🔄 Fixed enum redefinition errors for well-known types
  • 🤝 Seamless mixing - User types + well-known types in single output
  • 📋 Smart deduplication - No duplicate definitions across files

🔍 Intelligent Project Discovery

  • 🎯 Auto-finds gleam.toml in parent directories (../, ../../, etc.)
  • 💡 Smart path resolution - Works from any subdirectory
  • 🛠️ Better error messages - Clear feedback when things go wrong

⚡ Code Generation Quality

  • 🚫 Zero unused variable warnings in generated code
  • 🎨 Clean compiler output - Professional quality generated code
  • 🔧 Enhanced type handling - Better nested message support
  • 📝 Improved decoder generation - Handles complex proto structures

🐛 Critical Fixes

  • 🔄 Fixed duplicate enum handling across multiple proto files
  • 📂 Resolved path traversal bugs for project discovery
  • 💾 Enhanced error handling and user feedback
  • 🧪 Updated test suite for single-file architecture

📈 Version Progression

  • 🏷️ v1 → v2.0.2 (major version bump!)
  • 🔢 2.0.0 introduced the unified file architecture
  • 🔧 2.0.1 & 2.0.2 added polish and fixes

Game-changing update! 🎯 One file to rule them all - much simpler, cleaner, and more maintainable! ✨

#

I freaking love claude code for this kinds of messages it just looks so off hahaha

flint musk
#

Looks like generous update 🙂

#

Have you done whole well-known protobuf types?

elder gazelle
#

Not all of them, there are some that are rarely used that I'm still implementing

#

More specifically

  • google.protobuf.Type
  • google.protobuf.Field
  • google.protobuf.Enum
  • google.protobuf.EnumValue
  • google.protobuf.Option
  • google.protobuf.SourceContext
  • google.protobuf.Api
  • google.protobuf.Method
  • google.protobuf.Mixin
hollow obsidian
#

Looking into using some gRPC in my project, I am both a noob in gRPC and Gleam so please bear with me. do I need something like a gRPC server + protozoa to get gRPC "request" I see protozoa generates services too, but I guess some kind of server still needed to drive it right?

elder gazelle
#

Yes you still need some kind of server

hollow obsidian
#

can the server be a mist server?

elder gazelle
#

not right now as far as I'm aware as gRPC needs HTTP 2.0, and mist has it still not publicly available, so the api may change

rustic flint
#

Wow

#

How did I miss this project

#

Looks fantastic from the README. Do you generate bit array patterns for the decoding?

elder gazelle
#

I think so, long ago that I look into this package code!

elder gazelle
rustic flint
#

Is it because you think it isn't usable yet, or it is because you've not implemented enough of protobuf's format?

elder gazelle
#

There are still some code gen bugs, I think it’s not suitable for production (yet)

rustic flint
#

Makes sense

#

Could do a v0 release with a big warning to let people try it

#

It being available encourages people to contribute fixes etc if they find it promising

elder gazelle
#

The protobuf format is already well implemented I think, the only major thing to proto v2 regarding that

rustic flint
#

Like how I published jot with very little support for the language

elder gazelle
#

Oh I see

#

I think I will do that then, let’s see if it gets enough attention!

rustic flint
#

If you've got it mostly covered I say v0 sounds good, having people try it will help find the bugs

#

It's not like you're actively hunting them out

elder gazelle
#

Okay

#

Thanks for the wise words

#

Mister máster

rustic flint
#

No, thanks for another amazing library, you're killing it

elder gazelle
#

It’s a combination of free time and love for the language tbh

rustic flint
#

It would be really cool to have a package for decoding the Hex registry protobuf objects using this, I wager lots of people would find that useful

elder gazelle
#

Oh that would be nice to have yeah

rustic flint
#

I wonder if you're person #2 for most published libraries 😛

faint vale
#

it sucked when you did it for jot too

elder gazelle
#

HAHAHAHA

rustic flint
#

It sucks less than it never getting any further updates

elder gazelle
#

I feel like my two dads are arguing in the kitchen

rustic flint
#

I wouldn't have worked on jot, Glenatillas wouldn't have worked on this, and Gleam would have no djot and no protobuf!

rustic flint
elder gazelle
#

Hahahaha

rustic flint
#

OK what's the alternative, how do we get people finding the bugs?
tbh this isn't like jot, we do actually think the whole spec is covered, we just don't have confidence that there's no bugs

faint vale
#

the problem is OP not telling people about their library beyond a single post at 11pm cest, that problem goes away if OP talks about their library more 🙂

#

publish v1 with awarning

elder gazelle
faint vale
#

"this might have bugs" is a very normal state for an open source library to be in

rustic flint
#

OK yes Hayleigh is right, you have protobuf v1 sorted, v1 is ideal

elder gazelle
#

But yeah I understand

#

To be fair the api is pretty solid, the bugs wouldn’t affect that

rustic flint
#

And I do always say "version numbers are not indicators of production readiness"

elder gazelle
#

And publishing version 2 in a few weeks wouldn’t make much of a difference if the migration is simple and straightforward

rustic flint
#

Thx Hayleigh for wisdom

elder gazelle
#

Thanks mom and dad

rustic flint
#

tbh when I see a package with v8.5.1 or something I'm like "hey they're actually paying attention to stuff like semver"

faint vale
#

when i see v0 i think "hey im not using that" and move on with my life LOL

#

its hard without the stdlib but its honest work 😔

rustic flint
#

v0.0.1 "coward"
v1.1.0 "new package"
v1.15.0 "semver violator or maybe a coward"
v9.4.0 "good shit"

flint musk
#

using already

rustic flint
#

How have you been finding it?

flint musk
#

I just need to use protobuf 😄

#

fortunately Renata makes great packages I just need, so simple

rustic flint
#

Sounds like another vote in the "publish v1" camp 😁

flint musk
#

yes

faint vale
# flint musk

ive never felt more vindicated than this screenshot

rustic flint
#

@elder gazelle All the libraries you've been publishing have been super nice, and talking publicly about your Gleam app and it being in production is awesome too!
Can I send you some stickers or merch? lucysparkles

elder gazelle
#

just wait for gleam conf 2026, I'll be there!

faint vale
#

POG

elder gazelle
#

I was even thinking of giving a talk but the pressure of talking in public is killing me

flint musk
#

I would enjoy to hear your talk about eventsourcing and deploying you recent app

rustic flint
#

We will def help you prepare the talk

#

Your libraries and your app are v interesting. I know Peter really wants to hear from production users too

rustic flint
#

can post some stickers!

elder gazelle
#

weeeeell if you insist!

elder gazelle
limpid elbow
#

Is support for proto2 planned for this?

#

looking at the the differences it seems that proto2 is more complicated than proto3 sadly

elder gazelle