#How to Organize and Type a Large Project (Encoders & Decoders)

1 messages · Page 1 of 1 (latest)

worldly steppe
#

Hey all, I'd really like to pull the networking protocol encoding, decoding, and types from my Betamine project out into a separate package. My hope is that it'd do some heavy lifting for anyone interested in making a Minecraft related project in Gleam (client, chat bot, plugins, etc..). My main issue is there's a whole lot of different packets that can be sent and received and need to be encoded and decoded (over 200 psyduck) some with no data and some with loads of data.

Are there any existing packages of this scale I could reference? I'm trying to figure out how to structure the project along with the types in an intuitive way for others to utilize.

placid marsh
#

I'd probably put it in one module and see how that goes

tired burrow
#

I did something slightly similar (lots of encoders / decoders generated by codegen) and I split them up into modules because there was already kind of clear separation of domains, and had them import some shared internal functions.

In hindsight maybe I should have gone with the one module approach, had to deal with some circular dependency stuff which was annoying.

https://github.com/JonasGruenwald/chrobot/tree/main/src/protocol