Re:Typical: Data interchange with algebraic data types
by texuf on Monday May 22, 2023 @01:38AM
(#36027814)
Do you think you could ever generate types for go? The protobuf implementation of oneof in go is pretty rough to look at, and not fun to type over and over.
[ Parent
| on HN ]
Re:Typical: Data interchange with algebraic data types
by stepchowfun on Monday May 22, 2023 @01:56AM
(#36027908)
I'd love for Typical to support Go. We just need someone with enough time to implement it.
Go doesn't have sum types and has an ad hoc story about nullability, so it clashes somewhat with Typical's algebraic type system. Nevertheless, it's important for Go programs to be able to communicate with other programs which do benefit from Typical's hardline stance on type safety, so having code generation support for Go would be great.
If anyone is interested in contributing any code generators, you can start by copying the Rust or TypeScript generator and modifying it appropriately. See the contributing guide here: https://github.com/stepchowfun/typical/blob/main/CONTRIBUTIN...